added a page to edit required/provided services
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/META-INF/MANIFEST.MF b/modeling/plugins/org.eclipse.pde.ds.ui/META-INF/MANIFEST.MF
index e02a98d..d8b3d38 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/META-INF/MANIFEST.MF
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/META-INF/MANIFEST.MF
@@ -22,14 +22,15 @@
Bundle-Localization: plugin
Export-Package: org.eclipse.pde.ds.ui.internal;x-internal:=true,
org.eclipse.pde.ds.ui.internal.editor;x-internal:=true,
- org.eclipse.pde.ds.ui.internal.editor.action;x-internal:=true,
org.eclipse.pde.ds.ui.internal.editor.composites;x-internal:=true,
- org.eclipse.pde.ds.ui.internal.editor.detailpart;x-internal:=true,
+ org.eclipse.pde.ds.ui.internal.editor.detailpart.properties;x-internal:=true,
+ org.eclipse.pde.ds.ui.internal.editor.detailpart.services;x-internal:=true,
org.eclipse.pde.ds.ui.internal.editor.masterdetail;x-internal:=true,
org.eclipse.pde.ds.ui.internal.editor.wizard;x-internal:=true
Import-Package: org.eclipse.core.databinding,
org.eclipse.core.databinding.observable,
org.eclipse.core.databinding.observable.value,
+ org.eclipse.emf.databinding,
org.eclipse.emf.databinding.edit,
org.eclipse.jface.databinding.swt,
org.eclipse.jface.databinding.viewers,
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/DSEditor.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/DSEditor.java
index f3f5122..b1b1c85 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/DSEditor.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/DSEditor.java
@@ -8,7 +8,7 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: DSEditor.java,v 1.7 2009/06/02 09:09:08 bcabe Exp $
+ * $Id: DSEditor.java,v 1.8 2009/07/03 20:59:37 bcabe Exp $
*/
package org.eclipse.pde.ds.ui.internal.editor;
@@ -89,7 +89,8 @@
// current object
if (isMainResource) {
setMainResource(changedResource);
- getDataBindingContext().updateModels();
+ // TODO this is not OK to do this yet, since updateModels() dirties the command stack...
+ //getDataBindingContext().updateModels();
}
} catch (IOException ioe) {
Activator.log(ioe);
@@ -141,6 +142,7 @@
pages.add(new OverviewPage(this));
pages.add(new PropertiesPage(this));
+ pages.add(new ServicesPage(this));
try {
pages.add(new SourcePage(this));
} catch (NoClassDefFoundError ex) {
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/Messages.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/Messages.java
index a99e208..24f194e 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/Messages.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/Messages.java
@@ -38,6 +38,8 @@
public static String PropertyPage_Property_Section;
+ public static String ServicesPage_Title;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/OverviewPage.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/OverviewPage.java
index 1f16446..6117e7c 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/OverviewPage.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/OverviewPage.java
@@ -8,7 +8,7 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: OverviewPage.java,v 1.9 2009/06/02 10:48:05 bcabe Exp $
+ * $Id: OverviewPage.java,v 1.10 2009/07/02 09:36:15 bcabe Exp $
*/
package org.eclipse.pde.ds.ui.internal.editor;
@@ -53,7 +53,7 @@
* Bind Component composite
*/
// component name
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextName()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Name()).observeDetail(getObservedValue()), new EMFValidatingUpdateValueStrategy(), null);
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextName()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Name()).observeDetail(getObservedValue()), null, null);
// component impl
bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextImplementation()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Implementation()).value(ScrPackage.eINSTANCE.getImplementation_Class()).observeDetail(getObservedValue()), new EMFValidatingUpdateValueStrategy() {
@Override
@@ -65,13 +65,13 @@
}, null);
// component activate
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextActivate()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Activate()).observeDetail(getObservedValue()), new EMFValidatingUpdateValueStrategy(), null);
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextActivate()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Activate()).observeDetail(getObservedValue()), null, null);
// component deactivate
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextDeactivate()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Deactivate()).observeDetail(getObservedValue()), new EMFValidatingUpdateValueStrategy(), null);
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextDeactivate()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Deactivate()).observeDetail(getObservedValue()), null, null);
// component modified
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextModified()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Modified()).observeDetail(getObservedValue()), new EMFValidatingUpdateValueStrategy(), null);
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(_componentComposite.getTextModified()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getComponent_Modified()).observeDetail(getObservedValue()), null, null);
/**
* Bind Options composite
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/PropertiesPage.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/PropertiesPage.java
index d2a2f1e..06f0a3c 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/PropertiesPage.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/PropertiesPage.java
@@ -8,7 +8,7 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: PropertiesPage.java,v 1.6 2009/07/03 16:06:44 bcabe Exp $
+ * $Id: PropertiesPage.java,v 1.7 2009/07/05 17:02:05 bcabe Exp $
*/
package org.eclipse.pde.ds.ui.internal.editor;
@@ -22,7 +22,6 @@
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.viewers.*;
import org.eclipse.pde.ds.scr.*;
-import org.eclipse.pde.ds.ui.internal.editor.action.newPropertiesAction;
import org.eclipse.pde.ds.ui.internal.editor.masterdetail.PropertiesMasterDetail;
import org.eclipse.pde.emfforms.editor.AbstractEmfFormPage;
import org.eclipse.pde.emfforms.editor.EmfFormEditor;
@@ -34,7 +33,7 @@
private PropertiesMasterDetail _propertiesMasterDetail;
- public final static String ID = "ds.propertie"; //$NON-NLS-1$
+ public final static String ID = "ds.properties"; //$NON-NLS-1$
public PropertiesPage(EmfFormEditor<?> editor) {
super(editor, 1, true);
@@ -62,7 +61,7 @@
Command command = AddCommand.create(editingDomain, getObservedValue().getValue(), null, entryP, idx);
editingDomain.getCommandStack().execute(command);
- _propertiesMasterDetail.getViewer().setSelection(new StructuredSelection(p), true);
+ getViewer().setSelection(new StructuredSelection(AdapterFactoryEditingDomain.getWrapper(p, editingDomain)), true);
}
});
@@ -72,13 +71,8 @@
p.setEntry("properties" + System.currentTimeMillis()); //$NON-NLS-1$
Command command = AddCommand.create(editingDomain, getObservedValue().getValue(), null, FeatureMapUtil.createEntry(ScrPackage.Literals.COMPONENT__PROPERTIES, p), 0);
editingDomain.getCommandStack().execute(command);
- }
- });
- _propertiesMasterDetail.getWizardAddButton().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- newPropertiesAction action = new newPropertiesAction(getEditor().getEditorSite().getPage());
- action.run();
+ getViewer().setSelection(new StructuredSelection(AdapterFactoryEditingDomain.getWrapper(p, editingDomain)), true);
}
});
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/ServicesPage.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/ServicesPage.java
new file mode 100644
index 0000000..2060dec
--- /dev/null
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/ServicesPage.java
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2009 Anyware Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anyware Technologies - initial API and implementation
+ *
+ * $Id: PropertiesPage.java,v 1.7 2009/07/05 17:02:05 bcabe Exp $
+ */
+package org.eclipse.pde.ds.ui.internal.editor;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.DeleteCommand;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.pde.ds.scr.*;
+import org.eclipse.pde.ds.ui.internal.editor.masterdetail.ServicesMasterDetail;
+import org.eclipse.pde.emfforms.editor.AbstractEmfFormPage;
+import org.eclipse.pde.emfforms.editor.EmfFormEditor;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Composite;
+
+public class ServicesPage extends AbstractEmfFormPage {
+
+ private ServicesMasterDetail _servicesMasterDetail;
+
+ public final static String ID = "ds.services"; //$NON-NLS-1$
+
+ public ServicesPage(EmfFormEditor<?> editor) {
+ super(editor, 1, true);
+ }
+
+ public void bind(DataBindingContext bindingContext) {
+ final EditingDomain editingDomain = ((DSEditor) getEditor()).getEditingDomain();
+
+ _servicesMasterDetail.setComponentAndEditingDomain(getEditor().getInputObservable(), getEditor().getAdapterFactory(), editingDomain, getEditorSite(), bindingContext);
+ // the following has to be done after setting the editing domain
+ _servicesMasterDetail.registerContextMenu();
+
+ _servicesMasterDetail.getBtnAddProvided().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object sel = ((IStructuredSelection) getViewer().getSelection()).getFirstElement();
+ Provide p = ScrFactory.eINSTANCE.createProvide();
+ Command command = AddCommand.create(editingDomain, ((Component) getObservedValue().getValue()).getService(), null, p);
+ editingDomain.getCommandStack().execute(command);
+
+ getViewer().setSelection(new StructuredSelection(AdapterFactoryEditingDomain.getWrapper(p, editingDomain)), true);
+ }
+ });
+
+ _servicesMasterDetail.getBtnAddRequired().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Reference r = ScrFactory.eINSTANCE.createReference();
+ r.setName("ref" + System.currentTimeMillis()); //$NON-NLS-1$
+ Command command = AddCommand.create(editingDomain, getObservedValue().getValue(), null, FeatureMapUtil.createEntry(ScrPackage.Literals.COMPONENT__REFERENCE, r), 0);
+ editingDomain.getCommandStack().execute(command);
+
+ getViewer().setSelection(new StructuredSelection(AdapterFactoryEditingDomain.getWrapper(r, editingDomain)), true);
+ }
+ });
+
+ _servicesMasterDetail.getBtnRemove().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object sel = ((IStructuredSelection) getViewer().getSelection()).getFirstElement();
+ if (sel != null) {
+ Command c = DeleteCommand.create(editingDomain, sel);
+ editingDomain.getCommandStack().execute(c);
+ }
+ }
+ });
+
+ }
+
+ public void createContents(Composite parent) {
+ createDataMasterDetailSection(parent);
+ }
+
+ private void createDataMasterDetailSection(Composite parent) {
+ _servicesMasterDetail = new ServicesMasterDetail();
+ _servicesMasterDetail.createContent(this.getManagedForm());
+ // it is bad to manipulate editor here, but to manage Cut/Copy/Paste,
+ // the editor shall add a listener the viewer, and this is a way for him
+ // to know that viewer exists.
+ ((DSEditor) getEditor()).addViewerToListenTo((StructuredViewer) getViewer());
+ }
+
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if (active) {
+ // force the selection, to avoid a bug on the ContextMenu (on tab
+ // changed, display menu was unconsistent)
+ IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
+ getViewer().setSelection(selection);
+ getViewer().refresh();
+ }
+ }
+
+ @Override
+ public String getId() {
+ return ID;
+ }
+
+ @Override
+ public String getPartName() {
+ return Messages.ServicesPage_Title;
+ }
+
+ @Override
+ public Viewer getViewer() {
+ return _servicesMasterDetail.getViewer();
+ }
+
+ private IObservableValue getObservedValue() {
+ return ((DSEditor) getEditor()).getInputObservable();
+ }
+
+}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/action/newPropertiesAction.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/action/newPropertiesAction.java
deleted file mode 100644
index 5458e03..0000000
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/action/newPropertiesAction.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.eclipse.pde.ds.ui.internal.editor.action;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.pde.ds.ui.internal.editor.wizard.AddPropertiesWizard;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-
-public class newPropertiesAction extends Action {
-
- private IWorkbenchPage workbenchPage;
-
- public newPropertiesAction(IWorkbenchPage workbenchPage) {
- super();
- this.workbenchPage = workbenchPage;
- }
-
- @Override
- public void run() {
- AddPropertiesWizard wizard = new AddPropertiesWizard(workbenchPage);
-
- Shell shell = workbenchPage.getWorkbenchWindow().getShell();
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.open();
-
- }
-
-}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/composites/ProvideComposite.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/composites/ProvideComposite.java
new file mode 100644
index 0000000..eb9f19c
--- /dev/null
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/composites/ProvideComposite.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2009 Anyware Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anyware Technologies - initial API and implementation
+ *
+ * $Id: ComponentComposite.java,v 1.3 2009/04/24 21:33:47 bcabe Exp $
+ */
+package org.eclipse.pde.ds.ui.internal.editor.composites;
+
+import org.eclipse.pde.emfforms.editor.PDEFormToolkit;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+public class ProvideComposite extends Composite {
+
+ private Text _textInterface;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public ProvideComposite(Composite parent, int style) {
+ super(parent, style);
+ createContents();
+ hookListeners();
+ }
+
+ private void hookListeners() {
+ }
+
+ private void createContents() {
+ _textInterface = PDEFormToolkit.createLabelAndText("Interface", this);
+ }
+
+ public Text getTextInterface() {
+ return _textInterface;
+ }
+}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/composites/ReferenceComposite.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/composites/ReferenceComposite.java
new file mode 100644
index 0000000..965bf22
--- /dev/null
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/composites/ReferenceComposite.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2009 Anyware Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anyware Technologies - initial API and implementation
+ *
+ * $Id: ComponentComposite.java,v 1.3 2009/04/24 21:33:47 bcabe Exp $
+ */
+package org.eclipse.pde.ds.ui.internal.editor.composites;
+
+import org.eclipse.pde.emfforms.editor.PDEFormToolkit;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+public class ReferenceComposite extends Composite {
+
+ private Text _textName;
+
+ private Text _textInterface;
+
+ private Text _textTarget;
+
+ private Text _textBind;
+
+ private Text _textUnbind;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public ReferenceComposite(Composite parent, int style) {
+ super(parent, style);
+ createContents();
+ hookListeners();
+ }
+
+ private void hookListeners() {
+ }
+
+ private void createContents() {
+ _textName = PDEFormToolkit.createLabelAndText("Name:", this);
+ _textInterface = PDEFormToolkit.createLabelAndText("Interface", this);
+ _textTarget = PDEFormToolkit.createLabelAndText("Target", this);
+ _textBind = PDEFormToolkit.createLabelAndText("Bind", this);
+ _textUnbind = PDEFormToolkit.createLabelAndText("Unbind", this);
+ }
+
+ public Text getTextName() {
+ return _textName;
+ }
+
+ public Text getTextInterface() {
+ return _textInterface;
+ }
+
+ public Text getTextTarget() {
+ return _textTarget;
+ }
+
+ public Text getTextBind() {
+ return _textBind;
+ }
+
+ public Text getTextUnbind() {
+ return _textUnbind;
+ }
+}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertiesDetailsPart.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/properties/PropertiesDetailsPart.java
similarity index 96%
rename from modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertiesDetailsPart.java
rename to modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/properties/PropertiesDetailsPart.java
index db896f0..26a0a15 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertiesDetailsPart.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/properties/PropertiesDetailsPart.java
@@ -8,9 +8,9 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: PropertiesDetailsPart.java,v 1.5 2009/06/02 10:48:03 bcabe Exp $
+ * $Id: PropertiesDetailsPart.java,v 1.6 2009/07/03 16:07:03 bcabe Exp $
*/
-package org.eclipse.pde.ds.ui.internal.editor.detailpart;
+package org.eclipse.pde.ds.ui.internal.editor.detailpart.properties;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.observable.value.IObservableValue;
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertyDetailsPart.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/properties/PropertyDetailsPart.java
similarity index 93%
rename from modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertyDetailsPart.java
rename to modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/properties/PropertyDetailsPart.java
index a1d77a5..4529f25 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertyDetailsPart.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/properties/PropertyDetailsPart.java
@@ -8,9 +8,9 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: PropertyDetailsPart.java,v 1.6 2009/06/26 10:49:34 bcabe Exp $
+ * $Id: PropertyDetailsPart.java,v 1.7 2009/07/03 16:06:55 bcabe Exp $
*/
-package org.eclipse.pde.ds.ui.internal.editor.detailpart;
+package org.eclipse.pde.ds.ui.internal.editor.detailpart.properties;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -27,7 +27,6 @@
import org.eclipse.pde.ds.scr.JavaType;
import org.eclipse.pde.ds.scr.ScrPackage;
import org.eclipse.pde.ds.ui.internal.editor.composites.PropertyComposite;
-import org.eclipse.pde.emfforms.databinding.EMFValidatingUpdateValueStrategy;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.*;
@@ -83,7 +82,7 @@
bindingContext.bindValue(ViewersObservables.observeSingleSelection(propertyComposite.getComboType()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperty_Type()).observeDetail(currentProperty), null, null);
//Value
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(propertyComposite.getTextValue()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperty_Value()).observeDetail(currentProperty), new EMFValidatingUpdateValueStrategy(), null);
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(propertyComposite.getTextValue()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperty_Value()).observeDetail(currentProperty), null, null);
}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertiesDetailsPart.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/services/ProvideDetailsPart.java
similarity index 68%
copy from modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertiesDetailsPart.java
copy to modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/services/ProvideDetailsPart.java
index db896f0..9c74184 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertiesDetailsPart.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/services/ProvideDetailsPart.java
@@ -8,9 +8,9 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: PropertiesDetailsPart.java,v 1.5 2009/06/02 10:48:03 bcabe Exp $
+ * $Id: PropertyDetailsPart.java,v 1.7 2009/07/03 16:06:55 bcabe Exp $
*/
-package org.eclipse.pde.ds.ui.internal.editor.detailpart;
+package org.eclipse.pde.ds.ui.internal.editor.detailpart.services;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -24,27 +24,27 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.pde.ds.scr.ScrPackage;
-import org.eclipse.pde.ds.ui.internal.editor.composites.PropertiesComposite2;
+import org.eclipse.pde.ds.ui.internal.editor.composites.ProvideComposite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.*;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
-public class PropertiesDetailsPart implements IDetailsPage {
+public class ProvideDetailsPart implements IDetailsPage {
+ private ProvideComposite provideComposite;
private IManagedForm managedForm;
private EditingDomain editingDomain;
private DataBindingContext dataBindingContext;
- private IObservableValue currentProperties;
- private PropertiesComposite2 propertiesComposite;
+ private IObservableValue currentProperty;
- public PropertiesDetailsPart(IManagedForm managedForm, EditingDomain editingDomain, DataBindingContext dataBindingContext) {
+ public ProvideDetailsPart(IManagedForm managedForm, EditingDomain editingDomain, DataBindingContext dataBindingContext) {
this.managedForm = managedForm;
this.editingDomain = editingDomain;
this.dataBindingContext = dataBindingContext;
- this.currentProperties = new WritableValue();
+ currentProperty = new WritableValue();
}
public void createContents(Composite parent) {
@@ -56,31 +56,29 @@
section.marginWidth = 10;
section.marginHeight = 5;
- propertiesComposite = new PropertiesComposite2(section, SWT.NONE);
- GridDataFactory.fillDefaults().span(1, 1).grab(true, true).applyTo(propertiesComposite);
+ provideComposite = new ProvideComposite(section, SWT.NONE);
+ GridDataFactory.fillDefaults().span(1, 1).grab(true, true).applyTo(provideComposite);
- managedForm.getToolkit().adapt(propertiesComposite);
+ managedForm.getToolkit().adapt(provideComposite);
- toolkit.adapt(propertiesComposite);
- propertiesComposite.setParent(section);
+ toolkit.adapt(provideComposite);
+ provideComposite.setParent(section);
- section.setClient(propertiesComposite);
+ section.setClient(provideComposite);
GridDataFactory.fillDefaults().grab(true, true).applyTo(section);
bind(dataBindingContext);
}
- private void bind(DataBindingContext bindingContext) {
-
- // Entry
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(propertiesComposite.getTextEntry()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperties_Entry()).observeDetail(currentProperties), null, null);
+ protected void bind(DataBindingContext bindingContext) {
+ // Interface
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(provideComposite.getTextInterface()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProvide_Interface()).observeDetail(currentProperty), null, null);
}
public void commit(boolean onSave) {
}
public void dispose() {
-
}
public void initialize(IManagedForm form) {
@@ -99,8 +97,8 @@
}
public void setFocus() {
- propertiesComposite.getTextEntry().setFocus();
- propertiesComposite.getTextEntry().selectAll();
+ provideComposite.getTextInterface().setFocus();
+ provideComposite.getTextInterface().selectAll();
}
public boolean setFormInput(Object input) {
@@ -110,7 +108,7 @@
public void selectionChanged(IFormPart part, ISelection selection) {
IStructuredSelection sel = (IStructuredSelection) selection;
Object unwrappedElement = AdapterFactoryEditingDomain.unwrap(sel.getFirstElement());
- currentProperties.setValue(unwrappedElement);
+ currentProperty.setValue(unwrappedElement);
}
}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertyDetailsPart.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/services/ReferenceDetailsPart.java
similarity index 60%
copy from modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertyDetailsPart.java
copy to modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/services/ReferenceDetailsPart.java
index a1d77a5..fddffe8 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/PropertyDetailsPart.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/detailpart/services/ReferenceDetailsPart.java
@@ -8,9 +8,9 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: PropertyDetailsPart.java,v 1.6 2009/06/26 10:49:34 bcabe Exp $
+ * $Id: PropertyDetailsPart.java,v 1.7 2009/07/03 16:06:55 bcabe Exp $
*/
-package org.eclipse.pde.ds.ui.internal.editor.detailpart;
+package org.eclipse.pde.ds.ui.internal.editor.detailpart.services;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -19,30 +19,27 @@
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.databinding.swt.WidgetProperties;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.pde.ds.scr.JavaType;
import org.eclipse.pde.ds.scr.ScrPackage;
-import org.eclipse.pde.ds.ui.internal.editor.composites.PropertyComposite;
-import org.eclipse.pde.emfforms.databinding.EMFValidatingUpdateValueStrategy;
+import org.eclipse.pde.ds.ui.internal.editor.composites.ReferenceComposite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.*;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
-public class PropertyDetailsPart implements IDetailsPage {
+public class ReferenceDetailsPart implements IDetailsPage {
- private PropertyComposite propertyComposite;
+ private ReferenceComposite referenceComposite;
private IManagedForm managedForm;
private EditingDomain editingDomain;
private DataBindingContext dataBindingContext;
private IObservableValue currentProperty;
- public PropertyDetailsPart(IManagedForm managedForm, EditingDomain editingDomain, DataBindingContext dataBindingContext) {
+ public ReferenceDetailsPart(IManagedForm managedForm, EditingDomain editingDomain, DataBindingContext dataBindingContext) {
this.managedForm = managedForm;
this.editingDomain = editingDomain;
this.dataBindingContext = dataBindingContext;
@@ -59,31 +56,35 @@
section.marginWidth = 10;
section.marginHeight = 5;
- propertyComposite = new PropertyComposite(section, SWT.NONE);
- GridDataFactory.fillDefaults().span(1, 1).grab(true, true).applyTo(propertyComposite);
+ referenceComposite = new ReferenceComposite(section, SWT.NONE);
+ GridDataFactory.fillDefaults().span(1, 1).grab(true, true).applyTo(referenceComposite);
- managedForm.getToolkit().adapt(propertyComposite);
+ managedForm.getToolkit().adapt(referenceComposite);
- toolkit.adapt(propertyComposite);
- propertyComposite.setParent(section);
+ toolkit.adapt(referenceComposite);
+ referenceComposite.setParent(section);
- section.setClient(propertyComposite);
+ section.setClient(referenceComposite);
GridDataFactory.fillDefaults().grab(true, true).applyTo(section);
- propertyComposite.getComboType().setInput(JavaType.values());
bind(dataBindingContext);
-
}
protected void bind(DataBindingContext bindingContext) {
// Name
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(propertyComposite.getTextName()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperty_Name()).observeDetail(currentProperty), null, null);
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(referenceComposite.getTextName()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getReference_Name()).observeDetail(currentProperty), null, null);
- // Type
- bindingContext.bindValue(ViewersObservables.observeSingleSelection(propertyComposite.getComboType()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperty_Type()).observeDetail(currentProperty), null, null);
+ // Interface
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(referenceComposite.getTextInterface()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getReference_Interface()).observeDetail(currentProperty), null, null);
- //Value
- bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(propertyComposite.getTextValue()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getProperty_Value()).observeDetail(currentProperty), new EMFValidatingUpdateValueStrategy(), null);
+ // Target
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(referenceComposite.getTextTarget()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getReference_Target()).observeDetail(currentProperty), null, null);
+
+ // Bind
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(referenceComposite.getTextBind()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getReference_Bind()).observeDetail(currentProperty), null, null);
+
+ // Unbind
+ bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).observe(referenceComposite.getTextUnbind()), EMFEditProperties.value(editingDomain, ScrPackage.eINSTANCE.getReference_Unbind()).observeDetail(currentProperty), null, null);
}
@@ -109,8 +110,8 @@
}
public void setFocus() {
- propertyComposite.getTextName().setFocus();
- propertyComposite.getTextName().selectAll();
+ referenceComposite.getTextName().setFocus();
+ referenceComposite.getTextName().selectAll();
}
public boolean setFormInput(Object input) {
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/PropertiesMasterDetail.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/PropertiesMasterDetail.java
index ed548d0..e4d3fe0 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/PropertiesMasterDetail.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/PropertiesMasterDetail.java
@@ -8,17 +8,15 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: PropertiesMasterDetail.java,v 1.6 2009/07/03 15:24:54 bcabe Exp $
+ * $Id: PropertiesMasterDetail.java,v 1.7 2009/07/05 17:02:04 bcabe Exp $
*/
package org.eclipse.pde.ds.ui.internal.editor.masterdetail;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.provider.WrapperItemProvider;
import org.eclipse.emf.edit.ui.dnd.*;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
@@ -29,8 +27,8 @@
import org.eclipse.pde.ds.scr.Properties;
import org.eclipse.pde.ds.scr.Property;
import org.eclipse.pde.ds.ui.internal.editor.Messages;
-import org.eclipse.pde.ds.ui.internal.editor.detailpart.PropertiesDetailsPart;
-import org.eclipse.pde.ds.ui.internal.editor.detailpart.PropertyDetailsPart;
+import org.eclipse.pde.ds.ui.internal.editor.detailpart.properties.PropertiesDetailsPart;
+import org.eclipse.pde.ds.ui.internal.editor.detailpart.properties.PropertyDetailsPart;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.Transfer;
@@ -53,7 +51,6 @@
private Button addButtonProperty;
private Button addButtonProperties;
private Button removeButton;
- private Button wizardAddButton;
public PropertiesMasterDetail() {
super();
@@ -144,10 +141,6 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(addButtonProperties);
addButtonProperties.setText("Add Properties"); //$NON-NLS-1$
- wizardAddButton = new Button(buttonComposite, SWT.FLAT | SWT.PUSH);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(wizardAddButton);
- wizardAddButton.setText("Add..."); //$NON-NLS-1$
-
removeButton = new Button(buttonComposite, SWT.FLAT | SWT.PUSH);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(removeButton);
removeButton.setText("Remove..."); //$NON-NLS-1$
@@ -207,12 +200,7 @@
}
public Object getPageKey(Object object) {
- if (object instanceof WrapperItemProvider) {
- WrapperItemProvider wip = (WrapperItemProvider) object;
- EObject o = (EObject) wip.getEditableValue(object);
- return o;
- }
- return null;
+ return AdapterFactoryEditingDomain.unwrap(object);
}
public Button getAddButtonProperty() {
@@ -227,7 +215,4 @@
return this.addButtonProperties;
}
- public Button getWizardAddButton() {
- return wizardAddButton;
- }
}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/ServicesMasterDetail.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/ServicesMasterDetail.java
new file mode 100644
index 0000000..7f04bde
--- /dev/null
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/masterdetail/ServicesMasterDetail.java
@@ -0,0 +1,222 @@
+/**
+ * Copyright (c) 2009 Anyware Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anyware Technologies - initial API and implementation
+ *
+ * $Id: PropertiesMasterDetail.java,v 1.7 2009/07/05 17:02:04 bcabe Exp $
+ */
+package org.eclipse.pde.ds.ui.internal.editor.masterdetail;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.ui.dnd.*;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.databinding.viewers.ViewerProperties;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.pde.ds.scr.*;
+import org.eclipse.pde.ds.ui.internal.editor.Messages;
+import org.eclipse.pde.ds.ui.internal.editor.detailpart.services.ProvideDetailsPart;
+import org.eclipse.pde.ds.ui.internal.editor.detailpart.services.ReferenceDetailsPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.ui.forms.*;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class ServicesMasterDetail extends MasterDetailsBlock implements IDetailsPageProvider {
+
+ private TreeViewer _viewer;
+ private EditingDomain _editingDomain;
+ private DataBindingContext _databindingContext;
+ private IManagedForm _managedForm;
+
+ private Button _btnAddProvided;
+ private Button _btnAddRequired;
+ private Button _btnRemove;
+
+ public ServicesMasterDetail() {
+ super();
+ }
+
+ @Override
+ public void createContent(IManagedForm managedForm) {
+ super.createContent(managedForm);
+ sashForm.setLayout(new FillLayout());
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(sashForm);
+ }
+
+ public StructuredViewer getViewer() {
+ return _viewer;
+ }
+
+ public void setComponentAndEditingDomain(IObservableValue iObservableValue, AdapterFactory adapterFactory, EditingDomain editingDomain, IEditorSite editorSite, DataBindingContext bindingContext) {
+ _editingDomain = editingDomain;
+ _databindingContext = bindingContext;
+
+ getViewer().setContentProvider(new AdapterFactoryContentProvider(adapterFactory) {
+ @Override
+ public Object[] getElements(Object object) {
+ List<Object> l = new ArrayList<Object>();
+ Object[] elems = super.getElements(object);
+ for (Object o : elems)
+ l.add(o);
+ Service service = ((Component) object).getService();
+ if (service != null) {
+ Object[] children = super.getChildren(service);
+ for (Object o : children)
+ l.add(o);
+ }
+ return l.toArray();
+ }
+ });
+ getViewer().setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ getViewer().addFilter(new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ Object unwrappedElement = AdapterFactoryEditingDomain.unwrap(element);
+ return (unwrappedElement instanceof Reference || unwrappedElement instanceof Provide);
+ }
+ });
+ _databindingContext.bindValue(ViewerProperties.input().observe(_viewer), iObservableValue);
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] {LocalTransfer.getInstance()};
+ _viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(_viewer));
+ _viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(_editingDomain, _viewer));
+
+ _viewer.expandAll();
+ }
+
+ public void registerContextMenu() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void createMasterPart(IManagedForm managedForm, Composite parent) {
+ _managedForm = managedForm;
+ FormToolkit toolkit = managedForm.getToolkit();
+
+ Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section.setText(Messages.PropertyPage_Title);
+ section.setDescription("Select the property/properties you want to edit"); //$NON-NLS-1$
+ section.marginWidth = 10;
+ section.setLayout(new FillLayout());
+ section.marginHeight = 5;
+
+ Composite client = toolkit.createComposite(section, SWT.WRAP);
+ GridLayoutFactory.fillDefaults().numColumns(1).applyTo(client);
+
+ Composite browseComposite = new Composite(client, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(2).applyTo(browseComposite);
+
+ FilteredTree ft = new FilteredTree(browseComposite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), true);
+ _viewer = ft.getViewer();
+
+ GridDataFactory.fillDefaults().grab(true, true).span(1, 2).applyTo(_viewer.getControl());
+
+ Composite buttonComposite = new Composite(browseComposite, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(1).applyTo(buttonComposite);
+
+ _btnAddProvided = new Button(buttonComposite, SWT.FLAT | SWT.PUSH);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(_btnAddProvided);
+ _btnAddProvided.setText("Add Provided Service"); //$NON-NLS-1$
+
+ _btnAddRequired = new Button(buttonComposite, SWT.FLAT | SWT.PUSH);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(_btnAddRequired);
+ _btnAddRequired.setText("Add Required Service"); //$NON-NLS-1$
+
+ _btnRemove = new Button(buttonComposite, SWT.FLAT | SWT.PUSH);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(_btnRemove);
+ _btnRemove.setText("Remove"); //$NON-NLS-1$
+
+ GridDataFactory.fillDefaults().applyTo(buttonComposite);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(browseComposite);
+
+ //toolkit.paintBordersFor(client);
+
+ final SectionPart spart = new SectionPart(section);
+ managedForm.addPart(spart);
+
+ getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ _managedForm.fireSelectionChanged(spart, event.getSelection());
+ updateActionsEnablement();
+ }
+
+ private void updateActionsEnablement() {
+ }
+
+ });
+
+ getViewer().addOpenListener(new IOpenListener() {
+
+ public void open(OpenEvent event) {
+ detailsPart.setFocus();
+ }
+ });
+
+ //createMasterSectionActions(section);
+ section.setClient(client);
+
+ }
+
+ @Override
+ protected void createToolBarActions(IManagedForm managedForm) {
+ sashForm.setWeights(new int[] {40, 60});
+ }
+
+ @Override
+ protected void registerPages(DetailsPart detailsPart) {
+ detailsPart.registerPage(Reference.class, new ReferenceDetailsPart(_managedForm, _editingDomain, _databindingContext));
+ detailsPart.registerPage(Provide.class, new ProvideDetailsPart(_managedForm, _editingDomain, _databindingContext));
+
+ detailsPart.setPageProvider(this);
+ }
+
+ public IDetailsPage getPage(Object key) {
+ if (key instanceof Reference) {
+ return new ReferenceDetailsPart(_managedForm, _editingDomain, _databindingContext);
+ }
+ if (key instanceof Provide) {
+ return new ProvideDetailsPart(_managedForm, _editingDomain, _databindingContext);
+ }
+ return null;
+ }
+
+ public Object getPageKey(Object object) {
+ return AdapterFactoryEditingDomain.unwrap(object);
+ }
+
+ public Button getBtnAddProvided() {
+ return _btnAddProvided;
+ }
+
+ public Button getBtnAddRequired() {
+ return _btnAddRequired;
+ }
+
+ public Button getBtnRemove() {
+ return _btnRemove;
+ }
+}
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/messages.properties b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/messages.properties
index d9a590b..9e4fbe0 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/messages.properties
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/messages.properties
@@ -25,4 +25,7 @@
PropertyPage_Title=Properties
PropertiePage_desc=Specify Property attributes
-PropertyPage_Property_Section=Property
\ No newline at end of file
+PropertyPage_Property_Section=Property
+
+
+ServicesPage_Title=Services
diff --git a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/wizard/NewPropertyPage.java b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/wizard/NewPropertyPage.java
index 93f8f68..7a40be0 100644
--- a/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/wizard/NewPropertyPage.java
+++ b/modeling/plugins/org.eclipse.pde.ds.ui/src/org/eclipse/pde/ds/ui/internal/editor/wizard/NewPropertyPage.java
@@ -8,7 +8,7 @@
* Contributors:
* Anyware Technologies - initial API and implementation
*
- * $Id: NewPropertyPage.java,v 1.6 2009/06/02 09:34:14 bcabe Exp $
+ * $Id: NewPropertyPage.java,v 1.7 2009/06/02 10:48:05 bcabe Exp $
*/
package org.eclipse.pde.ds.ui.internal.editor.wizard;
@@ -68,7 +68,7 @@
}, null);
//Value
- bindingContext.bindValue(SWTObservables.observeText(propertyComposite.getTextValue(), SWT.FocusOut), EMFEditProperties.value(ed, ScrPackage.eINSTANCE.getProperty_Value()).observeDetail(iov), new EMFValidatingUpdateValueStrategy(), null);
+ bindingContext.bindValue(SWTObservables.observeText(propertyComposite.getTextValue(), SWT.FocusOut), EMFEditProperties.value(ed, ScrPackage.eINSTANCE.getProperty_Value()).observeDetail(iov), null, null);
}
public void createProperty() {