Rap10M4 News

From Eclipsepedia

Jump to: navigation, search

| RAP wiki home | RAP project home |

RAP 1.0 M4 - New and Noteworthy

This document will become the New and Noteworthy page for the next milestone release and meanwhile serves to document the development progress.

All features documented here can be obtained from CVS HEAD.


RWT

API Documentation

The RWT-API classes now provide Java-Doc comments. These comments are adapted from the SWT library since RWT implements a subset of SWT. The revision of the comments is not completed yet and there may be also some anticipations of implementation details that ment to be available in the 1.0 release. If you find inconsistencies in the docs, please report them to us so that we can resolve them.

Untyped Events

RWT now supports untyped events. Note that this implementation exists for reuse of JFace and Workbench code only. If you write application code we recommend to use the typed events furthermore. Note also that there is still some work to do and that not all of the untyped event fields already provide meaningful values. In particular the doit flag does not work.

FontData, Resource, Device

There are new API-classes in RWT available. Those where needed to ease the takeover of the JFace resource package. The classes are org.eclipse.swt.graphics.FontData, org.eclipse.swt.graphics.Resource and org.eclipse.swt.graphics.Device. Note that the API of org.eclipse.swt.graphics.Font has changed, the field accessors have moved to FontData:

  ...
  FontData data = font.getFontData()[ 0 ];
  item.setFont( Font.getFont( data.getName(), 
                              data.getHeight(), 
                              SWT.BOLD ) );

RAP JFace

Move to JFace 3.3

You're reading it right - JFace 3.3 is here! This time, we used the complete JFace 3.3 codebase and stripped down the things not working (at the moment). As we can't support everything out of the box, here is a short list of things you can now use in your RAP application besides the already known stuff.

  • Action and Contribution infrastructure
  • Dialogs
    • IconAndMessageDialog
    • TrayDialog
    • TitleAreaDialog
    • PopupDialog
    • ErrorDialog
    • MessageDialogWithToggle
    • StatusDialog
  • Layouts
    • GridDataFactory
  • Resources
    • Color-, Font- and ImageRegistry
  • Viewers
    • ArrayContentProvider
    • DecoratingLabelProvider, ILabelDecorator, LabelDecorator (only text yet)
    • DoubleclickEvent (for Treeviewer)
    • ViewerFilter
  • Wizard framework

There are many more things in the JFace 3.3 codebase - just get it and play around with it. We're open for all bug reports regarding the (new) components.

Note that some of the components (like DoubleclickEvent, ViewerFilter or the Wizard framework) are now part of the demo application.

RAP JFace implementation related to the following packages is excluded:

  • Keys & Bindings
  • Celleditors,
  • Everything related to progress monitors
  • Owner Drawing
  • Field Assists

Most of them will follow but there is a need for some new infrastructure first. At the moment, you'll find the Java files of the excluded components but they are commented out to avoid confusion using "Organize Imports" or "Open Type".

RAPJFaceWizard.png

RAP Workbench

Support for opening/closing workbench parts

You have now several possibilities to open a new view without initially defining it in your perspective. On the one side, you can use WorkbenchPage#showView("your.view.id") to show the view. All necessary data gets loaded from the server automatically.

Another way is - like you know it from the Eclipse Workbench - to use the "Show View" menu. To implement it in your RAP application, use ContributionItemFactory.VIEWS_SHORTLIST.create(IWorkbenchWindow); to get a list of all view shortcuts of the current perspective which can be used in a MenuManager. But don't forget to add the commonly used views as shortcuts to your perspective (see IPageLayout#addShowViewShortcut("your.view.id")).

For all the views without a shortcut, there is a "Other..." item appended to the end of the list to display the so loved "Show View" dialog where you can browse all available views. HINT: Now you can also categorize your views - just define the category attribute in your view extension.

RapShowViewDlg.png

Move extension points to org.eclipse.ui namespace

To provide as much as possible reuse of RCP knowledge (and code) RAP provides now its workbench extension-points under the same namespace as the RCP workbench does. This is the second step of moving RAP to a subset of RCP regarding RCP-like functionality. Note that you must adjust your existing plugin.xml files like the example below:

RapExtensionPoint.png

Move package org.eclipse.ui.entrypoint to org.eclipse.ui.application

Due to the efforts of making RAP-APIs a subset to RCP-APIs the package org.eclipse.ui.entrypoint has been moved to org.eclipse.ui.application despite the fact that there is no need for implementing IPlatformRunnable as application definition. Please use the organize import functionality of the Eclipse IDE to adjust your existing source code.

Reexport of UI plug-ins

The plug-in org.eclipse.rap.ui.workbench now reexports the basic UI plug-ins that are needed for RAP UI development. This is similar to RCP. The plug-in dependencies are org.eclipse.rap.w4t, org.eclipse.rap.rwt and org.eclipse.rap.jface.

Standalone Views

The implementation of org.eclipse.ui.IPageLayout has been pursued. It is possible to add standalone views as shown in the code snippet below. The resulting perspective layout with the standalone view on the left hand side can be seen in the screenshot.


public class Perspective implements IPerspectiveFactory {

  public void createInitialLayout(IPageLayout layout) {
    String editorArea = layout.getEditorArea();
    layout.setEditorAreaVisible(false);
    layout.addStandaloneView(NavigationView.ID,  false, IPageLayout.LEFT, 0.25f, editorArea);
    IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
    folder.addPlaceholder(View.ID + ":*");
    folder.addView(View.ID);	
    layout.getViewLayout(NavigationView.ID).setCloseable(false);
  }
}

StandaloneView.png

Dynamic part informations

You can now set specific part informations dynamically at runtime. This includes setPartName, setTitle and setTitleToolTip. Please use setPartName for setting the title of your view because setTitle is deprecated and only implemented for compatibility reasons. setContentDescription and setTitleImage are not yet available.

Minor usability improvement

It's now possible to maximize/restore view parts by double-clicking on their corresponding TabItem.


The above features are just the ones that are new since the previous milestone build. Summaries for earlier milestone builds:

New for RAP 1.0 milestone build M3 (April 27, 2007)
New for RAP 1.0 milestone build M2 (March 2, 2007)