summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-12 05:13:51 (EST)
committerCarsten Drossel2009-01-12 05:13:51 (EST)
commit1ab5777bfa77cac53ce65c6662651e0bd29e73bd (patch)
tree70d0f4e0e4364eed49f406409cc31480553cde98
parente927f33eef4b15160b541e1b8eab7d7efb27f04d (diff)
downloadorg.eclipse.riena-1ab5777bfa77cac53ce65c6662651e0bd29e73bd.zip
org.eclipse.riena-1ab5777bfa77cac53ce65c6662651e0bd29e73bd.tar.gz
org.eclipse.riena-1ab5777bfa77cac53ce65c6662651e0bd29e73bd.tar.bz2
fixed checkstyle warning (method length)
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java
index 903efb6..b1d1b68 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java
@@ -196,12 +196,7 @@ public class TreeSubModuleController extends SubModuleController {
});
final IObservableValue viewerSelection = tree.getSingleSelectionObservable();
- IObservableValue hasSelection = new ComputedValue(Boolean.TYPE) {
- @Override
- protected Object calculate() {
- return Boolean.valueOf(viewerSelection.getValue() != null);
- }
- };
+ IObservableValue hasSelection = new NotNullValue(viewerSelection);
IObservableValue hasNonRootSelection = new ComputedValue(Boolean.TYPE) {
@Override
protected Object calculate() {
@@ -280,4 +275,20 @@ public class TreeSubModuleController extends SubModuleController {
setEnabledRec((TreeNode) child, isEnabled);
}
}
+
+ private final class NotNullValue extends ComputedValue {
+
+ private final IObservableValue value;
+
+ private NotNullValue(IObservableValue value) {
+ super(Boolean.TYPE);
+ this.value = value;
+ }
+
+ @Override
+ protected Object calculate() {
+ return Boolean.valueOf(value.getValue() != null);
+ }
+ }
+
}