summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-04-28 03:39:02 (EDT)
committerCarsten Drossel2009-04-28 03:39:02 (EDT)
commit882ec200adc526cda4f35b25eca4a086e1174123 (patch)
treeee3a6e81a15de6a842914cf024a77427abfbdc8b
parentb10b1c1709cc0d29e17dd4a59b8c946c1cc18647 (diff)
downloadorg.eclipse.riena-882ec200adc526cda4f35b25eca4a086e1174123.zip
org.eclipse.riena-882ec200adc526cda4f35b25eca4a086e1174123.tar.gz
org.eclipse.riena-882ec200adc526cda4f35b25eca4a086e1174123.tar.bz2
undo fix for bug 261980 - caused unit tests to fail and broke shared view example
-rw-r--r--org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java82
-rw-r--r--org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java7
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractSWTWidgetRidget.java19
-rw-r--r--org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/IMarkableRidget.java6
4 files changed, 17 insertions, 97 deletions
diff --git a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java
index 159deba..33a7580 100644
--- a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java
+++ b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java
@@ -27,8 +27,6 @@ import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.riena.core.Log4r;
@@ -46,8 +44,6 @@ import org.eclipse.riena.navigation.ui.controllers.ControllerUtils;
import org.eclipse.riena.navigation.ui.controllers.SubModuleController;
import org.eclipse.riena.navigation.ui.swt.presentation.SwtViewProviderAccessor;
import org.eclipse.riena.ui.common.IComplexComponent;
-import org.eclipse.riena.ui.ridgets.IMarkableRidget;
-import org.eclipse.riena.ui.ridgets.IRidget;
import org.eclipse.riena.ui.ridgets.swt.uibinding.AbstractViewBindingDelegate;
import org.eclipse.riena.ui.ridgets.swt.uibinding.DefaultSwtBindingDelegate;
import org.eclipse.riena.ui.swt.EmbeddedTitleBar;
@@ -70,8 +66,6 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
private AbstractViewBindingDelegate binding;
private SubModuleController currentController;
- private VisibilityListener visibilityListener;
-
/**
* This node is used when creating this ViewPart inside an RCP application.
* It is created with information from the extension registry, instead being
@@ -96,7 +90,6 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
*/
public SubModuleView() {
binding = createBinding();
- visibilityListener = new VisibilityListener();
}
/**
@@ -171,7 +164,6 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
if (!Beans.isDesignTime()) {
createViewFacade();
doBinding();
- addVisibilityListener(visibilityListener);
}
}
@@ -263,36 +255,19 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
private final class SubModuleNodesListener extends SubModuleNodeListener {
@Override
public void activated(ISubModuleNode source) {
- if (source.equals(currentController.getNavigationNode())) {
+ if (source.equals(getNavigationNode())) {
doBinding();
- addVisibilityListener(visibilityListener);
- }
- }
-
- @Override
- public void deactivated(ISubModuleNode source) {
- if (source.equals(currentController.getNavigationNode())) {
- removeVisibilityListener(visibilityListener);
}
}
@Override
public void block(ISubModuleNode source, boolean block) {
- if (source.equals(currentController.getNavigationNode())) {
+ if (source.equals(getNavigationNode())) {
ControllerUtils.blockRidgets(getController().getRidgets(), block);
blockView(block);
}
}
- }
-
- private void addVisibilityListener(VisibilityListener l) {
- getContentComposite().getDisplay().addFilter(SWT.Show, l);
- getContentComposite().getDisplay().addFilter(SWT.Hide, l);
- }
- private void removeVisibilityListener(VisibilityListener l) {
- getContentComposite().getDisplay().removeFilter(SWT.Show, l);
- getContentComposite().getDisplay().removeFilter(SWT.Hide, l);
}
protected void blockView(boolean block) {
@@ -338,7 +313,7 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
try {
controller = (C) def.createController();
} catch (Exception ex) {
- String message = String.format("cannot create controller for class %s", def.getControllerClass()); //$NON-NLS-1$
+ String message = String.format("cannnot create controller for class %s", def.getControllerClass()); //$NON-NLS-1$
LOGGER.log(LogService.LOG_ERROR, message, ex);
throw new InvocationTargetFailure(message, ex);
}
@@ -358,9 +333,6 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
throw new UnsupportedOperationException();
}
- /**
- * @see org.eclipse.riena.navigation.ui.swt.views.INavigationNodeView#bind(org.eclipse.riena.navigation.INavigationNode)
- */
public void bind(SubModuleNode node) {
if (currentController != getController()) {
@@ -387,47 +359,6 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
}
- private class VisibilityListener implements Listener {
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets
- * .Event)
- */
- public void handleEvent(final Event event) {
- if (shouldBeHandled(event)) {
- getContentComposite().getDisplay().asyncExec(new Runnable() {
- public void run() {
- for (IRidget r : getController().getRidgets()) {
- if (r instanceof IMarkableRidget) {
- ((IMarkableRidget) r).updateMarkers();
- }
- }
- getController().updateNavigationNodeMarkers();
- }
- });
- }
- }
-
- private boolean shouldBeHandled(Event event) {
- return getContentComposite().equals(event.widget)
- || (event.widget instanceof Control && isDescendant(getContentComposite(), (Control) event.widget));
- }
-
- private boolean isDescendant(Control ancestor, Control descendant) {
- if (descendant == null) {
- return false;
- }
-
- if (descendant == ancestor) {
- return true;
- }
-
- return isDescendant(ancestor, descendant.getParent());
- }
- }
-
public SubModuleNode getNavigationNode() {
String viewId = this.getViewSite().getId();
String secondaryId = this.getViewSite().getSecondaryId();
@@ -438,9 +369,6 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
return result;
}
- /**
- * @see org.eclipse.riena.navigation.ui.swt.views.INavigationNodeView#unbind()
- */
public void unbind() {
SubModuleController controller = getController();
if (controller != null) {
@@ -500,7 +428,9 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
if (uiControl instanceof Composite) {
addUIControls((Composite) uiControl);
}
+
}
+
}
private boolean isChildOfComplexComponent(Control uiControl) {
@@ -512,5 +442,7 @@ public abstract class SubModuleView<C extends SubModuleController> extends ViewP
return true;
}
return isChildOfComplexComponent(uiControl.getParent());
+
}
+
}
diff --git a/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java b/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java
index 18e6cf1..026ae6f 100644
--- a/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java
+++ b/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java
@@ -176,11 +176,4 @@ public class SubModuleController extends NavigationNodeController<ISubModuleNode
}
}
- /**
- * @see org.eclipse.riena.navigation.ui.controllers.NavigationNodeController#updateNavigationNodeMarkers()
- */
- @Override
- public void updateNavigationNodeMarkers() {
- super.updateNavigationNodeMarkers();
- }
}
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractSWTWidgetRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractSWTWidgetRidget.java
index 586015f..e018c55 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractSWTWidgetRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractSWTWidgetRidget.java
@@ -399,15 +399,6 @@ public abstract class AbstractSWTWidgetRidget extends AbstractRidget implements
}
}
- /**
- * @see org.eclipse.riena.ui.ridgets.IMarkableRidget#updateMarkers()
- */
- public void updateMarkers() {
- if (markerSupport != null) {
- markerSupport.updateMarkers();
- }
- }
-
// protected methods
// //////////////////
@@ -424,4 +415,14 @@ public abstract class AbstractSWTWidgetRidget extends AbstractRidget implements
mMarker.setDisabled(disable);
}
}
+
+ // helping methods
+ // ////////////////
+
+ private void updateMarkers() {
+ if (markerSupport != null) {
+ markerSupport.updateMarkers();
+ }
+ }
+
}
diff --git a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/IMarkableRidget.java b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/IMarkableRidget.java
index 091b65a..a8c6f9f 100644
--- a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/IMarkableRidget.java
+++ b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/IMarkableRidget.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets;
-
/**
* A Ridget that supports markers. All markers are maintained in a list, ie it
* is valid behaviour to 'mark' a ridget with the same marker type multiple
@@ -76,9 +75,4 @@ public interface IMarkableRidget extends IBasicMarkableRidget {
*/
void setOutputOnly(boolean outputOnly);
- /**
- * Update the representation of the control associated with the ridget based
- * on its markers.
- */
- void updateMarkers();
}