Skip to main content
Jump to: navigation, search

Difference between revisions of "Riena Migrating to 2.0 from 1.2"

(UIProcess work progress)
Line 59: Line 59:
  
 
''Note: At the moment this property is only used with the SCP widgets MatrixTable and MatrixDetailsComposite. In this context the constant SCPLnfKeyConstants.MATRIX_ADDTIONAL_PADDING_LEFT was renamed in SCPLnfKeyConstants.MATRIX_MATRIX_PIXEL_PER_INDENT''.
 
''Note: At the moment this property is only used with the SCP widgets MatrixTable and MatrixDetailsComposite. In this context the constant SCPLnfKeyConstants.MATRIX_ADDTIONAL_PADDING_LEFT was renamed in SCPLnfKeyConstants.MATRIX_MATRIX_PIXEL_PER_INDENT''.
 
=== 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))
 
  
 
== Adopting 2.0 mechanisms and API ==
 
== Adopting 2.0 mechanisms and API ==
Line 75: Line 72:
  
 
Because of that ensure that every node has a NavigationNodeId.
 
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))
 +
  
 
[[Category:Riena]]
 
[[Category:Riena]]

Revision as of 09:47, 26 February 2010

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.

Incompatibilities

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)

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.

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. In this context the constant SCPLnfKeyConstants.MATRIX_ADDTIONAL_PADDING_LEFT was renamed in SCPLnfKeyConstants.MATRIX_MATRIX_PIXEL_PER_INDENT.

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))

Back to the top