Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Rap10M4 News"

m (RAP Workbench)
(Replaced content with "This page was obsolete and has been deleted. Please see the history if you need to access the content.")
 
(23 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__NOTOC__
+
This page was obsolete and has been deleted. Please see the history if you need to access the content.
| [[RAP|RAP wiki home]] | [http://eclipse.org/rap 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 [http://www.eclipse.org/rap/cvs.php CVS] HEAD.
+
 
+
 
+
==RWT==
+
{|
+
|-valign="top" align="left"
+
|width="20%"|'''API Documentation'''
+
|width="80%"|
+
 
+
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.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Untyped Events'''
+
|width="80%"|
+
 
+
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.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''FontData, Resource, Device'''
+
|width="80%"|
+
 
+
There are new API-classes in RWT available. Those where needed to ease the takeover of the JFace resource package. The classes are <code>org.eclipse.swt.graphics.FontData</code>, <code>org.eclipse.swt.graphics.Resource</code> and <code>org.eclipse.swt.graphics.Device</code>. Note that the API of <code>org.eclipse.swt.graphics.Font</code> has changed, the field accessors have moved to <code>FontData</code>:
+
 
+
<pre>
+
  ...
+
  FontData data = font.getFontData()[ 0 ];
+
  item.setFont( Font.getFont( data.getName(),
+
                              data.getHeight(),
+
                              SWT.BOLD ) );
+
</pre>
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Apartment Threading'''
+
|width="80%"|
+
 
+
RWT simulates the ''Apartment Threading'' model of SWT. Because of this <code>Display</code> now provides the methods <code>getThread</code>, <code>syncExcec</code>, <code>asyncExcec</code> and <code>wake</code>. To enable UI-updates that are triggered from asynchronous server threads call <code>org.eclipse.swt.lifecycle.UICallBackUtil.activateUICallBack</code>. Accessing widget methods from non UI-Threads throws a <code>SWTException</code>. If you want to enable UI-updates all the time you may implement the <code>createUI</code> method of <code>IEntryPoint</code> like this:
+
 
+
<pre>
+
  public Display createUI() {
+
    UICallBackUtil.activateUICallBack( getClass().getName() );
+
    final Display result = PlatformUI.createDisplay();
+
    PlatformUI.createAndRunWorkbench( result, new DemoWorbenchAdvisor() );
+
    return result;
+
  }
+
</pre>
+
 
+
|}
+
 
+
==RAP JFace==
+
{|
+
|-valign="top" align="left"
+
|width="20%"|'''Move to JFace 3.3'''
+
|width="80%"|
+
 
+
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 &amp; 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".
+
 
+
[[Image:RAPJFaceWizard.png]]
+
|}
+
 
+
==RAP Workbench==
+
{|
+
|-valign="top" align="left"
+
|width="20%"|'''Support for opening/closing workbench parts'''
+
|width="80%"|
+
 
+
You have now several possibilities to open a new view without initially defining it in your perspective.
+
On the one side, you can use <code>WorkbenchPage#showView("your.view.id")</code> 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 <code>ContributionItemFactory.VIEWS_SHORTLIST.create(IWorkbenchWindow);</code>
+
to get a list of all view shortcuts of the current perspective which can be used in a <code>MenuManager</code>.
+
But don't forget to add the commonly used views as shortcuts to your perspective
+
(see <code>IPageLayout#addShowViewShortcut("your.view.id")</code>).
+
 
+
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 <code>category</code> attribute in your view extension.
+
 
+
[[Image:RapShowViewDlg.png]]
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Move extension points to ''org.eclipse.ui'' namespace'''
+
|width="80%"|
+
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:
+
 
+
[[Image:RapExtensionPoint.png]]
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Move package ''org.eclipse.ui.entrypoint'' to ''org.eclipse.ui.application'''''
+
|width="80%"|
+
 
+
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.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Reexport of UI plug-ins'''
+
|width="80%"|
+
 
+
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''.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Standalone Views'''
+
|width="80%"|
+
 
+
The implementation of <code>org.eclipse.ui.IPageLayout</code> 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.
+
 
+
<pre>
+
 
+
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);
+
  }
+
}
+
</pre>
+
 
+
[[Image:StandaloneView.png]]
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Dynamic part informations'''
+
|width="80%"|
+
 
+
You can now set specific part informations dynamically at runtime. This includes <code>setPartName</code>, <code>setTitle</code> and <code>setTitleToolTip</code>. Please use <code>setPartName</code> for setting the title of your view because <code>setTitle</code> is deprecated and only implemented for compatibility reasons. <code>setContentDescription</code> and <code>setTitleImage</code> are not yet available.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Minor usability improvement'''
+
|width="80%"|
+
 
+
It's now possible to maximize/restore view parts by double-clicking on their corresponding TabItem.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Multiple Views'''
+
|width="80%"|
+
 
+
We added a new method to open views multiple times. Requirement is that the view has the flag <code>allowMultiple</code> set to <code>true</code>.
+
Just use the method <code>showView(viewId, secondaryId, mode)</code> of <code>IWorkbenchPage</code> to show additional instances of a view. Here is a little example:
+
 
+
<pre>
+
 
+
  public void showAdditionalView(IWorkbenchWindow window) {
+
    try {
+
      window.getActivePage().showView(
+
                            "org.eclipse.rap.demo.DemoBrowserViewPart",
+
                            "two" ,
+
                            IWorkbenchPage.VIEW_ACTIVATE );
+
    } catch (PartInitException e) {
+
      e.printStackTrace();
+
    }
+
  }
+
 
+
</pre>
+
 
+
[[Image:RAPMultipleViews.png]]
+
+
|-valign="top" align="left"
+
|width="20%"|'''IWorkbenchBrowserSupport'''
+
|width="80%"|
+
 
+
The <code>IWorkbenchBrowserSupport</code> and <code>IWebBrowser</code> interfaces along with a default implementation that meets the minimal requirements have been added to the workbench. This allows you to open URLs in a popup window.
+
 
+
[[Image:RapExternalBrowser.png]]
+
 
+
The corresponding extension points ''org.eclipse.ui.browser.browsers'' and ''org.eclipse.ui.browserSupport'' as provided by RCP are not yet available.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Support for ISharedImages'''
+
|width="80%"|
+
 
+
There is now the possibility to get predefined images of the workbench by using the <code>ISharedImages</code> interface. The usage could look like this:
+
<pre>
+
action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+
getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+
</pre>
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Views with local pulldown menus'''
+
|width="80%"|
+
 
+
To use the local pulldown menu of your view, simply add the actions to the <code>MenuManager</code> of your <code>ViewSite</code>.
+
 
+
<pre>
+
getViewSite().getActionBars().getMenuManager().add(yourAction);
+
</pre>
+
 
+
In the end, this could look like this:
+
 
+
[[Image:RAPViewMenu.png]]
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Switch to RCP 3.3'''
+
|width="80%"|
+
 
+
With the switch to the RCP 3.3 codebase, there are many improvements on the workbench API. Additionally we now have a fully documented API based on the original javadoc of the Eclipse workbench.
+
Another very nice feature is the support of the command and handler framework (see [[Platform Command Framework]] )
+
 
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Automatic view toolbar arrangement'''
+
|width="80%"|
+
 
+
If there is not enough space left in the TabFolder to show all the view actions, the toolbar is now automatically rearranged to use the full width of the folder.
+
 
+
|-valign="top" align="left"
+
|width="20%"|'''Perspective extensions'''
+
|width="80%"|
+
 
+
The RAP workbench offers you a new extension point: <code>[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/workbench_advext_perspectiveExtension.htm perspectiveExtensions]</code>. With this, you can contribute new views or view shortcuts to existing perspectives across several plugins. The extension point makes it easy to contribute additional views from other plugins to a perspective defined in your core UI plugin.
+
|}
+
 
+
 
+
 
+
The above features are just the ones that are new since the previous milestone build. Summaries for earlier milestone builds:
+
 
+
[[Rap10M3_News|New for RAP 1.0 milestone build M3 (April 27, 2007)]]<br />
+
[[Rap10M2_News|New for RAP 1.0 milestone build M2 (March 2, 2007)]]
+

Latest revision as of 07:12, 8 January 2014

This page was obsolete and has been deleted. Please see the history if you need to access the content.

Back to the top