summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2011-04-14 05:48:25 (EDT)
committerSteffen Kriese2011-04-14 05:48:25 (EDT)
commit9e9b5884b4811d2596b71ddb60eaaf9c021a3606 (patch)
tree6c30533388e37a70e8ad435f5f83d29b70b994ca
parentf2172570bca57b466d945ad8585d287bcdf02915 (diff)
downloadorg.eclipse.riena.toolbox-9e9b5884b4811d2596b71ddb60eaaf9c021a3606.zip
org.eclipse.riena.toolbox-9e9b5884b4811d2596b71ddb60eaaf9c021a3606.tar.gz
org.eclipse.riena.toolbox-9e9b5884b4811d2596b71ddb60eaaf9c021a3606.tar.bz2
assemblyeditor: fixed view/perspective refresh bug
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java5
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java25
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java9
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java17
4 files changed, 46 insertions, 10 deletions
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java
index 008f0d7..80c182a 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java
@@ -54,8 +54,9 @@ public class IconSelectorText extends TextButtonComposite {
final ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(parent.getShell(),
new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
- dialog.setTitle("Tree Selection");
- dialog.setMessage("Select the elements from the tree:");
+ dialog.setTitle("Icon Selection");
+ dialog.setHelpAvailable(false);
+ dialog.setMessage("Select an icon from the list:");
dialog.setInput(project);
dialog.addFilter(new ImageFilter());
dialog.open();
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 ca21c76..7b71ca3 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
@@ -30,19 +30,21 @@ import org.eclipse.riena.toolbox.Util;
*/
public class IdSelectorText extends TextButtonComposite {
- private List<String> ids;
-
/**
* Sets the predefined value in the filter-textfield
*/
private String currentId;
+ private IDataProvider dataProvider;
+
public IdSelectorText(final Composite parent, final Color background, final String title, final String message) {
super(parent, background);
getBrowseButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
+ org.eclipse.core.runtime.Assert.isNotNull(dataProvider);
+ final List<String> ids = dataProvider.getData();
org.eclipse.core.runtime.Assert.isNotNull(ids);
final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
@@ -72,7 +74,22 @@ public class IdSelectorText extends TextButtonComposite {
this.currentId = currentId;
}
- public void setIds(final List<String> viewIds) {
- this.ids = viewIds;
+ /**
+ * @return the dataProvider
+ */
+ public IDataProvider getDataProvider() {
+ return dataProvider;
+ }
+
+ /**
+ * @param dataProvider
+ * the dataProvider to set
+ */
+ public void setDataProvider(final IDataProvider dataProvider) {
+ this.dataProvider = dataProvider;
+ }
+
+ public interface IDataProvider {
+ List<String> getData();
}
}
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 8c56057..dc855da 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
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.riena.toolbox.assemblyeditor.ui.composites;
+import java.util.List;
+
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.events.KeyAdapter;
@@ -23,6 +25,7 @@ import org.eclipse.riena.toolbox.Util;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubApplicationNode;
import org.eclipse.riena.toolbox.assemblyeditor.ui.IconSelectorText;
import org.eclipse.riena.toolbox.assemblyeditor.ui.IdSelectorText;
+import org.eclipse.riena.toolbox.assemblyeditor.ui.IdSelectorText.IDataProvider;
import org.eclipse.riena.toolbox.assemblyeditor.ui.UIControlsFactory;
import org.eclipse.riena.toolbox.assemblyeditor.ui.VerifyTypeIdText;
@@ -62,7 +65,11 @@ public class SubApplicationComposite extends AbstractDetailComposite<SubApplicat
txtIcon.getText().setText(getTextSave(node.getIcon()));
txtIcon.setProject(node.getBundle().getProject());
txtPerspective.getText().setText(getTextSave(node.getPerspective()));
- txtPerspective.setIds(Activator.getDefault().getAssemblyModel().getRcpPerspectiveIds());
+ txtPerspective.setDataProvider(new IDataProvider() {
+ public List<String> getData() {
+ return Activator.getDefault().getAssemblyModel().getRcpPerspectiveIds();
+ }
+ });
}
@Override
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 7c0c154..bd0ded5 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
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.riena.toolbox.assemblyeditor.ui.composites;
+import java.util.List;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
@@ -37,6 +39,7 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.RCPView;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
import org.eclipse.riena.toolbox.assemblyeditor.ui.IconSelectorText;
import org.eclipse.riena.toolbox.assemblyeditor.ui.IdSelectorText;
+import org.eclipse.riena.toolbox.assemblyeditor.ui.IdSelectorText.IDataProvider;
import org.eclipse.riena.toolbox.assemblyeditor.ui.OpenClassLink;
import org.eclipse.riena.toolbox.assemblyeditor.ui.TextButtonComposite;
import org.eclipse.riena.toolbox.assemblyeditor.ui.UIControlsFactory;
@@ -162,9 +165,15 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
GridDataFactory.swtDefaults().applyTo(lnkView);
txtView = new IdSelectorText(parent, workareaBackground, "View Selection",
"Select a View (* = any string, ? = any char):");
- txtView.setIds(Activator.getDefault().getAssemblyModel().getRcpViewIds()); // FIXME
- // use
- // RCPViews
+
+ // FIXME
+ // use
+ // RCPViews
+ txtView.setDataProvider(new IDataProvider() {
+ public List<String> getData() {
+ return Activator.getDefault().getAssemblyModel().getRcpViewIds();
+ }
+ });
GridDataFactory.fillDefaults().grab(true, false).applyTo(txtView);
}
@@ -194,6 +203,8 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
final FilteredTypesSelectionDialog dia = new FilteredTypesSelectionDialog(shell, false,
(IRunnableContext) null, searchScope, IJavaSearchConstants.CLASS_AND_ENUM);
+ dia.setTitle("Controller Selection");
+
if (Util.isGiven(controllerName)) {
dia.setInitialPattern(controllerName, FilteredItemsSelectionDialog.FULL_SELECTION);
} else {