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

Riena Migrating to 2.0 from 1.2

Revision as of 18:03, 9 March 2010 by Elias.eclipsesource.com (Talk | contribs) (I18N)

Introduction

Explains how to migrate to Riena 2.0 from 1.2.

While every effort was made to avoid breakage, there are a few areas of incompatibility or new APIs that should be adopted by clients. This page describes those areas and provides migration instructions.

API Incompatibilities

SimpleNavigationNodeProvider - Removed register methods

The following methods have been removed:

  • register(ISubApplicationNodeExtension, INavigationAssembler assembler)
  • register(IModuleGroupNodeExtension, INavigationAssembler assembler)
  • register(IModuleNodeExtension, INavigationAssembler assembler)
  • register(ISubModuleNodeExtension, INavigationAssembler assembler)

In the old implementation of SimpleNavigationNodeProvider these methods do nothing.

INavigationNodeView without controller as generic argument

INavigationNodeView does not longer needs a controller as generic argument (but still a INavigationNode). The information about the controller was never used. (bug 288045)

So all sub classes of INavigationNodeView (e.g. SubModuleView) are a little bit simpler.

Old implementation of INavigationNodeView (or SubModuleView) can simply remove the generic argument of the controller.

SubModuleController & IWindowRidget - Removed getDefaultButton() and setDefaultButton(...) methods

The above methods have been removed. They did not work consistently and did support only a single default button. Use SubModuleController.addDefaultAction(IRidget focusRidget, IActionRidget action) instead. For an example showing how to use this new API refer to DefaultButtonSubModule{View,Controller}. (bug 291708)

SwtApplication - Removed abstract getBundle() method

Any subclass of SwtApplication needed to implement the abstract method getBundle(). However that method was never called. We have removed that method from the class. Leaving your code is no problem, but is also no benefit.

IComboRidget - Removed six obsolete methods

The following methods were never implemented. They would always throw an UnsupportedOperationException.

  • boolean isAddable()
  • boolean isListMutable()
  • boolean isReadonly()
  • void setAddable(boolean addable)
  • void setListMutable(boolean mutable)
  • void setReadonly(boolean readonly)

They have been removed in 2.0.

IStatuslineRemoved - removed hidePopups() method

This method was never implemented (empty body) and is never called. It has been removed in 2.0.

ITextRidget - Removed getAlignment() and setAlignment(int) methods

SWT does not support changing the alignment after creating a Text widget. In 1.2 all occurrences of these methods have intentionally thrown an UnsupportedOperationException. These methods have been removed in 2.0. (bug 239979)

TextRidget - Changed parameter type in protected addListeners(...) and removeListeners(...) methods

Previously, addListeners(...) and removeListeners(...) would accept a Control argument but expect it to be a Text instance. This behavior was documented in the javadoc. With 2.0 the type of the argument has been changed from Control to Text. Because the method is protected, the change only affects custom subclasses of TextRidget that override this method, which is not a typical case. To migrate just change the type from Text to Control.

// Old:
protected synchronized void addListeners(Control control) {
  Text text = (Text) control;
 
// New:
protected synchronized void addListeners(Text control) {
  // ...
 
// Old:
protected synchronized void removeListeners(Control control) {
  Text text = (Text) control;
 
// New:
protected synchronized void removeListeners(Text control) {
  // ...
}

IColumnFormatter - getLeftPadding removed, getLeftIndent added

The method "boolean getLeftPadding(Object)" was replaced by the method "int getLeftIndent(Object)". Now it is possible do define more than one indent per cell of a table.

Note: At the moment this property is only used with the SCP widgets MatrixTable and MatrixDetailsComposite.

I18N

  • Plugin org.eclipse.riena.example.client: Move Message.java, messages.properties to package org.eclipse.riena.example.client.nls
  • Plugin org.eclipse.riena.ui.ridgets: Move Message.java, messages.properties to package org.eclipse.riena.ui.ridgets.nls.
  • Plugin org.eclipse.riena.ui.ridgets.swt: Move Message.java, messages.properties to package org.eclipse.riena.ui.ridgets.swt.nls
  • Plugin org.eclipse.riena.ui.swt: Move Message.java, messages.properties to package org.eclipse.riena.ui.swt.nls

UIControlsFactory - removed two-argument createButtonXYZ(...) methods

Most two-argument methods in this class take a String label as the 2nd argument. Some two-argument methods took the String bindingId as the 2nd argument. To avoid confusion the later methods have been removed (Bug #305061).

The removed methods are:

  • createButtonCheck(Composite, String bindingId) - use createButtonCheck(Composite, String, String)
  • createButtonRadio(Composite, String bindingId) - use createButtonRadio(Composite, String, String)
  • createButtonToggle(Composite, String bindingId) - use createButtonToggle(Composite, String, String)

Adopting 2.0 mechanisms and API

TBD

None-API Changes

hash code of NavigationNode

The generating of the hash code of the class NavigationNode has changed. The property label is not longer used for the generation. So the only important property is the nodeId.

Corresponding to this the equals method also ignores the property label.

Because of that ensure that every node has a NavigationNodeId.

UIProcess work progress

Now the progress inside an UIProcess is interpreted as IProgressMonitor.worked describes. This is the new default behaviour. You can switch to a cummulative mode by setting the ProgresStrategy of the UIProcess (UIProcess.setProgresStrategy(ProcessInfo.ProgresStrategy strategy))

Copyright © Eclipse Foundation, Inc. All Rights Reserved.