summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2011-09-13 03:10:09 (EDT)
committerSteffen Kriese2011-09-13 03:10:09 (EDT)
commitcbba4773dba000665dc9b09b217549031cec21f4 (patch)
tree6a7c2a5980856ea0fb4633d379dae0b8ea59e51e
parentfcf70dd7db7befd9fd7ee3469fbe1573b6dbdfe9 (diff)
downloadorg.eclipse.riena.toolbox-cbba4773dba000665dc9b09b217549031cec21f4.zip
org.eclipse.riena.toolbox-cbba4773dba000665dc9b09b217549031cec21f4.tar.gz
org.eclipse.riena.toolbox-cbba4773dba000665dc9b09b217549031cec21f4.tar.bz2
fixed NPEs in assemblyeditor and removed mandatory marker for view/controller
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java5
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java2
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java4
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java11
4 files changed, 15 insertions, 7 deletions
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java
index 235c1c8..2ad1c18 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java
@@ -37,8 +37,9 @@ public class IdSelectorText extends TextButtonComposite {
private IDataProvider dataProvider;
- public IdSelectorText(final Composite parent, final Color background, final String title, final String message) {
- super(parent, background, true);
+ public IdSelectorText(final Composite parent, final Color background, final String title, final String message,
+ final boolean mandatory) {
+ super(parent, background, mandatory);
getBrowseButton().addSelectionListener(new SelectionAdapter() {
@Override
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java
index e891cd5..2b49799 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java
@@ -98,7 +98,7 @@ public class SubApplicationComposite extends AbstractDetailComposite<SubApplicat
final Label lblPersp = UIControlsFactory.createLabel(parent, "PerspectiveId");
GridDataFactory.swtDefaults().applyTo(lblPersp);
txtPerspective = new IdSelectorText(parent, workareaBackground, "Perspective Selection",
- "Select a Perspective (* = any string, ? = any char):");
+ "Select a Perspective (* = any string, ? = any char):", true);
GridDataFactory.fillDefaults().grab(true, false).applyTo(txtPerspective);
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java
index 256a2e8..9d2460a 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java
@@ -164,7 +164,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
lnkView.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lnkView);
txtView = new IdSelectorText(parent, workareaBackground, "View Selection",
- "Select a View (* = any string, ? = any char):");
+ "Select a View (* = any string, ? = any char):", false);
// FIXME
// use
@@ -191,7 +191,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
private String controllerName;
public BrowseControllerComposite(final Composite parent, final Color background) {
- super(parent, background, true);
+ super(parent, background, false);
getBrowseButton().addSelectionListener(new SelectionAdapter() {
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java
index ac98bb5..04d52f3 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java
@@ -79,6 +79,7 @@ import org.eclipse.riena.toolbox.assemblyeditor.ui.DetailSection;
import org.eclipse.riena.toolbox.assemblyeditor.ui.IDirtyListener;
import org.eclipse.riena.toolbox.assemblyeditor.ui.preferences.PreferenceConstants;
import org.eclipse.riena.ui.swt.MessageBox;
+import org.eclipse.riena.ui.swt.utils.SwtUtilities;
/**
* View that shows the AssemblyTree on the left side and the DetailsSection with
@@ -389,7 +390,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
final AssemblyModel model = Activator.getDefault().getDataProvider().createData();
Activator.getDefault().setAssemblyModel(model);
- if (assemblyTree != null) {
+ if (null != assemblyTree && !SwtUtilities.isDisposed(assemblyTree.getTree())) {
assemblyTree.getTree().getDisplay().asyncExec(new Runnable() {
public void run() {
assemblyTree.setModel(model, false);
@@ -657,7 +658,13 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
.getActiveWorkbenchWindow().getShell(), options, new ArrayContentProvider(), new LabelProvider(),
TITLE);
dia.open();
- final List<Object> diaResult = Arrays.asList(dia.getResult());
+
+ final Object[] result = dia.getResult();
+ if (null == result) {
+ return;
+ }
+
+ final List<Object> diaResult = Arrays.asList(result);
boolean isBundleDirty = false;
if (diaResult.contains(OPTION_DELETE_VIEW_CLASS)) {