JBoss Tools SVN: r18748 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-11-19 11:15:17 -0500 (Thu, 19 Nov 2009)
New Revision: 18748
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5192 - fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-11-19 15:57:37 UTC (rev 18747)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-11-19 16:15:17 UTC (rev 18748)
@@ -321,7 +321,7 @@
} else if (input instanceof DiagramEditorInput) {
diagramInput = (DiagramEditorInput)input;
}
- setPartName(DiagramViewerMessages.DiagramViewer_diagram_for + " " + diagramInput.getName()); //$NON-NLS-1$
+ setPartName(diagramInput.getName());
super.setInput(diagramInput);
loadProperties();
}
@@ -349,7 +349,7 @@
public void refresh() {
getOrmDiagram().refresh();
- setPartName(DiagramViewerMessages.DiagramViewer_diagram_for + " " + getDiagramInput().getName()); //$NON-NLS-1$
+ setPartName(getDiagramInput().getName());
}
/**
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2009-11-19 15:57:37 UTC (rev 18747)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2009-11-19 16:15:17 UTC (rev 18748)
@@ -142,10 +142,21 @@
}
// sort to get same name for same combinations of entities
Collections.sort(names);
+ name = consoleConfigName + ":"; //$NON-NLS-1$
+ name += names.size() > 0 ? " " + names.get(0) : ""; //$NON-NLS-1$ //$NON-NLS-2$
+ if (names.size() > 1) {
+ if (names.size() == 2) {
+ name += " and " + names.get(1); //$NON-NLS-1$
+ } else {
+ name += " and " + (names.size() - 1) + " others"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ /** /
name = names.size() > 0 ? names.get(0) : ""; //$NON-NLS-1$
for (int i = 1; i < names.size(); i++) {
name += " & " + names.get(i); //$NON-NLS-1$
}
+ /**/
return name;
}
15 years, 1 month
JBoss Tools SVN: r18747 - documentation/trunk/movies/seam_demo.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-19 10:57:37 -0500 (Thu, 19 Nov 2009)
New Revision: 18747
Modified:
documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
Log:
JBDS-906 Demos update - building_web_page_using_JSF_RichFaces_Facelets - is updated
Modified: documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Tools SVN: r18746 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2009-11-19 10:36:00 -0500 (Thu, 19 Nov 2009)
New Revision: 18746
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
Log:
Just doing some code cleanup for JBDS-5202 and moving some duplicated code into a separate routine to handle the adding (and cleanup if it already exists) of a filter property.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-19 15:26:56 UTC (rev 18745)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-19 15:36:00 UTC (rev 18746)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
+ * Copyright (c) 2008-209 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -13,33 +13,18 @@
import java.util.List;
import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
@@ -49,7 +34,6 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
@@ -58,18 +42,13 @@
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.ScrolledPageBook;
import org.eclipse.ui.forms.widgets.Section;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.editor.ISourceSynchronizeListener;
-import org.jboss.tools.smooks.model.common.AbstractAnyType;
-import org.jboss.tools.smooks.model.graphics.ext.GraphPackage;
import org.jboss.tools.smooks.model.graphics.ext.ISmooksGraphChangeListener;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
-import org.jboss.tools.smooks.model.smooks.ConditionType;
-import org.jboss.tools.smooks.model.smooks.ConditionsType;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.ParamType;
import org.jboss.tools.smooks.model.smooks.ParamsType;
@@ -85,40 +64,41 @@
ISmooksGraphChangeListener, ISourceSynchronizeListener {
private ISmooksModelProvider smooksModelProvider;
- private Button newParamButton;
- private Button removeParamButton;
- private Button upParamButton;
- private Button downParamButton;
- private Button paramPropertiesButton;
- private TableViewer paramViewer;
- private TableViewer conditionViewer;
- private Button newConditionButton;
- private Button removeConditionButton;
- private Button upConditionButton;
- private Button downConditionButton;
- private Button conditionPropertiesButton;
- private Composite defaultSettingComposite;
- private Button newProfileButton;
- private Button removeProfileButton;
- private Button upProfileButton;
- private Button downProfileButton;
- private Button profilePropertiesButton;
- private TableViewer profileViewer;
private ModelPanelCreator defaultSettingPanelCreator;
- private Section generalSettingSection;
private Section globalParamSection;
- private Section conditionSection;
- private Section profilesSection;
private Section settingSection;
- private Text smooksNameText;
- private Text smooksAuthorText;
protected boolean lockEventFire = false;
-
+
private Combo streamFilterTypeCombo;
- private boolean streamFilterTypeSet = false;
private Button defaultSerializationOnCheckbox;
- private boolean defaultSerializationOnSet = false;
+ // unused fields for now
+// private Button newParamButton;
+// private Button removeParamButton;
+// private Button upParamButton;
+// private Button downParamButton;
+// private Button paramPropertiesButton;
+// private TableViewer paramViewer;
+// private TableViewer conditionViewer;
+// private Button newConditionButton;
+// private Button removeConditionButton;
+// private Button upConditionButton;
+// private Button downConditionButton;
+// private Button conditionPropertiesButton;
+// private Composite defaultSettingComposite;
+// private Button newProfileButton;
+// private Button removeProfileButton;
+// private Button upProfileButton;
+// private Button downProfileButton;
+// private Button profilePropertiesButton;
+// private TableViewer profileViewer;
+// private Section generalSettingSection;
+// private Section conditionSection;
+// private Section profilesSection;
+// private Text smooksNameText;
+// private Text smooksAuthorText;
+
+
public SmooksConfigurationOverviewPage(FormEditor editor, String id, String title, ISmooksModelProvider provider) {
super(editor, id, title);
this.smooksModelProvider = provider;
@@ -156,7 +136,6 @@
settingSection = toolkit.createSection(mainComposite, Section.TITLE_BAR);
settingSection.setLayout(new FillLayout());
settingSection.setText("Smooks configuration");
-// settingSection.setDescription("Set the description for this Smooks configuration file.");
Composite settingComposite = toolkit.createComposite(settingSection);
settingSection.setClient(settingComposite);
gd = new GridData();
@@ -172,7 +151,6 @@
globalParamSection = toolkit.createSection(mainComposite, Section.TITLE_BAR
| Section.TWISTIE | Section.EXPANDED);
-// globalParamSection.setDescription("Optional settings to change how Smooks processes and serializes input");
globalParamSection.setText("Filter Settings");
globalParamSection.setLayout(new FillLayout());
Composite globalParamComposite = toolkit.createComposite(globalParamSection);
@@ -188,6 +166,7 @@
createGlobalParamterSection(globalParamComposite, toolkit);
+ // Have disabled the more open methods for applying "global" properties for now
// generalSettingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
// | Section.TWISTIE | Section.EXPANDED);
// generalSettingSection.setLayout(new FillLayout());
@@ -273,6 +252,7 @@
}
});
+ // have hidden the Name & Author bits
// toolkit.createLabel(settingComposite, "Name : ").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
// smooksNameText = toolkit.createText(settingComposite, "", SWT.NONE);
// smooksNameText.setLayoutData(gd);
@@ -322,627 +302,72 @@
toolkit.paintBordersFor(settingComposite);
}
- protected void createProfilesSection(Composite profilesComposite, FormToolkit toolkit) {
+ private ParamsType getParamsType() {
if (smooksModelProvider != null) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
- .getEditingDomain();
- EObject profiles = getProfilesType();
- // if (m == null)
- // return;
-
- profileViewer = new TableViewer(profilesComposite);
- GridData gd = new GridData(GridData.FILL_BOTH);
- profileViewer.getControl().setLayoutData(gd);
- toolkit.paintBordersFor(profilesComposite);
- Composite buttonArea = toolkit.createComposite(profilesComposite);
- gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = 30;
- GridLayout bgl = new GridLayout();
- buttonArea.setLayout(bgl);
-
- newProfileButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- newProfileButton.setLayoutData(gd);
-
- removeProfileButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- removeProfileButton.setLayoutData(gd);
-
- upProfileButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- upProfileButton.setLayoutData(gd);
-
- downProfileButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- downProfileButton.setLayoutData(gd);
-
- profilePropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- profilePropertiesButton.setLayoutData(gd);
-
- profileViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-
- @Override
- public boolean hasChildren(Object object) {
- return false;
- }
-
- });
-
- profileViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
- .getAdapterFactory()) {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
- * # getText(java.lang.Object)
- */
- @Override
- public String getText(Object object) {
- Object obj = AdapterFactoryEditingDomain.unwrap(object);
- if (obj instanceof AbstractAnyType) {
- return super.getText(obj);
- }
- return super.getText(object);
- }
-
- }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
-
- if (profiles != null) {
- profileViewer.setInput(profiles);
- }
-
- profileViewer.addDoubleClickListener(new IDoubleClickListener() {
-
- public void doubleClick(DoubleClickEvent event) {
- openProfilePropertiesModifyDialog();
- }
- });
-
- profileViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- updateProfilesButtons();
- }
- });
-
- hookProfilesButtons();
- updateProfilesButtons();
- }
- }
-
- protected void openProfilePropertiesModifyDialog() {
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profile = (EObject) obj;
- EObject parent = getProfilesType();
- EStructuralFeature profileFeature = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- profileFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
-
- NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- profileFeature, profile, parent, getManagedForm().getToolkit(), smooksModelProvider,
- SmooksConfigurationOverviewPage.this, true);
- dialog.open();
- }
- }
-
- protected void updateProfilesButtons() {
- if (getSmooksVersion() == null) {
- profilePropertiesButton.setEnabled(false);
- newProfileButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- upProfileButton.setEnabled(false);
- downProfileButton.setEnabled(false);
- return;
- }
- profilePropertiesButton.setEnabled(true);
- removeProfileButton.setEnabled(true);
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null) {
- profilePropertiesButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- upProfileButton.setEnabled(false);
- downProfileButton.setEnabled(false);
- } else {
- if (selection.getFirstElement() == null) {
- profilePropertiesButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- upProfileButton.setEnabled(false);
- downProfileButton.setEnabled(false);
- return;
- }
-
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profilesType = getProfilesType();
- if (profilesType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index - 1);
- upProfileButton.setEnabled(command.canExecute());
-
- Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index + 1);
- downProfileButton.setEnabled(command1.canExecute());
- }
-
- if (selection.size() > 1) {
- profilePropertiesButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- }
- }
-
- }
-
- protected void hookProfilesButtons() {
- newProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (getSmooksVersion() == null) {
- return;
- }
- EObject model = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- model = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfileType();
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- model = SmooksFactory.eINSTANCE.createProfileType();
- }
- EObject parent = getProfilesType();
- boolean newParent = false;
- if (parent == null) {
- newParent = true;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- parent = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfilesType();
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- parent = SmooksFactory.eINSTANCE.createProfilesType();
- }
- }
- EStructuralFeature profileFeature = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- profileFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
- NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- profileFeature, model, parent, getManagedForm().getToolkit(), smooksModelProvider,
- SmooksConfigurationOverviewPage.this, false);
-
- EStructuralFeature profilesFeature = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- profilesFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- profilesFeature = SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
- }
- if (dialog.open() == Dialog.OK && newParent) {
- EObject resource = getSmooksResourceList();
- if (resource == null)
- return;
- Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
- profilesFeature, parent);
- if (command.canExecute()) {
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- profileViewer.setInput(parent);
- }
- }
- super.widgetSelected(e);
- }
-
- });
- removeProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profile = (EObject) obj;
- EObject parent = getProfilesType();
- if (parent == null)
- return;
- CompoundCommand compoundCommand = new CompoundCommand();
- Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), profile);
- compoundCommand.append(command);
- if (parent.eContents().size() == 1) {
- // remove parent;
- Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
- compoundCommand.append(command1);
- }
- smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
- }
- }
-
- });
- upProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profilesType = getProfilesType();
- if (profilesType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index - 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- downProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profilesType = getProfilesType();
- if (profilesType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index + 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- profilePropertiesButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- openProfilePropertiesModifyDialog();
- super.widgetSelected(e);
- }
-
- });
-
- }
-
- private EObject getProfilesType() {
- if (smooksModelProvider != null) {
EObject smooksModel = smooksModelProvider.getSmooksModel();
if (smooksModel instanceof DocumentRoot) {
- EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getProfiles();
- return m;
+ EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getParams();
+ return (ParamsType) m;
}
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- EObject m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot) smooksModel).getSmooksResourceList()
- .getProfiles();
- return m;
- }
}
return null;
}
- private ConditionsType getConditionsType() {
- if (smooksModelProvider != null) {
- EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof DocumentRoot) {
- EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getConditions();
- return (ConditionsType) m;
- }
+ private void updateGlobalProperty(String propertyID, String value) {
+ boolean foundProperty = false;
+ EObject resource = getSmooksResourceList();
+ if (resource == null)
+ return;
+ if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ return;
}
- return null;
- }
-
- private void createConditionsSection(Composite conditionComposite, FormToolkit toolkit) {
- if (smooksModelProvider != null) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
- .getEditingDomain();
- ConditionsType conditions = getConditionsType();
- // if (m == null)
- // return;
-
- conditionViewer = new TableViewer(conditionComposite);
- GridData gd = new GridData(GridData.FILL_BOTH);
- conditionViewer.getControl().setLayoutData(gd);
- toolkit.paintBordersFor(conditionComposite);
- Composite buttonArea = toolkit.createComposite(conditionComposite);
- gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = 30;
- GridLayout bgl = new GridLayout();
- buttonArea.setLayout(bgl);
-
- newConditionButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- newConditionButton.setLayoutData(gd);
-
- removeConditionButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- removeConditionButton.setLayoutData(gd);
-
- upConditionButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- upConditionButton.setLayoutData(gd);
-
- downConditionButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- downConditionButton.setLayoutData(gd);
-
- conditionPropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- conditionPropertiesButton.setLayoutData(gd);
-
- conditionViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-
- @Override
- public boolean hasChildren(Object object) {
- return false;
+ ParamsType parent = getParamsType();
+ ParamType param = null;
+ ParamType newparam = null;
+ if (parent != null) {
+ EList<?> parmList = parent.getParam();
+ for (int i = 0; i < parmList.size(); i++) {
+ param = (ParamType)parmList.get(i);
+ if (param.getName().equals(propertyID)) {
+ foundProperty = true;
+ break;
}
-
- });
-
- conditionViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
- .getAdapterFactory()) {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
- * # getText(java.lang.Object)
- */
- @Override
- public String getText(Object object) {
- Object obj = AdapterFactoryEditingDomain.unwrap(object);
- if (obj instanceof AbstractAnyType) {
- return super.getText(obj);
- }
- return super.getText(object);
- }
-
- }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
-
- if (conditions != null) {
- conditionViewer.setInput(conditions);
}
-
- conditionViewer.addDoubleClickListener(new IDoubleClickListener() {
-
- public void doubleClick(DoubleClickEvent event) {
- openConditionPropertiesModifyDialog();
- }
- });
-
- conditionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- updateConditionsButtons();
- }
- });
-
- hookConditionsButtons();
- updateConditionsButtons();
}
- }
+ newparam = SmooksFactory.eINSTANCE.createParamType();
+ newparam.setName(propertyID);
+ newparam.setStringValue(value);
- protected void hookConditionsButtons() {
- newConditionButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
- return;
- }
- ConditionType condition = SmooksFactory.eINSTANCE.createConditionType();
- ConditionsType parent = getConditionsType();
- boolean newParent = false;
- if (parent == null) {
- newParent = true;
- parent = SmooksFactory.eINSTANCE.createConditionsType();
-
- }
- NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent, getManagedForm()
- .getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
- if (dialog.open() == Dialog.OK && newParent) {
- EObject resource = getSmooksResourceList();
- if (resource == null)
- return;
- Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
- SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__CONDITIONS, parent);
- if (command.canExecute()) {
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- conditionViewer.setInput(parent);
- }
- }
- super.widgetSelected(e);
+ if (parent == null) {
+ parent = SmooksFactory.eINSTANCE.createParamsType();
+ Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+ SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
+ if (command.canExecute()) {
+ ((SmooksResourceListType) resource).setParams((ParamsType) parent);
}
-
- });
- removeConditionButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ConditionType) {
- ConditionType condition = (ConditionType) obj;
- ConditionsType parent = getConditionsType();
- if (parent == null)
- return;
- CompoundCommand compoundCommand = new CompoundCommand();
- Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), condition);
- compoundCommand.append(command);
- if (parent.getCondition().size() == 1) {
- // remove parent;
- Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
- compoundCommand.append(command1);
- }
- smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
- }
- }
-
- });
- upConditionButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ConditionType) {
- ConditionsType conditionsType = getConditionsType();
- if (conditionsType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index - 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- downConditionButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ConditionType) {
- ConditionsType conditionsType = getConditionsType();
- if (conditionsType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index + 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- conditionPropertiesButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- openConditionPropertiesModifyDialog();
- super.widgetSelected(e);
- }
-
- });
-
- }
-
- protected void updateConditionsButtons() {
- if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
- conditionPropertiesButton.setEnabled(false);
- newConditionButton.setEnabled(false);
- removeConditionButton.setEnabled(false);
- upConditionButton.setEnabled(false);
- downConditionButton.setEnabled(false);
- return;
}
- conditionPropertiesButton.setEnabled(true);
- removeConditionButton.setEnabled(true);
- IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
- if (selection == null) {
- conditionPropertiesButton.setEnabled(false);
- removeConditionButton.setEnabled(false);
- upConditionButton.setEnabled(false);
- downConditionButton.setEnabled(false);
- } else {
- if (selection.getFirstElement() == null) {
- conditionPropertiesButton.setEnabled(false);
- removeConditionButton.setEnabled(false);
- upConditionButton.setEnabled(false);
- downConditionButton.setEnabled(false);
- return;
+ EditingDomain editingDomain = smooksModelProvider.getEditingDomain();
+ Command command = null;
+ Command command2 = null;
+ EStructuralFeature feature = SmooksPackage.Literals.PARAMS_TYPE__PARAM;
+ if (feature instanceof EReference) {
+ if (foundProperty) {
+ command2 = RemoveCommand.create(editingDomain, parent, feature, param);
}
-
- Object obj = selection.getFirstElement();
- if (obj instanceof ConditionType) {
- ConditionsType conditionsType = getConditionsType();
- if (conditionsType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index - 1);
- upConditionButton.setEnabled(command.canExecute());
-
- Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index + 1);
- downConditionButton.setEnabled(command1.canExecute());
- }
-
- if (selection.size() > 1) {
- conditionPropertiesButton.setEnabled(false);
- removeConditionButton.setEnabled(false);
- }
+ command = AddCommand.create(editingDomain, parent, feature, newparam);
}
+ if (command2 != null && command2.canExecute())
+ editingDomain.getCommandStack().execute(command2);
+ if (command != null)
+ editingDomain.getCommandStack().execute(command);
+ ((SmooksResourceListType) resource).setParams((ParamsType) parent);
}
-
- protected void openConditionPropertiesModifyDialog() {
- IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ConditionType) {
- ConditionType condition = (ConditionType) obj;
- ConditionsType parent = getConditionsType();
- NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent,
- getManagedForm().getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
- dialog.open();
- }
- }
-
- private ParamsType getParamsType() {
- if (smooksModelProvider != null) {
- EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof DocumentRoot) {
- EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getParams();
- return (ParamsType) m;
- }
- }
- return null;
- }
-
+
private void createGlobalParamterSection(Composite globalParamComposite, FormToolkit toolkit) {
// ModelPanelCreator creator = new ModelPanelCreator();
if (smooksModelProvider != null) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
- .getEditingDomain();
+// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
+// .getEditingDomain();
ParamsType m = getParamsType();
// if (m == null)
// return;
@@ -982,53 +407,7 @@
public void widgetSelected(SelectionEvent e) {
String value = streamFilterTypeCombo.getText();
- EObject resource = getSmooksResourceList();
- if (resource == null)
- return;
- if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
- return;
- }
- ParamsType parent = getParamsType();
- ParamType param = null;
- ParamType newparam = null;
- if (parent != null) {
- EList<?> parmList = parent.getParam();
- for (int i = 0; i < parmList.size(); i++) {
- param = (ParamType)parmList.get(i);
- if (param.getName().equals("stream.filter.type")) {
- streamFilterTypeSet = true;
- break;
- }
- }
- }
- newparam = SmooksFactory.eINSTANCE.createParamType();
- newparam.setName("stream.filter.type");
- newparam.setStringValue(value);
-
- if (parent == null) {
- parent = SmooksFactory.eINSTANCE.createParamsType();
- Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
- SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
- if (command.canExecute()) {
- ((SmooksResourceListType) resource).setParams((ParamsType) parent);
- }
- }
- EditingDomain editingDomain = smooksModelProvider.getEditingDomain();
- Command command = null;
- Command command2 = null;
- EStructuralFeature feature = SmooksPackage.Literals.PARAMS_TYPE__PARAM;
- if (feature instanceof EReference) {
- if (streamFilterTypeSet) {
- command2 = RemoveCommand.create(editingDomain, parent, feature, param);
- }
- command = AddCommand.create(editingDomain, parent, feature, newparam);
- }
- if (command2 != null && command2.canExecute())
- editingDomain.getCommandStack().execute(command2);
- if (command != null)
- editingDomain.getCommandStack().execute(command);
- ((SmooksResourceListType) resource).setParams((ParamsType) parent);
- streamFilterTypeCombo.setText(value);
+ updateGlobalProperty ("stream.filter.type", value);
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -1040,61 +419,15 @@
public void widgetDefaultSelected(SelectionEvent e) {
String value = Boolean.toString(defaultSerializationOnCheckbox.getSelection());
- EObject resource = getSmooksResourceList();
- if (resource == null)
- return;
- if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
- return;
- }
- ParamsType parent = getParamsType();
- ParamType param = null;
- ParamType newparam = null;
- if (parent != null) {
- EList<?> parmList = parent.getParam();
- for (int i = 0; i < parmList.size(); i++) {
- param = (ParamType)parmList.get(i);
- if (param.getName().equals("default.serialization.on")) {
- defaultSerializationOnSet = true;
- break;
- }
- }
- }
- newparam = SmooksFactory.eINSTANCE.createParamType();
- newparam.setName("default.serialization.on");
- newparam.setStringValue(value);
-
- if (parent == null) {
- parent = SmooksFactory.eINSTANCE.createParamsType();
- Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
- SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
- if (command.canExecute()) {
- ((SmooksResourceListType) resource).setParams((ParamsType) parent);
- }
- }
- EditingDomain editingDomain = smooksModelProvider.getEditingDomain();
- Command command = null;
- Command command2 = null;
- EStructuralFeature feature = SmooksPackage.Literals.PARAMS_TYPE__PARAM;
- if (feature instanceof EReference) {
- if (defaultSerializationOnSet) {
- command2 = RemoveCommand.create(editingDomain, parent, feature, param);
- }
- command = AddCommand.create(editingDomain, parent, feature, newparam);
- }
- if (command2 != null && command2.canExecute())
- editingDomain.getCommandStack().execute(command2);
- if (command != null)
- editingDomain.getCommandStack().execute(command);
- ((SmooksResourceListType) resource).setParams((ParamsType) parent);
-
-// defaultSerializationOnCheckbox.setSelection(Boolean.parseBoolean(value));
+ updateGlobalProperty ("default.serialization.on", value);
}
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
});
-
+
+ // am hiding the more open Global Parameters method for now
// paramViewer = new TableViewer(globalParamComposite);
// GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
// paramViewer.getControl().setLayoutData(gd);
@@ -1178,230 +511,14 @@
}
- protected void updateParamButtons() {
- if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
- paramPropertiesButton.setEnabled(false);
- newParamButton.setEnabled(false);
- removeParamButton.setEnabled(false);
- upParamButton.setEnabled(false);
- downParamButton.setEnabled(false);
- return;
- }
- paramPropertiesButton.setEnabled(true);
- removeParamButton.setEnabled(true);
- IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
- if (selection == null) {
- paramPropertiesButton.setEnabled(false);
- removeParamButton.setEnabled(false);
- upParamButton.setEnabled(false);
- downParamButton.setEnabled(false);
- } else {
- if (selection.getFirstElement() == null) {
- paramPropertiesButton.setEnabled(false);
- removeParamButton.setEnabled(false);
- upParamButton.setEnabled(false);
- downParamButton.setEnabled(false);
- return;
- }
+ public void graphChanged(SmooksGraphicsExtType extType) {
- Object obj = selection.getFirstElement();
- if (obj instanceof ParamType) {
- ParamsType paramsType = getParamsType();
- if (paramsType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index - 1);
- upParamButton.setEnabled(command.canExecute());
-
- Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index + 1);
- downParamButton.setEnabled(command1.canExecute());
- }
-
- if (selection.size() > 1) {
- paramPropertiesButton.setEnabled(false);
- removeParamButton.setEnabled(false);
- }
- }
-
}
- private String getSmooksVersion() {
- if (smooksModelProvider != null) {
- SmooksGraphicsExtType ext = smooksModelProvider.getSmooksGraphicsExt();
- if (ext != null) {
- return ext.getPlatformVersion();
- }
- }
- return null;
- }
+ public void graphPropertyChange(EStructuralFeature featre, Object value) {
- private void hookGlobalParamterButtons() {
- newParamButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
- return;
- }
- ParamType param = SmooksFactory.eINSTANCE.createParamType();
- ParamsType parent = getParamsType();
- boolean newParent = false;
- if (parent == null) {
- newParent = true;
- parent = SmooksFactory.eINSTANCE.createParamsType();
- EObject resource = getSmooksResourceList();
- if (resource == null)
- return;
- Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
- SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
- if (command.canExecute()) {
- ((SmooksResourceListType) resource).setParams((ParamsType) parent);
- paramViewer.setInput(parent);
- }
- }
- NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent, getManagedForm().getToolkit(),
- smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
- if (dialog.open() == Dialog.CANCEL && newParent) {
- EObject resource = getSmooksResourceList();
- ((SmooksResourceListType) resource).setParams(null);
- paramViewer.setInput(null);
- }
- super.widgetSelected(e);
- }
-
- });
- removeParamButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ParamType) {
- ParamType param = (ParamType) obj;
- ParamsType parent = getParamsType();
- if (parent == null)
- return;
- CompoundCommand compoundCommand = new CompoundCommand();
- Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), param);
- compoundCommand.append(command);
- if (parent.getParam().size() == 1) {
- // remove parent;
- Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
- compoundCommand.append(command1);
- }
- smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
- }
- }
-
- });
- upParamButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ParamType) {
- ParamsType paramsType = getParamsType();
- if (paramsType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index - 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- downParamButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ParamType) {
- ParamsType paramsType = getParamsType();
- if (paramsType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
- index + 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- paramPropertiesButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- openParamPropertiesModifyDialog();
- super.widgetSelected(e);
- }
-
- });
}
- protected void openParamPropertiesModifyDialog() {
- IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof ParamType) {
- ParamType param = (ParamType) obj;
- ParamsType parent = getParamsType();
- NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent, getManagedForm().getToolkit(),
- smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
- dialog.open();
- }
- }
-
- private EObject getSmooksResourceList() {
- if (smooksModelProvider != null) {
- EObject m = null;
- EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot) smooksModel).getSmooksResourceList();
- }
- if (smooksModel instanceof DocumentRoot) {
- m = ((DocumentRoot) smooksModel).getSmooksResourceList();
- }
- return m;
- }
- return null;
- }
-
- private void createDefaultSection(Composite parent, FormToolkit toolkit) {
- ModelPanelCreator defaultSettingPanelCreator = getDefaultSettingPanelCreator();
- EObject model = getSmooksResourceList();
- if (model != null) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
- .getEditingDomain();
- IItemPropertySource itemPropertySource = (IItemPropertySource) editingDomain.getAdapterFactory().adapt(
- model, IItemPropertySource.class);
- if (model != null) {
- defaultSettingPanelCreator.createModelPanel(model, toolkit, parent, itemPropertySource,
- smooksModelProvider, getEditor());
- }
- }
-
- }
-
public ModelPanelCreator getDefaultSettingPanelCreator() {
if (defaultSettingPanelCreator == null) {
defaultSettingPanelCreator = new ModelPanelCreator();
@@ -1466,16 +583,842 @@
}
}
- private void disposeDefaultSettingCompositeControls() {
- disposeCompositeControls(defaultSettingComposite, null);
+ private EObject getSmooksResourceList() {
+ if (smooksModelProvider != null) {
+ EObject m = null;
+ EObject smooksModel = smooksModelProvider.getSmooksModel();
+ if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+ m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot) smooksModel).getSmooksResourceList();
+ }
+ if (smooksModel instanceof DocumentRoot) {
+ m = ((DocumentRoot) smooksModel).getSmooksResourceList();
+ }
+ return m;
+ }
+ return null;
}
- public void graphChanged(SmooksGraphicsExtType extType) {
-
+ private String getSmooksVersion() {
+ if (smooksModelProvider != null) {
+ SmooksGraphicsExtType ext = smooksModelProvider.getSmooksGraphicsExt();
+ if (ext != null) {
+ return ext.getPlatformVersion();
+ }
+ }
+ return null;
}
- public void graphPropertyChange(EStructuralFeature featre, Object value) {
+/*
+ * The following code has been commented out for now. We may add more properties as they become necessary,
+ * but for now, this is just extraneous code and confusing UI for the user that doesn't add much
+ * functionality.
+ */
+// protected void createProfilesSection(Composite profilesComposite, FormToolkit toolkit) {
+// if (smooksModelProvider != null) {
+// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
+// .getEditingDomain();
+// EObject profiles = getProfilesType();
+// // if (m == null)
+// // return;
+//
+// profileViewer = new TableViewer(profilesComposite);
+// GridData gd = new GridData(GridData.FILL_BOTH);
+// profileViewer.getControl().setLayoutData(gd);
+// toolkit.paintBordersFor(profilesComposite);
+// Composite buttonArea = toolkit.createComposite(profilesComposite);
+// gd = new GridData(GridData.FILL_VERTICAL);
+// gd.widthHint = 30;
+// GridLayout bgl = new GridLayout();
+// buttonArea.setLayout(bgl);
+//
+// newProfileButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// newProfileButton.setLayoutData(gd);
+//
+// removeProfileButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// removeProfileButton.setLayoutData(gd);
+//
+// upProfileButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// upProfileButton.setLayoutData(gd);
+//
+// downProfileButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// downProfileButton.setLayoutData(gd);
+//
+// profilePropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// profilePropertiesButton.setLayoutData(gd);
+//
+// profileViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
+//
+// @Override
+// public boolean hasChildren(Object object) {
+// return false;
+// }
+//
+// });
+//
+// profileViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
+// .getAdapterFactory()) {
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+// * # getText(java.lang.Object)
+// */
+// @Override
+// public String getText(Object object) {
+// Object obj = AdapterFactoryEditingDomain.unwrap(object);
+// if (obj instanceof AbstractAnyType) {
+// return super.getText(obj);
+// }
+// return super.getText(object);
+// }
+//
+// }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+//
+// if (profiles != null) {
+// profileViewer.setInput(profiles);
+// }
+//
+// profileViewer.addDoubleClickListener(new IDoubleClickListener() {
+//
+// public void doubleClick(DoubleClickEvent event) {
+// openProfilePropertiesModifyDialog();
+// }
+// });
+//
+// profileViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+//
+// public void selectionChanged(SelectionChangedEvent event) {
+// updateProfilesButtons();
+// }
+// });
+//
+// hookProfilesButtons();
+// updateProfilesButtons();
+// }
+// }
+//
+// protected void openProfilePropertiesModifyDialog() {
+// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof EObject) {
+// EObject profile = (EObject) obj;
+// EObject parent = getProfilesType();
+// EStructuralFeature profileFeature = null;
+// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+// profileFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+// }
+// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+// profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+// }
+//
+// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+// profileFeature, profile, parent, getManagedForm().getToolkit(), smooksModelProvider,
+// SmooksConfigurationOverviewPage.this, true);
+// dialog.open();
+// }
+// }
+//
+// protected void updateProfilesButtons() {
+// if (getSmooksVersion() == null) {
+// profilePropertiesButton.setEnabled(false);
+// newProfileButton.setEnabled(false);
+// removeProfileButton.setEnabled(false);
+// upProfileButton.setEnabled(false);
+// downProfileButton.setEnabled(false);
+// return;
+// }
+// profilePropertiesButton.setEnabled(true);
+// removeProfileButton.setEnabled(true);
+// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
+// if (selection == null) {
+// profilePropertiesButton.setEnabled(false);
+// removeProfileButton.setEnabled(false);
+// upProfileButton.setEnabled(false);
+// downProfileButton.setEnabled(false);
+// } else {
+// if (selection.getFirstElement() == null) {
+// profilePropertiesButton.setEnabled(false);
+// removeProfileButton.setEnabled(false);
+// upProfileButton.setEnabled(false);
+// downProfileButton.setEnabled(false);
+// return;
+// }
+//
+// Object obj = selection.getFirstElement();
+// if (obj instanceof EObject) {
+// EObject profilesType = getProfilesType();
+// if (profilesType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index - 1);
+// upProfileButton.setEnabled(command.canExecute());
+//
+// Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index + 1);
+// downProfileButton.setEnabled(command1.canExecute());
+// }
+//
+// if (selection.size() > 1) {
+// profilePropertiesButton.setEnabled(false);
+// removeProfileButton.setEnabled(false);
+// }
+// }
+//
+// }
+//
+// protected void hookProfilesButtons() {
+// newProfileButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// if (getSmooksVersion() == null) {
+// return;
+// }
+// EObject model = null;
+// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+// model = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfileType();
+// }
+// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+// model = SmooksFactory.eINSTANCE.createProfileType();
+// }
+// EObject parent = getProfilesType();
+// boolean newParent = false;
+// if (parent == null) {
+// newParent = true;
+// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+// parent = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfilesType();
+// }
+// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+// parent = SmooksFactory.eINSTANCE.createProfilesType();
+// }
+// }
+// EStructuralFeature profileFeature = null;
+// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+// profileFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+// }
+// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+// profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+// }
+// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+// profileFeature, model, parent, getManagedForm().getToolkit(), smooksModelProvider,
+// SmooksConfigurationOverviewPage.this, false);
+//
+// EStructuralFeature profilesFeature = null;
+// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+// profilesFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
+// }
+// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+// profilesFeature = SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
+// }
+// if (dialog.open() == Dialog.OK && newParent) {
+// EObject resource = getSmooksResourceList();
+// if (resource == null)
+// return;
+// Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+// profilesFeature, parent);
+// if (command.canExecute()) {
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// profileViewer.setInput(parent);
+// }
+// }
+// super.widgetSelected(e);
+// }
+//
+// });
+// removeProfileButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof EObject) {
+// EObject profile = (EObject) obj;
+// EObject parent = getProfilesType();
+// if (parent == null)
+// return;
+// CompoundCommand compoundCommand = new CompoundCommand();
+// Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), profile);
+// compoundCommand.append(command);
+// if (parent.eContents().size() == 1) {
+// // remove parent;
+// Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
+// compoundCommand.append(command1);
+// }
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
+// }
+// }
+//
+// });
+// upProfileButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof EObject) {
+// EObject profilesType = getProfilesType();
+// if (profilesType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index - 1);
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
+//
+// });
+// downProfileButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof EObject) {
+// EObject profilesType = getProfilesType();
+// if (profilesType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index + 1);
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
+//
+// });
+// profilePropertiesButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// openProfilePropertiesModifyDialog();
+// super.widgetSelected(e);
+// }
+//
+// });
+//
+// }
+//
+// private EObject getProfilesType() {
+// if (smooksModelProvider != null) {
+// EObject smooksModel = smooksModelProvider.getSmooksModel();
+// if (smooksModel instanceof DocumentRoot) {
+// EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getProfiles();
+// return m;
+// }
+// if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+// EObject m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot) smooksModel).getSmooksResourceList()
+// .getProfiles();
+// return m;
+// }
+// }
+// return null;
+// }
+//
+// private ConditionsType getConditionsType() {
+// if (smooksModelProvider != null) {
+// EObject smooksModel = smooksModelProvider.getSmooksModel();
+// if (smooksModel instanceof DocumentRoot) {
+// EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getConditions();
+// return (ConditionsType) m;
+// }
+// }
+// return null;
+// }
+//
+// private void createConditionsSection(Composite conditionComposite, FormToolkit toolkit) {
+// if (smooksModelProvider != null) {
+// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
+// .getEditingDomain();
+// ConditionsType conditions = getConditionsType();
+// // if (m == null)
+// // return;
+//
+// conditionViewer = new TableViewer(conditionComposite);
+// GridData gd = new GridData(GridData.FILL_BOTH);
+// conditionViewer.getControl().setLayoutData(gd);
+// toolkit.paintBordersFor(conditionComposite);
+// Composite buttonArea = toolkit.createComposite(conditionComposite);
+// gd = new GridData(GridData.FILL_VERTICAL);
+// gd.widthHint = 30;
+// GridLayout bgl = new GridLayout();
+// buttonArea.setLayout(bgl);
+//
+// newConditionButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// newConditionButton.setLayoutData(gd);
+//
+// removeConditionButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// removeConditionButton.setLayoutData(gd);
+//
+// upConditionButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// upConditionButton.setLayoutData(gd);
+//
+// downConditionButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// downConditionButton.setLayoutData(gd);
+//
+// conditionPropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// conditionPropertiesButton.setLayoutData(gd);
+//
+// conditionViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
+//
+// @Override
+// public boolean hasChildren(Object object) {
+// return false;
+// }
+//
+// });
+//
+// conditionViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
+// .getAdapterFactory()) {
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+// * # getText(java.lang.Object)
+// */
+// @Override
+// public String getText(Object object) {
+// Object obj = AdapterFactoryEditingDomain.unwrap(object);
+// if (obj instanceof AbstractAnyType) {
+// return super.getText(obj);
+// }
+// return super.getText(object);
+// }
+//
+// }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+//
+// if (conditions != null) {
+// conditionViewer.setInput(conditions);
+// }
+//
+// conditionViewer.addDoubleClickListener(new IDoubleClickListener() {
+//
+// public void doubleClick(DoubleClickEvent event) {
+// openConditionPropertiesModifyDialog();
+// }
+// });
+//
+// conditionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+//
+// public void selectionChanged(SelectionChangedEvent event) {
+// updateConditionsButtons();
+// }
+// });
+//
+// hookConditionsButtons();
+// updateConditionsButtons();
+// }
+// }
+//
+// protected void hookConditionsButtons() {
+// newConditionButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+// return;
+// }
+// ConditionType condition = SmooksFactory.eINSTANCE.createConditionType();
+// ConditionsType parent = getConditionsType();
+// boolean newParent = false;
+// if (parent == null) {
+// newParent = true;
+// parent = SmooksFactory.eINSTANCE.createConditionsType();
+//
+// }
+// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+// SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent, getManagedForm()
+// .getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
+// if (dialog.open() == Dialog.OK && newParent) {
+// EObject resource = getSmooksResourceList();
+// if (resource == null)
+// return;
+// Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+// SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__CONDITIONS, parent);
+// if (command.canExecute()) {
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// conditionViewer.setInput(parent);
+// }
+// }
+// super.widgetSelected(e);
+// }
+//
+// });
+// removeConditionButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ConditionType) {
+// ConditionType condition = (ConditionType) obj;
+// ConditionsType parent = getConditionsType();
+// if (parent == null)
+// return;
+// CompoundCommand compoundCommand = new CompoundCommand();
+// Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), condition);
+// compoundCommand.append(command);
+// if (parent.getCondition().size() == 1) {
+// // remove parent;
+// Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
+// compoundCommand.append(command1);
+// }
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
+// }
+// }
+//
+// });
+// upConditionButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ConditionType) {
+// ConditionsType conditionsType = getConditionsType();
+// if (conditionsType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index - 1);
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
+//
+// });
+// downConditionButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ConditionType) {
+// ConditionsType conditionsType = getConditionsType();
+// if (conditionsType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index + 1);
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
+//
+// });
+// conditionPropertiesButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// openConditionPropertiesModifyDialog();
+// super.widgetSelected(e);
+// }
+//
+// });
+//
+// }
+//
+// protected void updateConditionsButtons() {
+// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+// conditionPropertiesButton.setEnabled(false);
+// newConditionButton.setEnabled(false);
+// removeConditionButton.setEnabled(false);
+// upConditionButton.setEnabled(false);
+// downConditionButton.setEnabled(false);
+// return;
+// }
+// conditionPropertiesButton.setEnabled(true);
+// removeConditionButton.setEnabled(true);
+// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
+// if (selection == null) {
+// conditionPropertiesButton.setEnabled(false);
+// removeConditionButton.setEnabled(false);
+// upConditionButton.setEnabled(false);
+// downConditionButton.setEnabled(false);
+// } else {
+// if (selection.getFirstElement() == null) {
+// conditionPropertiesButton.setEnabled(false);
+// removeConditionButton.setEnabled(false);
+// upConditionButton.setEnabled(false);
+// downConditionButton.setEnabled(false);
+// return;
+// }
+//
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ConditionType) {
+// ConditionsType conditionsType = getConditionsType();
+// if (conditionsType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index - 1);
+// upConditionButton.setEnabled(command.canExecute());
+//
+// Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index + 1);
+// downConditionButton.setEnabled(command1.canExecute());
+// }
+//
+// if (selection.size() > 1) {
+// conditionPropertiesButton.setEnabled(false);
+// removeConditionButton.setEnabled(false);
+// }
+// }
+// }
+//
+// protected void openConditionPropertiesModifyDialog() {
+// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ConditionType) {
+// ConditionType condition = (ConditionType) obj;
+// ConditionsType parent = getConditionsType();
+// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+// SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent,
+// getManagedForm().getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
+// dialog.open();
+// }
+// }
+//
+// protected void updateParamButtons() {
+// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+// paramPropertiesButton.setEnabled(false);
+// newParamButton.setEnabled(false);
+// removeParamButton.setEnabled(false);
+// upParamButton.setEnabled(false);
+// downParamButton.setEnabled(false);
+// return;
+// }
+// paramPropertiesButton.setEnabled(true);
+// removeParamButton.setEnabled(true);
+// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
+// if (selection == null) {
+// paramPropertiesButton.setEnabled(false);
+// removeParamButton.setEnabled(false);
+// upParamButton.setEnabled(false);
+// downParamButton.setEnabled(false);
+// } else {
+// if (selection.getFirstElement() == null) {
+// paramPropertiesButton.setEnabled(false);
+// removeParamButton.setEnabled(false);
+// upParamButton.setEnabled(false);
+// downParamButton.setEnabled(false);
+// return;
+// }
+//
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ParamType) {
+// ParamsType paramsType = getParamsType();
+// if (paramsType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index - 1);
+// upParamButton.setEnabled(command.canExecute());
+//
+// Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index + 1);
+// downParamButton.setEnabled(command1.canExecute());
+// }
+//
+// if (selection.size() > 1) {
+// paramPropertiesButton.setEnabled(false);
+// removeParamButton.setEnabled(false);
+// }
+// }
+//
+// }
+//
+// private void hookGlobalParamterButtons() {
+// newParamButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+// return;
+// }
+// ParamType param = SmooksFactory.eINSTANCE.createParamType();
+// ParamsType parent = getParamsType();
+// boolean newParent = false;
+// if (parent == null) {
+// newParent = true;
+// parent = SmooksFactory.eINSTANCE.createParamsType();
+// EObject resource = getSmooksResourceList();
+// if (resource == null)
+// return;
+// Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+// SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
+// if (command.canExecute()) {
+// ((SmooksResourceListType) resource).setParams((ParamsType) parent);
+// paramViewer.setInput(parent);
+// }
+// }
+// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+// SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent, getManagedForm().getToolkit(),
+// smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
+// if (dialog.open() == Dialog.CANCEL && newParent) {
+// EObject resource = getSmooksResourceList();
+// ((SmooksResourceListType) resource).setParams(null);
+// paramViewer.setInput(null);
+// }
+// super.widgetSelected(e);
+// }
+//
+// });
+// removeParamButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ParamType) {
+// ParamType param = (ParamType) obj;
+// ParamsType parent = getParamsType();
+// if (parent == null)
+// return;
+// CompoundCommand compoundCommand = new CompoundCommand();
+// Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), param);
+// compoundCommand.append(command);
+// if (parent.getParam().size() == 1) {
+// // remove parent;
+// Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
+// compoundCommand.append(command1);
+// }
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
+// }
+// }
+//
+// });
+// upParamButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ParamType) {
+// ParamsType paramsType = getParamsType();
+// if (paramsType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index - 1);
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
+//
+// });
+// downParamButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ParamType) {
+// ParamsType paramsType = getParamsType();
+// if (paramsType == null)
+// return;
+// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+// EObject parent = v.eContainer();
+// int index = parent.eContents().indexOf(v);
+// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
+// index + 1);
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
+//
+// });
+// paramPropertiesButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// openParamPropertiesModifyDialog();
+// super.widgetSelected(e);
+// }
+//
+// });
+// }
+//
+// protected void openParamPropertiesModifyDialog() {
+// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
+// if (selection == null)
+// return;
+// Object obj = selection.getFirstElement();
+// if (obj instanceof ParamType) {
+// ParamType param = (ParamType) obj;
+// ParamsType parent = getParamsType();
+// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+// SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent, getManagedForm().getToolkit(),
+// smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
+// dialog.open();
+// }
+// }
+//
+// private void createDefaultSection(Composite parent, FormToolkit toolkit) {
+// ModelPanelCreator defaultSettingPanelCreator = getDefaultSettingPanelCreator();
+// EObject model = getSmooksResourceList();
+// if (model != null) {
+// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
+// .getEditingDomain();
+// IItemPropertySource itemPropertySource = (IItemPropertySource) editingDomain.getAdapterFactory().adapt(
+// model, IItemPropertySource.class);
+// if (model != null) {
+// defaultSettingPanelCreator.createModelPanel(model, toolkit, parent, itemPropertySource,
+// smooksModelProvider, getEditor());
+// }
+// }
+//
+// }
+//
+// private void disposeDefaultSettingCompositeControls() {
+// disposeCompositeControls(defaultSettingComposite, null);
+// }
- }
-
}
15 years, 1 month
JBoss Tools SVN: r18745 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-19 10:26:56 -0500 (Thu, 19 Nov 2009)
New Revision: 18745
Modified:
trunk/seam/docs/reference/en/modules/seam_refactoring.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-950 Refactoring of Managed Bean/Methods/Properties which are used in ELs - seam is update
Modified: trunk/seam/docs/reference/en/modules/seam_refactoring.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_refactoring.xml 2009-11-19 15:03:49 UTC (rev 18744)
+++ trunk/seam/docs/reference/en/modules/seam_refactoring.xml 2009-11-19 15:26:56 UTC (rev 18745)
@@ -9,9 +9,9 @@
<keyword>rename</keyword>
</keywordset>
</chapterinfo>
- <title>Seam refactoring tools</title>
+ <title>Seam Refactoring Tools</title>
<para>The goal of Seam components refactoring is to make system-wide code changes without affecting the behavior of the program.
- The Seam module of JBoss Tools provides assistance in easily refactoring code.
+ The Seam module of JBoss Tools provides assistance in easily code refactoring. Starting from Jboss Tools M4 refactoring functionality became also available for managed beans, method and properties used in ELs
When performing a refactoring operation, you can preview all of the changes resulting from a refactoring action before you choose to carry them out.
Refactoring commands are available from the context menus of several views and editors.
Now Seam refactoring tools include only one refactoring command:<emphasis><property>Rename Seam Component</property></emphasis>.
15 years, 1 month
JBoss Tools SVN: r18744 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-19 10:03:49 -0500 (Thu, 19 Nov 2009)
New Revision: 18744
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorDialog.java
Log:
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorDialog.java 2009-11-19 14:55:29 UTC (rev 18743)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorDialog.java 2009-11-19 15:03:49 UTC (rev 18744)
@@ -131,7 +131,16 @@
protected void setWizard(IWizard newWizard) {
}
public Layout createLayout(int mw, int mh, int minW, int minH) {
- return new PageContainerFillLayout(mw, mh, minW, minH);
+ return new PageContainerFillLayout(mw, mh, minW, minH) {
+ public Point computeSize(Composite composite, int wHint, int hHint,
+ boolean force) {
+ Point p = super.computeSize(composite, wHint, hHint, force);
+ if(p.y > 400) p.y = 400;
+ return p;
+ }
+
+ };
+
}
}
15 years, 1 month
JBoss Tools SVN: r18743 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-11-19 09:55:29 -0500 (Thu, 19 Nov 2009)
New Revision: 18743
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPageSetupDiagramViewerAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PageSetupDialog.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/DiagramEditPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5147 & https://jira.jboss.org/jira/browse/JBIDE-5148 - initial implementation for Print Page Setup & Print Preview
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF 2009-11-19 13:52:04 UTC (rev 18742)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF 2009-11-19 14:55:29 UTC (rev 18743)
@@ -16,6 +16,9 @@
org.hibernate.eclipse,
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
+ org.eclipse.gmf.runtime.diagram.ui,
+ org.eclipse.gmf.runtime.diagram.ui.printing,
+ org.eclipse.gmf.runtime.draw2d.ui.render,
org.hibernate.eclipse.console
Bundle-Version: 3.3.0.qualifier
Export-Package: org.jboss.tools.hibernate.ui.diagram,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.properties 2009-11-19 13:52:04 UTC (rev 18742)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.properties 2009-11-19 14:55:29 UTC (rev 18743)
@@ -1,2 +1,5 @@
providerName=JBoss by Red Hat
pluginName=UI Plugin
+Category_Print=Print
+Command_PrintPageSetup=Page Setup...
+Command_PrintPreview=Print Preview
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.xml 2009-11-19 13:52:04 UTC (rev 18742)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/plugin.xml 2009-11-19 14:55:29 UTC (rev 18743)
@@ -13,7 +13,48 @@
name="Hibernate Diagram Viewer">
</editor>
</extension>
-
+ <!-- hide Print Page Setup & Print Preview initial implementation
+ <extension point="org.eclipse.ui.commands">
+ <category id="org.jboss.tools.hibernate.ui.print.category1"
+ name="%Category_Print">
+ </category>
+ <command categoryId="org.jboss.tools.hibernate.ui.print.category1"
+ defaultHandler="org.jboss.tools.hibernate.ui.diagram.editors.actions.PrintPageSetupDiagramViewerAction"
+ id="org.jboss.tools.hibernate.ui.run_page_setup"
+ name="%Command_PrintPageSetup">
+ </command>
+ <command categoryId="org.jboss.tools.hibernate.ui.print.category1"
+ defaultHandler="org.jboss.tools.hibernate.ui.diagram.editors.actions.PrintPreViewDiagramViewerAction"
+ id="org.jboss.tools.hibernate.ui.run_print_preview"
+ name="%Command_PrintPreview">
+ </command>
+ </extension>
+ <extension point="org.eclipse.ui.menus">
+ <menuContribution locationURI="menu:file?before=print.ext">
+ <command commandId="org.jboss.tools.hibernate.ui.run_page_setup"
+ id="org.jboss.tools.hibernate.ui.run_page_setup" style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeEditorId">
+ <or>
+ <equals value="org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer" />
+ </or>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution locationURI="menu:file?before=print.ext">
+ <command commandId="org.jboss.tools.hibernate.ui.run_print_preview"
+ id="org.jboss.tools.hibernate.ui.run_print_preview" style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeEditorId">
+ <or>
+ <equals value="org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer" />
+ </or>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension> -->
<extension point="org.eclipse.ui.popupMenus">
<objectContribution id="diagramEditorAction" objectClass="java.lang.Object">
<visibility>
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPageSetupDiagramViewerAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPageSetupDiagramViewerAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPageSetupDiagramViewerAction.java 2009-11-19 14:55:29 UTC (rev 18743)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.ui.diagram.editors.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Initial test implementation for Print Page Setup for Mapping Diagram
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class PrintPageSetupDiagramViewerAction extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ new org.jboss.tools.hibernate.ui.diagram.editors.print.PageSetupDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()).open();
+ return null;
+ }
+
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java 2009-11-19 14:55:29 UTC (rev 18743)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.ui.diagram.editors.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.gmf.runtime.common.ui.action.actions.IPrintActionHelper;
+
+/**
+ * Initial test implementation for Print preview for Mapping Diagram
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class PrintPreViewDiagramViewerAction extends AbstractHandler {
+
+ private org.jboss.tools.hibernate.ui.diagram.editors.print.PrintPreviewHelper
+ printPreviewHelper = new org.jboss.tools.hibernate.ui.diagram.editors.print.PrintPreviewHelper();
+ private IPrintActionHelper helper = null;
+ //new org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.EnhancedPrintActionHelper();
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ printPreviewHelper.doPrintPreview(helper);
+ return null;
+ }
+
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/DiagramEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/DiagramEditPart.java 2009-11-19 13:52:04 UTC (rev 18742)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/DiagramEditPart.java 2009-11-19 14:55:29 UTC (rev 18743)
@@ -193,4 +193,8 @@
}
return super.getAdapter(adapter);
}
+
+ public IFigure getLayer(Object layer) {
+ return super.getLayer(layer);
+ }
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PageSetupDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PageSetupDialog.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PageSetupDialog.java 2009-11-19 14:55:29 UTC (rev 18743)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.ui.diagram.editors.print;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * initial implementation
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class PageSetupDialog extends Dialog {
+
+ public PageSetupDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ protected void cancelPressed() {
+ super.cancelPressed();
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ //super.createDialogArea(parent);
+ getShell().setText("Page Setup");
+ return parent;
+ }
+
+ protected void okPressed() {
+ }
+
+ public Button getOkButton() {
+ return super.getButton(OK);
+ }
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java 2009-11-19 14:55:29 UTC (rev 18743)
@@ -0,0 +1,1082 @@
+package org.jboss.tools.hibernate.ui.diagram.editors.print;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.SWTGraphics;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gmf.runtime.common.ui.action.actions.IPrintActionHelper;
+import org.eclipse.gmf.runtime.common.ui.util.WindowUtil;
+import org.eclipse.gmf.runtime.diagram.ui.internal.pagesetup.PageInfoHelper.PageMargins;
+import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingPluginImages;
+import org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.HeaderAndFooterHelper;
+import org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.PrintHelperUtil;
+import org.eclipse.gmf.runtime.draw2d.ui.internal.graphics.MapModeGraphics;
+import org.eclipse.gmf.runtime.draw2d.ui.internal.graphics.ScaledGraphics;
+import org.eclipse.gmf.runtime.draw2d.ui.internal.mapmode.DiagramMapModeUtil;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
+import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics;
+import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedScaledGraphics;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
+import org.jboss.tools.hibernate.ui.diagram.editors.parts.DiagramEditPart;
+
+/**
+ * initial implementation
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class PrintPreviewHelper{
+
+ /**
+ * Action helper for print. This must be passed in to have something happen
+ * when print is pressed
+ */
+ protected IPrintActionHelper printActionHelper;
+
+ /**
+ * Increment userX everytime the user moves right, decrement userX everytime
+ * the user moves left.
+ *
+ * userX >= 0
+ */
+ protected int userX = 0;
+
+ /**
+ * Increment userY everytime the user moves down, decrement userY everytime
+ * the user moves up.
+ *
+ * userY >= 0
+ */
+ protected int userY = 0;
+
+ /**
+ * Number of rows, initialized with initial number of rows of pages to
+ * display
+ */
+ protected int numberOfRowsToDisplay = 2;
+
+ /**
+ * Number of columns, initialized with initial number of columns of pages to
+ * display
+ */
+ protected int numberOfColumnsToDisplay = 2;
+
+ /**
+ * The diagram edit part
+ */
+ protected DiagramEditPart diagramEditPart;
+
+ /**
+ * Max bounds of a page for no page break
+ */
+ protected Rectangle pageBreakBounds;
+
+ /* SWT interface variables */
+
+ /**
+ * Body of the shell.
+ */
+ protected Composite body;
+
+ /**
+ * Composite for the pages
+ */
+ protected Composite composite;
+
+ /**
+ * Height of the button bar, initialized right before the button bar is
+ * created.
+ */
+ protected int buttonBarHeight;
+
+ /**
+ * Shell for the new pop up
+ */
+ protected Shell shell;
+
+ /**
+ * Temporary shell to be used when creating the diagram editpart.
+ */
+ private Shell tempShell;
+
+ /* Toolbar items are in left to right order */
+
+ /**
+ * Print item on toolbar
+ */
+ protected ToolItem printTool;
+
+ /**
+ * Enable or disable the print option
+ */
+ protected boolean enablePrinting = true;
+
+ /**
+ * Pages item on toolbar
+ */
+ protected ToolItem pagesTool;
+
+ /**
+ * Left item on toolbar
+ */
+ protected ToolItem leftTool;
+
+ /**
+ * Right item on toolbar
+ */
+ protected ToolItem rightTool;
+
+ /**
+ * Up item on toolbar
+ */
+ protected ToolItem upTool;
+
+ /**
+ * Down item on toolbar
+ */
+ protected ToolItem downTool;
+
+ /**
+ * Close item on toolbar
+ */
+ protected ToolItem closeTool;
+
+ /**
+ * It's easiest to keep track of the page images using an image list, but I
+ * could also have done getImage on the labels
+ */
+ private List imageList = new ArrayList();
+
+ /**
+ * Border size
+ */
+ protected static final int BORDER_SIZE = 20;
+
+ /**
+ * the background color
+ */
+ private static final Color BACKGROUND_COLOR = new Color(Display
+ .getDefault(), 124, 124, 124);
+
+ /* Images */
+ /**
+ * Enabled print image
+ */
+ protected Image printImage;
+
+ /**
+ * Disabled Print image
+ */
+ protected Image disabledPrintImage;
+
+ /**
+ * Page image, unlikely to ever be disabled
+ */
+ protected Image pageImage;
+
+ /**
+ * Enabled left image
+ */
+ protected Image leftImage;
+
+ /**
+ * Disabled left image
+ */
+ protected Image disabledLeftImage;
+
+ /**
+ * Enabled right image
+ */
+ protected Image rightImage;
+
+ /**
+ * Disabled right image
+ */
+ protected Image disabledRightImage;
+
+ /**
+ * Enabled up image
+ */
+ protected Image upImage;
+
+ /**
+ * Diabled up image
+ */
+ protected Image disabledUpImage;
+
+ /**
+ * Enabled down image
+ */
+ protected Image downImage;
+
+ /**
+ * Disabled down image
+ */
+ protected Image disabledDownImage;
+
+ /**
+ * Close image, unlikely to ever be disabled
+ */
+ protected Image closeImage;
+
+ /**
+ * The print preview helper is capable of showing zoom input.
+ * userScale is a value between 0 and 1.
+ */
+ protected double userScale = 1;
+
+ /**
+ * Initial zoom levels.
+ */
+ private int[] zoomLevels = { 25, 50, 75, 100, 150, 200, 250, 300, 400 };
+
+ /**
+ * A minimum scale percentage.
+ */
+ private static int MINIMUM_SCALE_FACTOR = 5;
+
+ /**
+ * Initialize all toolbar images
+ */
+ protected void initializeToolbarImages() {
+ printImage = DiagramUIPrintingPluginImages.DESC_PRINT.createImage();
+
+ disabledPrintImage = DiagramUIPrintingPluginImages.DESC_PRINT_DISABLED
+ .createImage();
+
+ pageImage = DiagramUIPrintingPluginImages.DESC_PAGE.createImage();
+
+ leftImage = DiagramUIPrintingPluginImages.DESC_LEFT.createImage();
+
+ disabledLeftImage = DiagramUIPrintingPluginImages.DESC_LEFT_DISABLED
+ .createImage();
+
+ rightImage = DiagramUIPrintingPluginImages.DESC_RIGHT.createImage();
+
+ disabledRightImage = DiagramUIPrintingPluginImages.DESC_RIGHT_DISABLED
+ .createImage();
+
+ upImage = DiagramUIPrintingPluginImages.DESC_UP.createImage();
+ disabledUpImage = DiagramUIPrintingPluginImages.DESC_UP_DISABLED
+ .createImage();
+
+ downImage = DiagramUIPrintingPluginImages.DESC_DOWN.createImage();
+
+ disabledDownImage = DiagramUIPrintingPluginImages.DESC_DOWN_DISABLED
+ .createImage();
+
+ closeImage = DiagramUIPrintingPluginImages.DESC_CLOSE.createImage();
+ }
+
+ public void enablePrinting(boolean enablePrinting){
+ this.enablePrinting = enablePrinting;
+ }
+
+ public void doPrintPreview(IPrintActionHelper prActionHelper) {
+ this.printActionHelper = prActionHelper;
+
+ setUserScale(PrintHelperUtil.getScale());
+
+ if (getDiagramEditorPart() == null) {
+ MessageDialog
+ .openInformation(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(),
+ "PrintPreview_Title",
+ "PrintPreview_NotEnabled");
+ return;
+ }
+
+ if (!isPrinterInstalled()) {
+ WindowUtil
+ .doMessageBox("PrintPreview_NoPrinterInstalled",
+ "PrintPreview_Title",
+ SWT.ICON_ERROR, PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+ return;
+ }
+
+ initializeToolbarImages();
+
+ initializeMapMode();
+
+ diagramEditPart = null;
+ pageBreakBounds = null;
+
+ userX = 0;
+ userY = 0;
+
+ if (getTotalNumberOfRows() == 1 && getTotalNumberOfColumns() == 1) {
+ numberOfRowsToDisplay = 1;
+ numberOfColumnsToDisplay = 1;
+ }
+ else if (getTotalNumberOfRows() == 1) {
+ numberOfRowsToDisplay = 1;
+ numberOfColumnsToDisplay = 2;
+ }
+ else {
+ numberOfRowsToDisplay = 2;
+ numberOfColumnsToDisplay = 2;
+ }
+
+ Display display = PlatformUI.getWorkbench().getDisplay();
+
+ //check for rtl Torientation...
+ int style = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getStyle();
+ if ((style & SWT.MIRRORED) != 0) {
+ shell = new Shell(display, SWT.APPLICATION_MODAL | SWT.TITLE
+ | SWT.CLOSE | SWT.BORDER | SWT.RIGHT_TO_LEFT);
+ }
+ else
+ shell = new Shell(display, SWT.APPLICATION_MODAL | SWT.TITLE
+ | SWT.CLOSE | SWT.BORDER);
+
+
+
+ shell.setSize(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell().getSize());
+ shell.setText("PrintPreview_Title");
+ shell.setLocation(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell().getLocation());
+ shell.setLayout(new GridLayout(1, true));
+
+ ToolBar bar = new ToolBar(shell, SWT.FLAT | SWT.HORIZONTAL);
+
+ printTool = new ToolItem(bar, SWT.NULL);
+ printTool.setToolTipText("PrintPreview_PrintToolItem");
+ printTool.setImage(printImage);
+ printTool.setDisabledImage(disabledPrintImage);
+ printTool.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ //should not be enabled
+ Assert.isNotNull(printActionHelper);
+
+ printActionHelper
+ .doPrint(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage()
+ .getActivePart());
+ shell.setActive();
+
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ if (printActionHelper == null || !enablePrinting) {
+ printTool.setEnabled(false);
+ }
+
+ new ToolItem(bar, SWT.SEPARATOR);
+
+ pagesTool = new ToolItem(bar, SWT.DROP_DOWN);
+ pagesTool.setToolTipText("PrintPreview_PagesToolItem");
+ pagesTool.setImage(pageImage);
+
+ pagesTool.addSelectionListener(new SelectionAdapter() {
+
+ private Menu menu = null;
+
+ //also update userX, userY, numberOfRowsToDisplay,
+ // numberOfColumnsToDisplay
+ private void updatePreview(int newNumberOfColumnsToDisplay,
+ int newNumberOfRowsToDisplay) {
+ numberOfRowsToDisplay = newNumberOfRowsToDisplay;
+ numberOfColumnsToDisplay = newNumberOfColumnsToDisplay;
+
+ //When switching the number of pages to display to a bigger
+ //number, you can get an extra blank page on the right or on
+ //the bottom. This check prevents the extra blank page.
+
+ if (userX + numberOfColumnsToDisplay > getTotalNumberOfColumns()) {
+ //move it left
+ userX = getTotalNumberOfColumns()
+ - numberOfColumnsToDisplay;
+ //be safe, check for 0
+ if (userX < 0)
+ userX = 0;
+ }
+
+ if (userY + numberOfRowsToDisplay > getTotalNumberOfRows()) {
+ //move it up
+ userY = getTotalNumberOfRows() - numberOfRowsToDisplay;
+ //be safe, check for 0
+ if (userY < 0)
+ userY = 0;
+ }
+
+ refreshComposite();
+
+ }
+
+ public void widgetSelected(SelectionEvent event) {
+ // Create the menu if it has not already been created
+
+ if (menu == null) {
+ // Lazy create the menu.
+ menu = new Menu(shell);
+ MenuItem menuItem = new MenuItem(menu, SWT.NONE);
+ menuItem.setText("PrintPreview_1Up");
+ menuItem.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ updatePreview(1, 1);
+ }
+ });
+
+ menuItem = new MenuItem(menu, SWT.NONE);
+ menuItem.setText("PrintPreview_2Up");
+ menuItem.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ updatePreview(2, 1);
+ }
+ });
+
+ menuItem = new MenuItem(menu, SWT.NONE);
+ menuItem.setText("PrintPreview_4Up");
+ menuItem.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ updatePreview(2, 2);
+ }
+ });
+ }
+
+ final ToolItem toolItem = (ToolItem) event.widget;
+ final ToolBar toolBar = toolItem.getParent();
+ org.eclipse.swt.graphics.Rectangle toolItemBounds = toolItem
+ .getBounds();
+ //left aligned under the pages button
+ Point point = toolBar.toDisplay(new Point(toolItemBounds.x,
+ toolItemBounds.y));
+ menu.setLocation(point.x, point.y + toolItemBounds.height);
+ setMenuVisible(true);
+
+ }
+
+ private void setMenuVisible(boolean visible) {
+ menu.setVisible(visible);
+ }
+
+ });
+
+ new ToolItem(bar, SWT.SEPARATOR);
+
+ leftTool = new ToolItem(bar, SWT.NULL);
+ if ((style & SWT.MIRRORED) != 0) {
+ //switch left and right for RTL...
+ leftTool.setToolTipText("PrintPreview_RightToolItem");
+ leftTool.setImage(rightImage);
+ leftTool.setDisabledImage(disabledRightImage);
+ }
+ else {
+ leftTool.setToolTipText("PrintPreview_LeftToolItem");
+ leftTool.setImage(leftImage);
+ leftTool.setDisabledImage(disabledLeftImage);
+ }
+
+ leftTool.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (userX > 0) {
+ userX--;
+ refreshComposite();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ rightTool = new ToolItem(bar, SWT.NULL);
+ if ((style & SWT.MIRRORED) != 0) {
+ //switch left and right for RTL
+ rightTool.setToolTipText("PrintPreview_LeftToolItem");
+ rightTool.setImage(leftImage);
+ rightTool.setDisabledImage(disabledLeftImage);
+ }
+ else {
+ rightTool.setToolTipText("PrintPreview_RightToolItem");
+ rightTool.setImage(rightImage);
+ rightTool.setDisabledImage(disabledRightImage);
+ }
+
+ rightTool.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ //check for max pages to be safe
+ if (!(userX + numberOfColumnsToDisplay + 1 > getTotalNumberOfColumns())) {
+ userX++;
+ refreshComposite();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ upTool = new ToolItem(bar, SWT.NULL);
+ upTool.setToolTipText("PrintPreview_UpToolItem");
+ upTool.setImage(upImage);
+ upTool.setDisabledImage(disabledUpImage);
+ upTool.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (userY > 0) {
+ userY--;
+ refreshComposite();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ downTool = new ToolItem(bar, SWT.NULL);
+ downTool.setToolTipText("PrintPreview_DownToolItem");
+ downTool.setImage(downImage);
+ downTool.setDisabledImage(disabledDownImage);
+ downTool.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (!(userY + numberOfRowsToDisplay + 1 > getTotalNumberOfRows())) {
+ userY++;
+ refreshComposite();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ new ToolItem(bar, SWT.SEPARATOR);
+
+ ToolItem separator = new ToolItem(bar, SWT.SEPARATOR);
+ final Combo zoomCombo = new Combo(bar, SWT.DROP_DOWN);
+
+ for (int i = 0; i < zoomLevels.length; i++) {
+ zoomCombo.add(getDisplayScale(zoomLevels[i]));
+ }
+
+ zoomCombo.setText(getDisplayScale(PrintHelperUtil.getScale()));
+
+ zoomCombo.addSelectionListener(new SelectionAdapter() {
+
+ private void doZoom(Combo combo) {
+ String scaleFactor = combo.getText();
+ int percentageIndex = scaleFactor.indexOf("%"); //$NON-NLS-1$
+ if (percentageIndex > 0) {
+ scaleFactor = scaleFactor.substring(0, percentageIndex);
+ }
+
+ int scalePercentage = PrintHelperUtil.getScale();
+ try {
+ scalePercentage = Integer.parseInt(scaleFactor);
+ } catch (NumberFormatException e) {
+ // Ignore invalid entry; default is last known acceptable value
+ }
+
+ if(scalePercentage < MINIMUM_SCALE_FACTOR){
+ scalePercentage = MINIMUM_SCALE_FACTOR;
+ }
+ setPercentScaling(scalePercentage);
+ refreshComposite();
+ combo.setText(getDisplayScale(scalePercentage));
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ doZoom((Combo) e.getSource());
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ //String selectedString = ((Combo) e.getSource()).getText();
+ doZoom((Combo) e.getSource());
+ }
+ });
+
+ zoomCombo.pack();
+ separator.setWidth(zoomCombo.getSize().x);
+ separator.setControl(zoomCombo);
+
+ new ToolItem(bar, SWT.SEPARATOR);
+ closeTool = new ToolItem(bar, SWT.NULL);
+ closeTool.setToolTipText("PrintPreview_CloseToolItem");
+ closeTool.setImage(closeImage);
+ closeTool.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ dispose();
+ shell.close();
+ shell.dispose();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ buttonBarHeight = bar.getBounds().height - bar.getBounds().y;
+
+ bar.setBounds(0, 0, shell.getSize().x, buttonBarHeight);
+
+ //do the body in the middle
+ body = new Composite(shell, SWT.NULL);
+ body.setLayout(new GridLayout(1, true));
+ body.setLayoutData(new GridData(GridData.FILL_BOTH));
+ body.setBackground(BACKGROUND_COLOR);
+
+ composite = new Composite(body, SWT.NULL);
+ composite.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
+
+ refreshComposite();
+
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+
+ dispose();
+ shell.dispose();
+
+ }
+
+ private IMapMode mm;
+
+ public PrintPreviewHelper() {
+ //do nothing
+ }
+
+ protected IMapMode getMapMode() {
+ return mm;
+ }
+
+ private void initializeMapMode() {
+ DiagramViewer diagramEditor = getDiagramEditorPart();
+
+ assert diagramEditor != null;
+ this.mm = MapModeUtil.getMapMode();
+ }
+
+ private int getTotalNumberOfRows() {
+ return 1;
+ }
+
+ private DiagramViewer getDiagramEditorPart() {
+ //more explicit than using window
+ IEditorPart editorPart = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ if (!(editorPart instanceof DiagramViewer)) {
+ return null;
+ }
+
+ DiagramViewer diagramEditorPart = (DiagramViewer) editorPart;
+
+ return diagramEditorPart;
+ }
+
+ protected Rectangle getDiagramBounds() {
+ return new Rectangle(0, 0, 100, 100);
+ }
+
+ protected Rectangle getPageBreakBounds() {
+ if (pageBreakBounds == null) {
+ pageBreakBounds = new Rectangle(0, 0, 100, 100);
+ //vit
+ //pageBreakBounds = PrintHelperUtil.getPageBreakBounds(getDiagramEditPart(), true).getCopy();
+ }
+
+ return pageBreakBounds;
+ }
+
+ protected Rectangle getBounds() {
+ //don't worry about storing it, it's cached
+ return (getPageBreakBounds() == null) ? getDiagramBounds()
+ : getPageBreakBounds();
+ }
+
+ protected DiagramEditPart getDiagramEditPart() {
+ if (diagramEditPart == null) {
+ diagramEditPart = getDiagramEditorPart().getDiagramEditPart();
+ }
+ if (diagramEditPart == null) {
+ /** /
+ Diagram diagram = getDiagramEditorPart().getDiagram(); //do not getDiagramEditPart
+ PreferencesHint preferencesHint = getPreferencesHint(getDiagramEditorPart());
+ diagramEditPart = PrintHelperUtil.createDiagramEditPart(diagram, preferencesHint, getTempShell());
+ PrintHelperUtil.initializePreferences(diagramEditPart, preferencesHint);
+ /**/
+ }
+ return diagramEditPart;
+ }
+
+ private int getTotalNumberOfColumns() {
+ return 1;
+ }
+
+ protected boolean isPrinterInstalled() {
+ try {
+ PrintService[] printServices = PrintServiceLookup.lookupPrintServices(
+ null, null);
+ return printServices.length > 0;
+ } catch (SWTError e) {
+ if (e.code == SWT.ERROR_NO_HANDLES) {
+ //it might have really been ERROR_NO_HANDLES, but there's
+ //no way for me to really know
+ return false;
+ }
+ // "Failed to make instance of Printer object"
+ throw e;
+ }
+ }
+
+ private void disposeImages() {
+ while (imageList.size() > 0) {
+ Assert.isTrue(imageList.get(0) instanceof Image);
+ if (!((Image) imageList.get(0)).isDisposed())
+ ((Image) imageList.get(0)).dispose();
+ imageList.remove(0);
+ }
+ }
+
+ private void refreshComposite(){
+
+ updateCompositeForNumberOfColumns(numberOfRowsToDisplay,
+ numberOfColumnsToDisplay);
+
+ updateLeftRightUpDownButtonsForToolbar();
+ }
+
+ private void updateCompositeForNumberOfColumns(int numberOfRows,
+ int numberOfColumns) {
+ Assert.isNotNull(shell);
+ Assert.isNotNull(composite);
+
+ WindowUtil.disposeChildren(composite);
+ disposeImages();
+
+ //the next two lines of code are intentional
+ composite.setLayout(null);
+ composite.pack();
+
+ composite.setLayout(new GridLayout(numberOfColumns, true));
+
+ //(shell height - toolbar height - top border - bottom border - title -
+ // ((# of rows - 1) x vertical border between images)) / # of rows
+ int imageHeight = (shell.getSize().y - buttonBarHeight - BORDER_SIZE
+ - BORDER_SIZE - BORDER_SIZE - ((numberOfRows - 1) * BORDER_SIZE))
+ / numberOfRows;
+
+ //(shell width - left border - right border - ((# of columns - 1) x
+ // horizontal border between images)) / # of columns
+ int imageWidth = (shell.getSize().x - BORDER_SIZE - BORDER_SIZE - ((numberOfColumns - 1) * BORDER_SIZE))
+ / numberOfColumns;
+
+ //now adjust to the limiting one based on aspect ratio
+
+ //to make this conform to the page breaks, RATLC00247228
+ //get printer ratio from the page, not the real printer
+
+ //vit
+ //org.eclipse.draw2d.geometry.Point pageSize = PageInfoHelper
+ // .getPageSize(getPreferenceStore(), false, getMapMode());
+ org.eclipse.draw2d.geometry.Point pageSize =
+ new org.eclipse.draw2d.geometry.Point(100, 100);
+ Assert.isNotNull(pageSize);
+
+ //width / height
+ float printerRatio = ((float) pageSize.x) / ((float) pageSize.y);
+
+ if (imageHeight * printerRatio < imageWidth) {
+ //round down
+ imageWidth = (int) (imageHeight * printerRatio);
+ } else if (imageWidth * (1 / printerRatio) < imageHeight) {
+ //round down
+ imageHeight = (int) (imageWidth * (1.0f / printerRatio));
+ }
+
+ //vit
+ //PageMargins margins = PageInfoHelper.getPageMargins(getPreferenceStore(), getMapMode());
+ PageMargins margins = new PageMargins();
+ margins.left = 1270;
+ margins.right = 1270;
+ margins.top = 1270;
+ margins.bottom = 1270;
+
+
+ //make sure height and width are not 0, if too small <4, don't bother
+ if (!(imageHeight <= 4 || imageWidth <= 4)) {
+
+ //or imageWidth / pageSize.x
+ float scale = ( imageHeight / (float) pageSize.y)
+ / (float) DiagramMapModeUtil.getScale(getMapMode());
+
+ scale *= userScale;
+
+ margins.left /= userScale;
+ margins.right /= userScale;
+ margins.bottom /= userScale;
+ margins.top /= userScale;
+
+ for (int i = 0; i < numberOfRows; i++) {
+ for (int j = 0; j < numberOfColumns; j++) {
+ Label label = new Label(composite, SWT.NULL);
+ Image pageImg = makeImage(imageWidth, imageHeight, i, j,
+ scale, margins);
+ label.setImage(pageImg);
+ imageList.add(pageImg);
+ }
+ }
+ }
+
+ composite.pack();
+
+ //GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_CENTER
+ // won't do it for you
+ org.eclipse.swt.graphics.Rectangle compositeBounds = composite
+ .getBounds();
+
+ //this approximation is OK
+ compositeBounds.x = (shell.getSize().x - BORDER_SIZE - compositeBounds.width) / 2;
+ compositeBounds.y = (shell.getSize().y - buttonBarHeight - BORDER_SIZE
+ - BORDER_SIZE - BORDER_SIZE - compositeBounds.height) / 2;
+ composite.setBounds(compositeBounds);
+ }
+
+ protected void updateLeftRightUpDownButtonsForToolbar() {
+ if (userX == 0) {
+ leftTool.setEnabled(false);
+ } else {
+ leftTool.setEnabled(true);
+ }
+
+ //should be (user + 1) + (display - 1), the +1 and -1 can be taken out
+ if (userX + numberOfColumnsToDisplay + 1 > getTotalNumberOfColumns()) {
+ rightTool.setEnabled(false);
+ } else {
+ rightTool.setEnabled(true);
+ }
+
+ if (userY == 0) {
+ upTool.setEnabled(false);
+ } else {
+ upTool.setEnabled(true);
+ }
+
+ if (userY + numberOfRowsToDisplay + 1 > getTotalNumberOfRows()) {
+ downTool.setEnabled(false);
+ } else {
+ downTool.setEnabled(true);
+ }
+ }
+
+ protected Image makeImage(int imageWidth, int imageHeight, int row,
+ int col, float scale, PageMargins margins) {
+
+ Image image = new Image(shell.getDisplay(), imageWidth, imageHeight);
+
+ GC gc = null;
+
+ //check for rtl orientation...
+ if ((shell.getStyle() & SWT.MIRRORED) != 0) {
+ gc = new GC(image, SWT.RIGHT_TO_LEFT);
+ }
+ else
+ gc = new GC(image);
+
+ SWTGraphics sg = new SWTGraphics(gc);
+ //for scaling
+ ScaledGraphics g1 = new RenderedScaledGraphics(sg);
+
+ //for himetrics and svg
+ MapModeGraphics mmg = createMapModeGraphics(g1);
+
+ //if mmg's font is null, gc.setFont will use a default font
+ gc.setFont(mmg.getFont());
+
+ drawPage(mmg, gc, scale, row, col, margins);
+
+ gc.dispose();
+
+ return image;
+ }
+
+ protected void drawPage(Graphics g, GC gc, float scale, int row, int col, PageMargins margins) {
+
+ //vit
+ scale = 4.888f;
+
+ org.eclipse.draw2d.geometry.Point pageSize =
+ new org.eclipse.draw2d.geometry.Point(0, 0);
+ //vit
+ pageSize.x = 21590;
+ pageSize.y = 27940;
+
+ g.pushState();
+
+ Rectangle bounds = getBounds();
+ //vit
+ bounds.x = bounds.y = 0;
+ bounds.height = 25400;
+ bounds.width = 19050;
+
+ if (PrintHelperUtil.getScaleToWidth() == 1 && PrintHelperUtil.getScaleToHeight() == 1) {
+ //vit
+ //bounds = getDiagramEditPart().getChildrenBounds();
+ }
+
+ int scaledPageSizeWidth = (int)(pageSize.x/userScale) ;
+ int scaledPageSizeHeight = (int)(pageSize.y/userScale) ;
+
+ //offset by page break figure bounds, then offset by the row or column we're at, and then take margins into account
+ int translateX = - bounds.x - (scaledPageSizeWidth * (col + userX)) + (margins.left * (col + userX + 1)) + (margins.right * (col + userX));
+ int translateY = - bounds.y - (scaledPageSizeHeight * (row + userY)) + (margins.top * (row + userY + 1)) + (margins.bottom * (row + userY));
+
+ //To set a specific font, we could do this
+ //For a completely accurate print preview, the font is printer specific
+ //and may not be supported by the screen, so it is pointless
+ //FontData fontData = JFaceResources.getDefaultFont().getFontData()[0];
+ //Font font = new Font(device, fontData);
+ //g.setFont(font);
+
+ if (doesPageExist(1 + userX + col, 1 + userY + row)) {
+ g.pushState(); //draw text, don't make it too small or big
+ g.scale(scale);
+
+ //vit
+ /** /
+ String headerOrFooter =
+ HeaderAndFooterHelper.makeHeaderOrFooterString(
+ WorkspaceViewerProperties.HEADER_PREFIX,
+ 1 + userY + row,
+ 1 + userX + col,
+ getDiagramEditPart());
+ /**/
+ String headerOrFooter = "headerOrFooter";
+
+ g.drawText(
+ headerOrFooter,
+ (pageSize.x - getMapMode().DPtoLP(gc.textExtent(headerOrFooter).x)) / 2,
+ getMapMode().DPtoLP(HeaderAndFooterHelper.TOP_MARGIN_DP));
+
+ //vit
+ /** /
+ headerOrFooter =
+ HeaderAndFooterHelper.makeHeaderOrFooterString(
+ WorkspaceViewerProperties.FOOTER_PREFIX,
+ 1 + userY + row,
+ 1 + userX + col,
+ getDiagramEditPart());
+ /**/
+ headerOrFooter = "headerOrFooter";
+
+ g.drawText(
+ headerOrFooter,
+ (pageSize.x - getMapMode().DPtoLP(gc.textExtent(headerOrFooter).x)) / 2,
+ pageSize.y - getMapMode().DPtoLP(HeaderAndFooterHelper.BOTTOM_MARGIN_DP));
+
+ g.popState(); //for drawing the text
+ }
+
+ g.scale(scale);
+
+ g.translate(translateX, translateY);
+
+ Rectangle clip = new Rectangle(
+ (scaledPageSizeWidth - margins.left - margins.right) * (col + userX) + bounds.x,
+ (scaledPageSizeHeight - margins.top - margins.bottom)* (row + userY) + bounds.y,
+ scaledPageSizeWidth - margins.left - margins.right,
+ scaledPageSizeHeight - margins.top - margins.bottom);
+ g.clipRect(clip);
+
+ //should be from printer and screen ratio and image size
+ getDiagramEditPart().getLayer(LayerConstants.PRINTABLE_LAYERS).paint(g);
+
+ g.popState();
+ }
+
+ private boolean doesPageExist(int x, int y) {
+ return x > 0 && y > 0 && x <= getTotalNumberOfColumns() && y <= getTotalNumberOfRows();
+ }
+
+
+ private void safeDisposeImage(Image image) {
+ if (image != null && !image.isDisposed())
+ image.dispose();
+ }
+
+ protected void dispose() {
+ disposeImages();
+ safeDisposeImage(printImage);
+ safeDisposeImage(disabledPrintImage);
+ safeDisposeImage(pageImage);
+ safeDisposeImage(leftImage);
+ safeDisposeImage(disabledLeftImage);
+ safeDisposeImage(rightImage);
+ safeDisposeImage(disabledRightImage);
+ safeDisposeImage(upImage);
+ safeDisposeImage(disabledUpImage);
+ safeDisposeImage(downImage);
+ safeDisposeImage(disabledDownImage);
+ safeDisposeImage(closeImage);
+ if (tempShell != null) {
+ tempShell.dispose();
+ tempShell = null;
+ }
+ }
+
+ protected MapModeGraphics createMapModeGraphics(
+ ScaledGraphics scaledGraphics) {
+ return new RenderedMapModeGraphics(scaledGraphics, getMapMode());
+ }
+
+ private void setUserScale(int scale){
+ userScale = scale/100f;
+ PrintHelperUtil.setScale(scale);
+ }
+
+ private String getDisplayScale(int scale) {
+ return String.valueOf(scale) + "%"; //$NON-NLS-1$
+ }
+
+ public void setPercentScaling(int userScale){
+ setUserScale(userScale);
+ }
+}
15 years, 1 month
JBoss Tools SVN: r18742 - in trunk/esb/plugins/org.jboss.tools.esb.core: resources/meta and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-19 08:52:04 -0500 (Thu, 19 Nov 2009)
New Revision: 18742
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddGenericActionSupport.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5191
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2009-11-19 12:45:37 UTC (rev 18741)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2009-11-19 13:52:04 UTC (rev 18742)
@@ -13,6 +13,7 @@
FileESB101_Properties.Title=ESB File 1.0.1
FileESB110_Properties.Title=ESB File 1.1.0
+FileESB120_Properties.Title=ESB File 1.2.0
#Providers List
@@ -117,19 +118,12 @@
#Services List
-ESBServices101_AddService.WindowTitle=Add Service
-ESBServices101_AddService.Title=ESB Service
-ESBServices101_AddService_0.WindowTitle=Add Service
-ESBServices101_AddService_0.Title=ESB Service
+ESB.AddService.WindowTitle=Add Service
+ESB.AddService.Title=ESB Service
ESBServices101_Properties.Title=Services List
-
-ESBServices110_AddService.WindowTitle=Add Service
-ESBServices110_AddService.Title=ESB Service
-ESBServices110_AddService_0.WindowTitle=Add Service
-ESBServices110_AddService_0.Title=ESB Service
-
ESBServices110_Properties.Title=Services List
+ESBServices120_Properties.Title=Services List
ESB.AddProperty.WindowTitle=Add Property
ESB.AddProperty.Title=ESB Property
@@ -207,6 +201,11 @@
ESBHTTPProvider110_Properties.Title=ESB HTTP Provider
+ESBHTTPProvider120_AddBus.WindowTitle=Add HTTP Channel
+ESBHTTPProvider120_AddBus.Title=ESB HTTP Channel
+
+ESBHTTPProvider120_Properties.Title=ESB HTTP Provider
+
#Bus
ESBBus_Properties.Title=ESB Channel
@@ -269,6 +268,7 @@
#HTTP Bus
ESBHTTPBus110_Properties.Title=ESB HTTP Channel
+ESBHTTPBus120_Properties.Title=ESB HTTP Channel
#FS Message Filter
@@ -282,81 +282,55 @@
#Service
ESBService101_Properties.Title=ESB Service
-
ESBService110_Properties.Title=ESB Service
#Listeners List
-ESBListeners101_AddListener.WindowTitle=Add Listener
-ESBListeners101_AddListener.Title=ESB Listener
+ESB.AddListener.WindowTitle=Add Listener
+ESB.AddListener.Title=ESB Listener
-ESBListeners101_AddScheduledListener.WindowTitle=Add Scheduled Listener
-ESBListeners101_AddScheduledListener.Title=ESB Scheduled Listener
+ESB.AddScheduledListener.WindowTitle=Add Scheduled Listener
+ESB.AddScheduledListener.Title=ESB Scheduled Listener
-ESBListeners101_AddJCAGateway.WindowTitle=Add JCA Gateway
-ESBListeners101_AddJCAGateway.Title=ESB JCA Gateway
+ESB.AddJCAGateway.WindowTitle=Add JCA Gateway
+ESB.AddJCAGateway.Title=ESB JCA Gateway
-ESBListeners101_AddJMSListener.WindowTitle=Add JMS Listener
-ESBListeners101_AddJMSListener.Title=ESB JMS Listener
+ESB.AddJMSListener.WindowTitle=Add JMS Listener
+ESB.AddJMSListener.Title=ESB JMS Listener
-ESBListeners101_AddFSListener.WindowTitle=Add FS Listener
-ESBListeners101_AddFSListener.Title=ESB FS Listener
+ESB.AddFSListener.WindowTitle=Add FS Listener
+ESB.AddFSListener.Title=ESB FS Listener
-ESBListeners101_AddFTPListener.WindowTitle=Add FTP Listener
-ESBListeners101_AddFTPListener.Title=ESB FTP Listener
+ESB.AddFTPListener.WindowTitle=Add FTP Listener
+ESB.AddFTPListener.Title=ESB FTP Listener
-ESBListeners101_AddSQLListener.WindowTitle=Add SQL Listener
-ESBListeners101_AddSQLListener.Title=ESB SQL Listener
+ESB.AddSQLListener.WindowTitle=Add SQL Listener
+ESB.AddSQLListener.Title=ESB SQL Listener
-ESBListeners101_AddJBRListener.WindowTitle=Add JBR Listener
-ESBListeners101_AddJBRListener.Title=ESB JBR Listener
+ESB.AddJBRListener.WindowTitle=Add JBR Listener
+ESB.AddJBRListener.Title=ESB JBR Listener
-ESBListeners101_AddHibernateListener.WindowTitle=Add Hibernate Listener
-ESBListeners101_AddHibernateListener.Title=ESB Hibernate Listener
+ESB.AddHibernateListener.WindowTitle=Add Hibernate Listener
+ESB.AddHibernateListener.Title=ESB Hibernate Listener
-ESBListeners101_AddGroovyListener.WindowTitle=Add Groovy Listener
-ESBListeners101_AddGroovyListener.Title=ESB Groovy Listener
+ESB.AddGroovyListener.WindowTitle=Add Groovy Listener
+ESB.AddGroovyListener.Title=ESB Groovy Listener
ESBListeners101_Properties.Title=ESB Listeners List
-ESBListeners110_AddListener.WindowTitle=Add Listener
-ESBListeners110_AddListener.Title=ESB Listener
+ESB.AddHTTPListener.WindowTitle=Add HTTP Listener
+ESB.AddHTTPListener.Title=ESB HTTP Listener
-ESBListeners110_AddScheduledListener.WindowTitle=Add Scheduled Listener
-ESBListeners110_AddScheduledListener.Title=ESB Scheduled Listener
+ESB.AddUDPListener.WindowTitle=Add UDP Listener
+ESB.AddUDPListener.Title=ESB UDP Listener
-ESBListeners110_AddJCAGateway.WindowTitle=Add JCA Gateway
-ESBListeners110_AddJCAGateway.Title=ESB JCA Gateway
+ESBListeners110_Properties.Title=ESB Listeners List
-ESBListeners110_AddJMSListener.WindowTitle=Add JMS Listener
-ESBListeners110_AddJMSListener.Title=ESB JMS Listener
+ESB.AddHTTPGateway.WindowTitle=Add HTTP Gateway
+ESB.AddHTTPGateway.Title=ESB HTTP Gateway
-ESBListeners110_AddFSListener.WindowTitle=Add FS Listener
-ESBListeners110_AddFSListener.Title=ESB FS Listener
+ESBListeners120_Properties.Title=ESB Listeners List
-ESBListeners110_AddFTPListener.WindowTitle=Add FTP Listener
-ESBListeners110_AddFTPListener.Title=ESB FTP Listener
-
-ESBListeners110_AddSQLListener.WindowTitle=Add SQL Listener
-ESBListeners110_AddSQLListener.Title=ESB SQL Listener
-
-ESBListeners110_AddJBRListener.WindowTitle=Add JBR Listener
-ESBListeners110_AddJBRListener.Title=ESB JBR Listener
-
-ESBListeners110_AddHibernateListener.WindowTitle=Add Hibernate Listener
-ESBListeners110_AddHibernateListener.Title=ESB Hibernate Listener
-
-ESBListeners110_AddGroovyListener.WindowTitle=Add Groovy Listener
-ESBListeners110_AddGroovyListener.Title=ESB Groovy Listener
-
-ESBListeners110_AddHTTPListener.WindowTitle=Add HTTP Listener
-ESBListeners110_AddHTTPListener.Title=ESB HTTP Listener
-
-ESBListeners110_AddUDPListener.WindowTitle=Add UDP Listener
-ESBListeners110_AddUDPListener.Title=ESB UDP Listener
-
-ESBListeners110_Properties.Title=ESB Listeners List
-
# ESB Listener
ESBListener101_Properties.Title=ESB Listener
@@ -403,6 +377,7 @@
# HTTP Listener
ESBHTTPListener110_Properties.Title=ESB HTTP Listener
+ESBHTTPGateway120_Properties.Title=ESB HTTP Gateway
# UDP Listener
@@ -410,19 +385,17 @@
# Actions List
-ESBActions101_AddAction.WindowTitle=Add Action
-ESBActions101_AddAction.Title=ESB Action
+ESB.AddAction.WindowTitle=Add Action
+ESB.AddAction.Title=ESB Action
ESBActions101_Properties.Title=ESB Actions List
-
-ESBActions110_AddAction.WindowTitle=Add Action
-ESBActions110_AddAction.Title=ESB Action
-
ESBActions110_Properties.Title=ESB Actions List
+ESBActions120_Properties.Title=ESB Actions List
# Action
ESBAction101_Properties.Title=ESB Action
+ESBAction120_Properties.Title=ESB Action
# Activation Config
@@ -460,129 +433,72 @@
#Adding specific actions
-ESBActions101_AddByteArrayToString.WindowTitle=Add Byte Array To String
-ESBActions101_AddByteArrayToString.Title=ESB Byte Array To String Converter
+ESB.AddByteArrayToString.WindowTitle=Add Byte Array To String
+ESB.AddByteArrayToString.Title=ESB Byte Array To String Converter
-ESBActions101_AddLongToDate.WindowTitle=Add Long To Date
-ESBActions101_AddLongToDate.Title=ESB Long To Date Converter
+ESB.AddLongToDate.WindowTitle=Add Long To Date
+ESB.AddLongToDate.Title=ESB Long To Date Converter
-ESBActions101_AddObjectToCSVString.WindowTitle=Add Object To CSV String
-ESBActions101_AddObjectToCSVString.Title=ESB Action Object To CSVString Converter
+ESB.AddObjectToCSVString.WindowTitle=Add Object To CSV String
+ESB.AddObjectToCSVString.Title=ESB Action Object To CSVString Converter
-ESBActions101_AddObjectToXStream.WindowTitle=Add Object To XStream
-ESBActions101_AddObjectToXStream.Title=ESB Object To XStream Converter
+ESB.AddObjectToXStream.WindowTitle=Add Object To XStream
+ESB.AddObjectToXStream.Title=ESB Object To XStream Converter
-ESBActions101_AddSmooksAction.WindowTitle=Add Smooks Action
-ESBActions101_AddSmooksAction.Title=ESB Smooks Action
+ESB.AddSmooksAction.WindowTitle=Add Smooks Action
+ESB.AddSmooksAction.Title=ESB Smooks Action
-ESBActions101_AddSmooksTransformer.WindowTitle=Add Smooks Transformer
-ESBActions101_AddSmooksTransformer.Title=ESB Smooks Transformer
+ESB.AddSmooksTransformer.WindowTitle=Add Smooks Transformer
+ESB.AddSmooksTransformer.Title=ESB Smooks Transformer
-ESBActions101_AddMessagePersister.WindowTitle=Add Message Persister
-ESBActions101_AddMessagePersister.Title=ESB Message Persister
+ESB.AddMessagePersister.WindowTitle=Add Message Persister
+ESB.AddMessagePersister.Title=ESB Message Persister
-ESBActions101_AddXStreamToObject.WindowTitle=Add XStream To Object
-ESBActions101_AddXStreamToObject.Title=ESB XStream To Object Converter
+ESB.AddXStreamToObject.WindowTitle=Add XStream To Object
+ESB.AddXStreamToObject.Title=ESB XStream To Object Converter
-ESBActions101_AddAggregator.WindowTitle=Add Aggregator
-ESBActions101_AddAggregator.Title=ESB Aggregator
+ESB.AddAggregator.WindowTitle=Add Aggregator
+ESB.AddAggregator.Title=ESB Aggregator
-ESBActions101_AddContentBasedRouter.WindowTitle=Add Content Based Router
-ESBActions101_AddContentBasedRouter.Title=ESB Content Based Router
+ESB.AddContentBasedRouter.WindowTitle=Add Content Based Router
+ESB.AddContentBasedRouter.Title=ESB Content Based Router
-ESBActions101_AddStaticRouter.WindowTitle=Add Static Router
-ESBActions101_AddStaticRouter.Title=ESB Static Router
+ESB.AddStaticRouter.WindowTitle=Add Static Router
+ESB.AddStaticRouter.Title=ESB Static Router
-ESBActions101_AddStaticWiretap.WindowTitle=Add Static Wiretap
-ESBActions101_AddStaticWiretap.Title=ESB Static Wiretap
+ESB.AddStaticWiretap.WindowTitle=Add Static Wiretap
+ESB.AddStaticWiretap.Title=ESB Static Wiretap
-ESBActions101_AddNotifier.WindowTitle=Add Notifier
-ESBActions101_AddNotifier.Title=ESB Notifier
+ESB.AddNotifier.WindowTitle=Add Notifier
+ESB.AddNotifier.Title=ESB Notifier
-ESBActions101_SOAPProcessor.WindowTitle=Add SOAP Processor
-ESBActions101_SOAPProcessor.Title=SOAP Processor
+ESB.SOAPProcessor.WindowTitle=Add SOAP Processor
+ESB.SOAPProcessor.Title=SOAP Processor
-ESBActions101_SOAPClient.WindowTitle=Add SOAP Client
-ESBActions101_SOAPClient.Title=SOAP Client
+ESB.SOAPClient.WindowTitle=Add SOAP Client
+ESB.SOAPClient.Title=SOAP Client
-ESBActions101_AddObjectInvoke.WindowTitle=Add Object Invoke
-ESBActions101_AddObjectInvoke.Title=ESB Object Invoke
+ESB.SOAPProxy.WindowTitle=Add SOAP Proxy
+ESB.SOAPProxy.Title=SOAP Proxy
-ESBActions101_AddCommandInterpreter.WindowTitle=Add Command Interpreter
-ESBActions101_AddCommandInterpreter.Title=ESB Command Interpreter
+ESB.AddObjectInvoke.WindowTitle=Add Object Invoke
+ESB.AddObjectInvoke.Title=ESB Object Invoke
-ESBActions101_AddGroovyProcessor.WindowTitle=Add Groovy Action Processor
-ESBActions101_AddGroovyProcessor.Title=ESB Groovy Action Processor
+ESB.AddCommandInterpreter.WindowTitle=Add Command Interpreter
+ESB.AddCommandInterpreter.Title=ESB Command Interpreter
-ESBActions101_AddSystemPrintln.WindowTitle=Add System Println
-ESBActions101_AddSystemPrintln.Title=ESB System Println
+ESB.AddGroovyProcessor.WindowTitle=Add Groovy Action Processor
+ESB.AddGroovyProcessor.Title=ESB Groovy Action Processor
-ESBActions101_AddSOAPProcessor.WindowTitle=Add SOAP Processor
-ESBActions101_AddSOAPProcessor.Title=ESB SOAP Processor
+ESB.AddSystemPrintln.WindowTitle=Add System Println
+ESB.AddSystemPrintln.Title=ESB System Println
-ESBActions101_AddSOAPClient.WindowTitle=Add SOAP Client
-ESBActions101_AddSOAPClient.Title=ESB SOAP Client
+ESB.AddSOAPProcessor.WindowTitle=Add SOAP Processor
+ESB.AddSOAPProcessor.Title=ESB SOAP Processor
-ESBActions110_AddByteArrayToString.WindowTitle=Add Byte Array To String
-ESBActions110_AddByteArrayToString.Title=ESB Byte Array To String Converter
+ESB.AddSOAPClient.WindowTitle=Add SOAP Client
+ESB.AddSOAPClient.Title=ESB SOAP Client
-ESBActions110_AddLongToDate.WindowTitle=Add Long To Date
-ESBActions110_AddLongToDate.Title=ESB Long To Date Converter
-
-ESBActions110_AddObjectToCSVString.WindowTitle=Add Object To CSV String
-ESBActions110_AddObjectToCSVString.Title=ESB Action Object To CSVString Converter
-
-ESBActions110_AddObjectToXStream.WindowTitle=Add Object To XStream
-ESBActions110_AddObjectToXStream.Title=ESB Object To XStream Converter
-
-ESBActions110_AddSmooksTransformer.WindowTitle=Add Smooks Transformer
-ESBActions110_AddSmooksTransformer.Title=ESB Smooks Transformer
-
-ESBActions110_AddMessagePersister.WindowTitle=Add Message Persister
-ESBActions110_AddMessagePersister.Title=ESB Message Persister
-
-ESBActions110_AddXStreamToObject.WindowTitle=Add XStream To Object
-ESBActions110_AddXStreamToObject.Title=ESB XStream To Object Converter
-
-ESBActions110_AddAggregator.WindowTitle=Add Aggregator
-ESBActions110_AddAggregator.Title=ESB Aggregator
-
-ESBActions110_AddContentBasedRouter.WindowTitle=Add Content Based Router
-ESBActions110_AddContentBasedRouter.Title=ESB Content Based Router
-
-ESBActions110_AddStaticRouter.WindowTitle=Add Static Router
-ESBActions110_AddStaticRouter.Title=ESB Static Router
-
-ESBActions110_AddStaticWiretap.WindowTitle=Add Static Wiretap
-ESBActions110_AddStaticWiretap.Title=ESB Static Wiretap
-
-ESBActions110_AddNotifier.WindowTitle=Add Notifier
-ESBActions110_AddNotifier.Title=ESB Notifier
-
-ESBActions110_SOAPProcessor.WindowTitle=Add SOAP Processor
-ESBActions110_SOAPProcessor.Title=SOAP Processor
-
-ESBActions110_SOAPClient.WindowTitle=Add SOAP Client
-ESBActions110_SOAPClient.Title=SOAP Client
-
-ESBActions110_AddObjectInvoke.WindowTitle=Add Object Invoke
-ESBActions110_AddObjectInvoke.Title=ESB Object Invoke
-
-ESBActions110_AddCommandInterpreter.WindowTitle=Add Command Interpreter
-ESBActions110_AddCommandInterpreter.Title=ESB Command Interpreter
-
-ESBActions110_AddGroovyProcessor.WindowTitle=Add Groovy Action Processor
-ESBActions110_AddGroovyProcessor.Title=ESB Groovy Action Processor
-
-ESBActions110_AddSystemPrintln.WindowTitle=Add System Println
-ESBActions110_AddSystemPrintln.Title=ESB System Println
-
-ESBActions110_AddSOAPProcessor.WindowTitle=Add SOAP Processor
-ESBActions110_AddSOAPProcessor.Title=ESB SOAP Processor
-
-ESBActions110_AddSOAPClient.WindowTitle=Add SOAP Client
-ESBActions110_AddSOAPClient.Title=ESB SOAP Client
-
ESBPreActionAggregator101_Properties.Title=Aggregator
ESBPreActionByteArrayToString101_Properties.Title=Byte Array to String
ESBPreActionCommandInterpreter101_Properties.Title=Command Interpreter
@@ -596,6 +512,7 @@
ESBPreActionObjectToXStream101_Properties.Title=Object to XStream
ESBPreActionSOAPClient101_Properties.Title=SOAP Client
ESBPreActionSOAPProcessor101_Properties.Title=SOAP Processor
+ESBPreActionSOAPProxy120_Properties.Title=SOAP Proxy
ESBPreActionSmooksTransformer101_Properties.Title=Smooks Transformer
ESBPreActionStaticRouter101_Properties.Title=Static Router
ESBPreActionStaticWiretap101_Properties.Title=Static Wiretap
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-11-19 12:45:37 UTC (rev 18741)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-11-19 13:52:04 UTC (rev 18742)
@@ -7,6 +7,31 @@
<MAPPING name="AnyElementPresentation">
<PAIR name="route-to,object-path" value="org.jboss.tools.esb.core.model.ESBAnyElementPresentation"/>
</MAPPING>
+ <MAPPING name="ESBSpecificActions">
+ <PAIR name="org.jboss.soa.esb.actions.Aggregator" value="ESBPreActionAggregator"/>
+ <PAIR name="org.jboss.soa.esb.actions.BusinessRulesProcessor" value="ESBPreActionBusinessRulesProcessor"/>
+ <PAIR name="org.jboss.soa.esb.actions.ContentBasedRouter" value="ESBPreActionContentBasedRouter"/>
+ <PAIR name="org.jboss.soa.esb.actions.MessagePersister" value="ESBPreActionMessagePersister"/>
+ <PAIR name="org.jboss.soa.esb.actions.Notifier" value="ESBPreActionNotifier"/>
+ <PAIR name="org.jboss.soa.esb.actions.StaticRouter" value="ESBPreActionStaticRouter"/>
+ <PAIR name="org.jboss.soa.esb.actions.StaticWiretap" value="ESBPreActionStaticWiretap"/>
+ <PAIR name="org.jboss.soa.esb.actions.SystemPrintln" value="ESBPreActionSystemPrintln"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.ByteArrayToString" value="ESBPreActionByteArrayToString"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.LongToDateConverter" value="ESBPreActionLongToDateConverter"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.ObjectInvoke" value="ESBPreActionObjectInvoke"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.ObjectToCSVString" value="ESBPreActionObjectToCSVString"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.ObjectToXStream" value="ESBPreActionObjectToXStream"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.SmooksTransformer" value="ESBPreActionSmooksTransformer"/>
+ <PAIR name="org.jboss.soa.esb.actions.converters.XStreamToObject" value="ESBPreActionXStreamToObject"/>
+ <PAIR name="org.jboss.soa.esb.actions.jbpm.CommandInterpreter" value="ESBPreActionCommandInterpreter"/>
+ <PAIR
+ name="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor" value="ESBPreActionGroovyProcessor"/>
+ <PAIR name="org.jboss.soa.esb.actions.soap.SOAPClient" value="ESBPreActionSOAPClient"/>
+ <PAIR name="org.jboss.soa.esb.actions.soap.SOAPProcessor" value="ESBPreActionSOAPProcessor"/>
+ <PAIR name="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy" value="ESBPreActionSOAPProxy"/>
+ <PAIR name="org.jboss.soa.esb.actions.transformation.xslt.XslAction" value="ESBPreActionXSLTAction"/>
+ <PAIR name="org.jboss.soa.esb.smooks.SmooksAction" value="ESBPreActionSmooksAction"/>
+ </MAPPING>
<MAPPING name="FileVersions">
<PAIR name="ESB1.0.1" value="FileESB101"/>
</MAPPING>
@@ -114,7 +139,14 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
- name="rule set" xmlname="ruleSet"/>
+ name="rule set" xmlname="ruleSet">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=drl"/>
+ <value name="linkAction=OpenRuleSet"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=general;pre=true"
name="rule language" xmlname="ruleLanguage"/>
<XModelAttribute PROPERTIES="pre=true;category=general"
@@ -147,6 +179,10 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open;attribute=rule set"
+ displayName="Open Rule Set" kind="action" name="OpenRuleSet"/>
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
@@ -267,7 +303,14 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
- name="rule set" xmlname="ruleSet"/>
+ name="rule set" xmlname="ruleSet">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=drl,properties"/>
+ <value name="linkAction=OpenRuleSet"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=general;pre=true;save=always"
name="rule language" xmlname="ruleLanguage"/>
<XModelAttribute PROPERTIES="pre=true;category=general"
@@ -291,6 +334,10 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open;attribute=rule set"
+ displayName="Open Rule Set" kind="action" name="OpenRuleSet"/>
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
@@ -332,7 +379,14 @@
name="class" xmlname="class">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="pre=true;category=general" name="script" xmlname="script"/>
+ <XModelAttribute PROPERTIES="pre=true;category=general" name="script" xmlname="script">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=groovy"/>
+ <value name="linkAction=OpenScript"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
<Editor name="Uneditable"/>
</XModelAttribute>
@@ -341,6 +395,10 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open;attribute=script"
+ displayName="Open Script" kind="action" name="OpenScript"/>
<XActionItem kind="list" name="CreateActions"/>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
@@ -1053,6 +1111,86 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ XMLSUBPATH="action" name="ESBPreActionXSLTAction120">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="xslt action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.transformation.xslt.XslAction"
+ name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;save=always;pre=true"
+ name="template file" xmlname="templateFile">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=xsl"/>
+ <value name="linkAction=OpenTemplateFile"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced;pre=true"
+ name="get payload location" xmlname="get-payload-location"/>
+ <XModelAttribute PROPERTIES="category=advanced;pre=true"
+ name="set payload location" xmlname="set-payload-location"/>
+ <XModelAttribute PROPERTIES="category=advanced;pre=true"
+ name="result type" xmlname="resultType">
+ <Constraint loader="ListString">
+ <value/>
+ <value name="STRING"/>
+ <value name="BYTES"/>
+ <value name="DOM"/>
+ <value name="SAX"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;pre=true"
+ name="fail on warning" xmlname="failOnWarning">
+ <Constraint loader="ListString">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced;pre=true"
+ name="uri resolver" xmlname="uriResolver">
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty"
+ PROPERTIES="actionpath=Open;attribute=template file"
+ displayName="Open Template File" kind="action" name="OpenTemplateFile"/>
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
XMLSUBPATH="action" name="ESBPreActionXStreamToObject101">
<XChildrenEntities>
@@ -1633,13 +1771,34 @@
<XChildEntity name="ESBPreActionSystemPrintln101"/>
<XChildEntity name="ESBPreActionNotifier101"/>
<XChildEntity name="ESBPreActionBusinessRulesProcessor101"/>
+ <XChildEntity name="ESBPreActionXSLTAction120"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
kind="list" name="CreateActions">
<XActionItem displayName="Add Pre-Packed Action" kind="list" name="PrePackedAction">
<XActionItemReference entity="ESBActions101" name="AddObjectInvoke"/>
- <XActionItemReference entity="ESBActions101" name="Converters"/>
+ <XActionItem displayName="Converters" kind="list" name="Converters">
+ <XActionItemReference entity="ESBActions101" name="AddByteArrayToString"/>
+ <XActionItemReference entity="ESBActions101" name="AddLongToDate"/>
+ <XActionItemReference entity="ESBActions101" name="AddObjectToCSVString"/>
+ <XActionItemReference entity="ESBActions101" name="AddObjectToXStream"/>
+ <XActionItemReference entity="ESBActions101" name="AddSmooksAction"/>
+ <XActionItemReference entity="ESBActions101" name="AddSmooksTransformer"/>
+ <XActionItemReference entity="ESBActions101" name="AddMessagePersister"/>
+ <XActionItemReference entity="ESBActions101" name="AddXStreamToObject"/>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="XSLT Action..." kind="action" name="AddXSLTAction">
+ <EntityData EntityName="ESBPreActionXSLTAction120">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="template file"/>
+ <AttributeData AttributeName="get payload location" Mandatory="no"/>
+ <AttributeData AttributeName="set payload location" Mandatory="no"/>
+ <AttributeData AttributeName="result type" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItemReference entity="ESBActions101" name="AddCommandInterpreter"/>
<XActionItemReference entity="ESBActions101" name="AddGroovyProcessor"/>
<XActionItemReference entity="ESBActions101" name="Routers"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2009-11-19 12:45:37 UTC (rev 18741)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2009-11-19 13:52:04 UTC (rev 18742)
@@ -15,10 +15,12 @@
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XChild;
+import org.jboss.tools.common.meta.XMapping;
import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.impl.RegularObjectImpl;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.esb.core.ESBCorePlugin;
import org.jboss.tools.esb.core.model.converters.AliasConverter;
@@ -30,68 +32,23 @@
* @author Viacheslav Kabanovich
*/
public class SpecificActionLoader implements ESBConstants {
-
static final String ACTION_ENTITY = "ESBAction";
static final String ACTIONS_FOLDER_ENTITY = "ESBActions";
- /**
- * Version suffix should be added to entity name
- */
- static final String[][] SPECIFIC_ACTIONS = {
- {"org.jboss.soa.esb.actions.converters.ByteArrayToString", "ESBPreActionByteArrayToString"},
- //encoding
- {"org.jboss.soa.esb.actions.converters.LongToDateConverter", "ESBPreActionLongToDateConverter"},
- //-
- {"org.jboss.soa.esb.actions.converters.ObjectInvoke", "ESBPreActionObjectInvoke"},
- //class-processor, class-method
- {"org.jboss.soa.esb.actions.converters.ObjectToCSVString", "ESBPreActionObjectToCSVString"},
- //bean-properties, fail-on-missing-property
- {"org.jboss.soa.esb.actions.converters.ObjectToXStream", "ESBPreActionObjectToXStream"},
- //class-alias, exclude-package
- {"org.jboss.soa.esb.actions.converters.SmooksTransformer", "ESBPreActionSmooksTransformer"},
- //resource-config; from, from-type, to, to-type
- {"org.jboss.soa.esb.smooks.SmooksAction", "ESBPreActionSmooksAction"},
- //smooksConfig
- {"org.jboss.soa.esb.actions.MessagePersister", "ESBPreActionMessagePersister"},
- //classification, message-store-class
- {"org.jboss.soa.esb.actions.converters.XStreamToObject", "ESBPreActionXStreamToObject"},
- //class-alias, exclude-package, incoming-type, root-node, aliases
- {"org.jboss.soa.esb.actions.jbpm.CommandInterpreter", "ESBPreActionCommandInterpreter"},
- //
- {"org.jboss.soa.esb.actions.scripting.GroovyActionProcessor", "ESBPreActionGroovyProcessor"},
- //script
- {"org.jboss.soa.esb.actions.Aggregator", "ESBPreActionAggregator"},
- //timeoutInMillies
- {"org.jboss.soa.esb.actions.ContentBasedRouter", "ESBPreActionContentBasedRouter"},
- //ruleSet, ruleLanguage, ruleReload, destinations!
- {"org.jboss.soa.esb.actions.StaticRouter", "ESBPreActionStaticRouter"},
- //destinations!
- {"org.jboss.soa.esb.actions.StaticWiretap", "ESBPreActionStaticWiretap"},
- //destinations!
- {"org.jboss.soa.esb.actions.Notifier", "ESBPreActionNotifier"},
- //destinations! NotificationList/target ...
- {"org.jboss.soa.esb.actions.soap.SOAPProcessor", "ESBPreActionSOAPProcessor"},
- //jbossws-endpoint
- {"org.jboss.soa.esb.actions.soap.SOAPClient", "ESBPreActionSOAPClient"},
- //wsdl, operation +other
- {"org.jboss.soa.esb.actions.SystemPrintln", "ESBPreActionSystemPrintln"},
- //message, printfull, outputstream
- {"org.jboss.soa.esb.actions.BusinessRulesProcessor", "ESBPreActionBusinessRulesProcessor"},
- //ruleSet, ruleLanguage, ruleReload, object-paths!
- {"org.jboss.soa.esb.actions.soap.proxy.SOAPProxy", "ESBPreActionSOAPProxy"},
- //wsdl, file, endpointUrl
- };
+ private static Map<String,String> classToEntity = new HashMap<String, String>();
public static final SpecificActionLoader instance = new SpecificActionLoader();
- Map<String,String> classToEntity = new HashMap<String, String>();
- Map<String,String> entityToClass = new HashMap<String, String>();
-
SpecificActionLoader() {
- for (int i = 0; i < SPECIFIC_ACTIONS.length; i++) {
- String[] action = SPECIFIC_ACTIONS[i];
- classToEntity.put(action[0], action[1]);
- entityToClass.put(action[1], action[0]);
+ if(classToEntity.isEmpty()) {
+ XMapping m = PreferenceModelUtilities.getPreferenceModel().getMetaData().getMapping("ESBSpecificActions");
+ if(m != null) {
+ String[] classes = m.getKeys();
+ for (String c: classes) {
+ String entity = m.getValue(c);
+ classToEntity.put(c, entity);
+ }
+ }
}
}
@@ -124,12 +81,7 @@
XModelObject[] as = actions.getChildren();
for (int i = 0; i < as.length; i++) {
- String cls = as[i].getAttributeValue("class");
- if(cls == null) continue;
- String entityName = classToEntity.get(cls);
- if(entityName == null) continue;
- entityName = addSuffix(entityName, actions);
- XModelObject action = convertBasicActionToSpecific(as[i], entityName);
+ XModelObject action = convertBasicActionToSpecific(actions, as[i]);
if(action != null) {
as[i] = action;
modified = true;
@@ -141,6 +93,15 @@
}
+ public XModelObject convertBasicActionToSpecific(XModelObject actions, XModelObject basic) {
+ String cls = basic.getAttributeValue("class");
+ if(cls == null) return null;
+ String entityName = classToEntity.get(cls);
+ if(entityName == null) return null;
+ entityName = addSuffix(entityName, actions);
+ return convertBasicActionToSpecific(basic, entityName);
+ }
+
public XModelObject convertBasicActionToSpecific(XModelObject basic, String entityName) {
XModelEntity entity = basic.getModelEntity().getMetaModel().getEntity(entityName);
if(entity == null) return null;;
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddGenericActionSupport.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddGenericActionSupport.java 2009-11-19 12:45:37 UTC (rev 18741)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddGenericActionSupport.java 2009-11-19 13:52:04 UTC (rev 18742)
@@ -1,6 +1,13 @@
package org.jboss.tools.esb.core.model.handlers;
+import java.util.Properties;
+
+import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateSupport;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+import org.jboss.tools.esb.core.model.SpecificActionLoader;
public class AddGenericActionSupport extends DefaultCreateSupport {
@@ -8,4 +15,12 @@
return "org.jboss.tools.esb.ui.wizard.AddGenericActionStep"; //$NON-NLS-1$
}
+ protected void finish() throws XModelException {
+ String entity = getEntityName();
+ Properties p = extractStepData(0);
+ XModelObject c = XModelObjectLoaderUtil.createValidObject(getTarget().getModel(), entity, p);
+ XModelObject action = SpecificActionLoader.instance.convertBasicActionToSpecific(getTarget(), c);
+ if(action == null) action = c;
+ DefaultCreateHandler.addCreatedObject(getTarget(), action, getProperties());
+ }
}
15 years, 1 month
JBoss Tools SVN: r18741 - in trunk/seam: tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-19 07:45:37 -0500 (Thu, 19 Nov 2009)
New Revision: 18741
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5230
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-11-19 04:58:20 UTC (rev 18740)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-11-19 12:45:37 UTC (rev 18741)
@@ -75,7 +75,8 @@
.include("stringtemplate.*\\.jar") //$NON-NLS-1$
.include("mvel.*\\.jar") //$NON-NLS-1$
.include("jboss-el.jar") //$NON-NLS-1$
- .include("jxl\\.jar"); //$NON-NLS-1$
+ .include("jxl\\.jar") //$NON-NLS-1$
+ .include("itext.*\\.jar"); //$NON-NLS-1$
public static final AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new AntCopyUtils.FileSet()
.include("richfaces-impl\\.jar") //$NON-NLS-1$
@@ -89,6 +90,7 @@
.include("jboss-seam-ui\\.jar") //$NON-NLS-1$
.include("jboss-seam-excel\\.jar") //$NON-NLS-1$
.include("jxl\\.jar") //$NON-NLS-1$
+ .include("itext.*\\.jar") //$NON-NLS-1$
.include("jsf-facelets\\.jar"); //$NON-NLS-1$
public static String DROOLS_LIB_SEAM_RELATED_PATH = "lib"; //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2009-11-19 04:58:20 UTC (rev 18740)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2009-11-19 12:45:37 UTC (rev 18741)
@@ -86,8 +86,10 @@
.include("oscache.*\\.jar") //$NON-NLS-1$
.include("stringtemplate.*\\.jar") //$NON-NLS-1$
// el-ri needed for JBIDE-939
- .include("el-ri.*\\.jar"); //$NON-NLS-1$
+ .include("el-ri.*\\.jar") //$NON-NLS-1$
+ .include("itext.*\\.jar"); //$NON-NLS-1$
+
public static final AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new AntCopyUtils.FileSet()
.include("ajax4jsf.*\\.jar") //$NON-NLS-1$
.include("richfaces.*\\.jar") //$NON-NLS-1$
@@ -101,8 +103,10 @@
.include("jboss-seam-remoting\\.jar") //$NON-NLS-1$
.include("jboss-seam-ui\\.jar") //$NON-NLS-1$
.include("jsf-facelets\\.jar") //$NON-NLS-1$
- .include("oscache.*\\.jar"); //$NON-NLS-1$
+ .include("oscache.*\\.jar") //$NON-NLS-1$
+ .include("itext.*\\.jar"); //$NON-NLS-1$
+
private static final String ORG_AJAX4JSF_FILTER_NAME = "ajax4jsf";
private static final String ORG_AJAX4JSF_FILTER_CLASS = "org.ajax4jsf.Filter";
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2009-11-19 04:58:20 UTC (rev 18740)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2009-11-19 12:45:37 UTC (rev 18741)
@@ -139,6 +139,7 @@
seamgenlibs.add("richfaces-api.jar");
seamgenlibs.add("richfaces-impl.jar");
seamgenlibs.add("richfaces-ui.jar");
+ seamgenlibs.add("itext.jar");
final IContainer warLibs = (IContainer) warProject.getProject().findMember("WebContent/WEB-INF/lib").getAdapter(IContainer.class);
assertOnlyContainsTheseFiles(seamgenlibs, warLibs);
@@ -195,6 +196,7 @@
onlyInWar.add("jsf-facelets.jar");
onlyInWar.add("richfaces-impl.jar");
onlyInWar.add("richfaces-ui.jar");
+ onlyInWar.add("itext.jar");
final IContainer earLibsSeam = (IContainer) ear.findMember(new Path("EarContent")).getAdapter(IContainer.class);
@@ -363,4 +365,4 @@
protected IProjectFacetVersion getSeamFacetVersion() {
return seam2FacetVersion;
}
-}
+}
\ No newline at end of file
15 years, 1 month
JBoss Tools SVN: r18740 - in trunk/bpel/plugins/org.jboss.tools.bpel.runtimes: .settings and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-11-18 23:58:20 -0500 (Wed, 18 Nov 2009)
New Revision: 18740
Added:
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleActionProvider.java
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleContentProvider.java
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleLabelProvider.java
Modified:
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/META-INF/MANIFEST.MF
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml
Log:
JBIDE-4864:BPEL Process Versioning
Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs 2009-11-18 22:57:30 UTC (rev 18739)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs 2009-11-19 04:58:20 UTC (rev 18740)
@@ -1,7 +1,8 @@
-#Mon Oct 23 11:56:22 PDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+#Tue Oct 20 16:01:25 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/META-INF/MANIFEST.MF 2009-11-18 22:57:30 UTC (rev 18739)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/META-INF/MANIFEST.MF 2009-11-19 04:58:20 UTC (rev 18740)
@@ -5,26 +5,31 @@
Bundle-Version: 0.4.0.qualifier
Bundle-Activator: org.jboss.tools.bpel.runtimes.RuntimesPlugin
Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.server.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.web.ui;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.jst.server.generic.core;bundle-version="[1.0.305,2.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.bpel.model;bundle-version="0.4.0",
- org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.wst.wsdl;bundle-version="[1.1.200,2.0.0)",
- javax.wsdl;bundle-version="[1.5.0,1.6.0)",
- org.eclipse.jst.common.frameworks;bundle-version="1.1.300",
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0",
- org.eclipse.wst.web;bundle-version="1.1.300"
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.web.ui,
+ org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks.ui,
+ org.eclipse.jst.server.generic.core,
+ org.eclipse.jem.util,
+ org.eclipse.debug.ui,
+ org.eclipse.bpel.model,
+ org.eclipse.emf.ecore,
+ org.eclipse.wst.wsdl,
+ javax.wsdl,
+ org.eclipse.jst.common.frameworks,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.web,
+ org.jboss.ide.eclipse.as.core;resolution:=optional,
+ org.jboss.ide.eclipse.archives.webtools;resolution:=optional,
+ org.jboss.tools.jmx.core;resolution:=optional,
+ org.eclipse.wst.server.ui;resolution:=optional,
+ org.eclipse.ui.navigator
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.bpel.runtimes,
org.jboss.tools.bpel.runtimes.facets,
Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml 2009-11-18 22:57:30 UTC (rev 18739)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml 2009-11-19 04:58:20 UTC (rev 18740)
@@ -167,7 +167,15 @@
adaptableType="org.eclipse.core.resources.IFile">
<adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
</factory>
- </extension>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishers">
+ <publisher
+ class="org.jboss.tools.bpel.runtimes.module.JBTBPELPublisher"
+ priority="10"
+ zipDelegate="false">
+ </publisher>
+ </extension>
<!--=========================================================================-->
<!-- TO MAKE PROCESSES ACTUALLY LAUNCHABLE VIA RUN ON SERVER -->
@@ -187,5 +195,62 @@
<!-- -->
<!--=========================================================================-->
-
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ id="org.jboss.tools.bpel.runtimes.ui.view.server.content"
+ activeByDefault="true"
+ contentProvider="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleContentProvider"
+ icon="icons/obj16/bpelfacet.gif"
+ labelProvider="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleLabelProvider"
+ name="BPEL Modules"
+ priority="highest">
+ <triggerPoints>
+ <instanceof
+ value="java.lang.Object">
+ </instanceof>
+ </triggerPoints>
+ <possibleChildren>
+ <instanceof
+ value="java.lang.Object">
+ </instanceof>
+ </possibleChildren>
+ <actionProvider
+ class="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleActionProvider"
+ id="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleActionProvider"
+ priority="highest">
+ <enablement>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.core.resources.IWorkspaceRoot">
+ </instanceof>
+ <adapt type="java.util.Collection">
+ <count value="0"/>
+ </adapt>
+ <instanceof
+ value="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleContentProvider$BPELVersionDeployment">
+ </instanceof>
+ </or>
+ </enablement>
+ </actionProvider>
+ </navigatorContent>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.wst.server.ui.ServersView">
+ <includes>
+ <contentExtension
+ isRoot="true"
+ pattern="org.jboss.tools.bpel.runtimes.ui.view.server.content">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
</plugin>
Added: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java (rev 0)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java 2009-11-19 04:58:20 UTC (rev 18740)
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.bpel.runtimes.module;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.tools.bpel.runtimes.IBPELModuleFacetConstants;
+import org.jboss.tools.jmx.core.IMemento;
+import org.jboss.tools.jmx.core.util.XMLMemento;
+
+/**
+ * This class allows you to publish a BPEL module specifically
+ * to a JBossTools server entity.
+ * @author rob.stryker(a)jboss.com
+ *
+ */
+public class JBTBPELPublisher implements IJBossServerPublisher {
+ private IServer server;
+ private int publishState = IServer.PUBLISH_STATE_INCREMENTAL;
+ public JBTBPELPublisher() {
+ }
+
+ public int getPublishState() {
+ return publishState;
+ }
+
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method)
+ && module != null && module.length > 0
+ && module[module.length-1] != null
+ && module[module.length-1].getModuleType().getId().equals(IBPELModuleFacetConstants.BPEL_MODULE_TYPE))
+ return true;
+ return false;
+ }
+
+ public IStatus publishModule(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+
+ this.server = server;
+ IModule last = module[module.length-1];
+ IStatus status = null;
+ if(publishType == REMOVE_PUBLISH){
+ removeAll(server, last.getProject());
+ } else if( publishType == FULL_PUBLISH ){
+ // Publish a new version forced
+ status = publish(module, delta, publishType, monitor);
+ publishState = IServer.PUBLISH_STATE_NONE;
+ } else if( publishType == INCREMENTAL_PUBLISH ) {
+ // Do nothing. This is intentional
+ publishState = IServer.PUBLISH_STATE_INCREMENTAL;
+ }
+ return status == null ? Status.OK_STATUS : status;
+ }
+
+
+ protected IStatus publish(IModule[] moduleTree,
+ IModuleResourceDelta[] delta, int publishType, IProgressMonitor monitor) throws CoreException {
+ ArrayList<IStatus> resultList = new ArrayList<IStatus>();
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ IModule last = moduleTree[moduleTree.length -1];
+ IPath deployPath = getDeployPath(moduleTree, ds);
+ IPath tempDeployPath = PublishUtil.getTempDeployFolder(moduleTree, ds);
+ IModuleResource[] members = PublishUtil.getResources(last);
+ if( shouldZip() ) {
+ String deployRoot = PublishUtil.getDeployRootFolder(
+ moduleTree, ds, ds.getDeployFolder(),
+ IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ BPELZippedPublisherUtil util = new BPELZippedPublisherUtil(deployPath);
+ IStatus ret = util.publishModule(server, deployRoot, moduleTree, publishType, delta, monitor);
+ resultList.add(ret);
+ } else {
+ LocalCopyCallback handler = new LocalCopyCallback(server, deployPath, tempDeployPath);
+ PublishCopyUtil util = new PublishCopyUtil(handler);
+ resultList.addAll(Arrays.asList(util.publishFull(members, monitor)));
+ }
+ addDeployedPathToDescriptor(server, last.getProject(), deployPath); // persist it
+ pruneList(resultList);
+ if( resultList.size() > 0 ) {
+ MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL,
+ NLS.bind(Messages.FullPublishFail, last.getName()), null);
+ for( int i = 0; i < resultList.size(); i++ )
+ ms.add(resultList.get(i));
+ return ms;
+ }
+ return Status.OK_STATUS;
+ }
+
+ // Prune out ok status
+ protected void pruneList(ArrayList<IStatus> list) {
+ Iterator<IStatus> i = list.iterator();
+ while(i.hasNext()) {
+ if( i.next().isOK())
+ i.remove();
+ }
+ }
+
+ protected boolean shouldZip() {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return ds == null || ds.zipsWTPDeployments();
+ }
+
+ public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ IPath path = PublishUtil.getDeployPath(moduleTree, server);
+ path = path.removeLastSegments(1).append(getNewLastSegment(moduleTree));
+ return path;
+ }
+
+ public static String getNewLastSegment(IModule[] moduleTree) {
+ IModule last = moduleTree[moduleTree.length-1];
+ long stamp = new Date().getTime();
+ return last.getName() + "-" + stamp + IWTPConstants.EXT_JAR;
+ }
+
+ private static final String DEPLOYMENTS = "deployments";
+ private static final String PROJECT = "project";
+ private static final String NAME = "name";
+ private static final String VERSION = "version";
+
+ protected static void save(IServer server, XMLMemento memento) {
+ try {
+ memento.save(new FileOutputStream(getDeployDetailsFile(server)));
+ } catch( IOException ioe) {
+ // TODO LOG
+ }
+ }
+
+ public static void removeAll(IServer server, IProject project) {
+ String[] paths = getDeployedPathsFromDescriptor(server, project);
+ for( int i = 0; i < paths.length; i++ ) {
+ // remove them all, with full force!!! >=[
+ FileUtil.safeDelete(new File(paths[i]));
+ }
+ removeProjectFromDescriptor(server, project);
+ }
+
+ public static void removeVersion(IServer server, IProject project, String path) {
+ // delete file
+ FileUtil.safeDelete(new File(path));
+ // remove from descriptor
+ removeVersionFromDescriptor(server, project, path);
+ }
+
+ public static void removeVersionFromDescriptor(IServer server, IProject project, String path) {
+ File f = getDeployDetailsFile(server);
+ XMLMemento memento = null;
+ try {
+ memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME)) ) {
+ IMemento[] versions = projects[i].getChildren(VERSION);
+ for( int j = 0; j < versions.length; j++ ) {
+ if( ((XMLMemento)versions[j]).getTextData().equals(path)) {
+ ((XMLMemento)projects[i]).removeChild((XMLMemento)versions[j]);
+ }
+ }
+ }
+ }
+ save(server, memento);
+ } catch( FileNotFoundException fnfe) {}
+ }
+
+ public static void removeProjectFromDescriptor(IServer server, IProject project) {
+ File f = getDeployDetailsFile(server);
+ XMLMemento memento = null;
+ try {
+ memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME)) ) {
+ memento.removeChild((XMLMemento)projects[i]);
+ }
+ }
+ save(server, memento);
+ } catch( FileNotFoundException fnfe) {}
+ }
+
+ public static void addDeployedPathToDescriptor(IServer server, IProject project, IPath path) {
+ File f = getDeployDetailsFile(server);
+ XMLMemento memento = null;
+ try {
+ memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ } catch( FileNotFoundException fnfe) {}
+
+ if( memento == null )
+ memento = XMLMemento.createWriteRoot(DEPLOYMENTS);
+
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ boolean projectFound = false;
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME))) {
+ projectFound = true;
+ XMLMemento child = (XMLMemento)projects[i].createChild(VERSION);
+ child.putTextData(path.toOSString());
+ }
+ }
+ if( !projectFound ) {
+ XMLMemento proj = (XMLMemento)memento.createChild(PROJECT);
+ proj.putString(NAME, project.getName());
+ XMLMemento child = (XMLMemento)proj.createChild(VERSION);
+ child.putTextData(path.toOSString());
+ }
+ save(server, memento);
+ }
+
+ public static String[] getDeployedPathsFromDescriptor(IServer server, IProject project) {
+ File f = getDeployDetailsFile(server);
+ ArrayList<String> list = new ArrayList<String>();
+ if( f.exists() ) {
+ try {
+ XMLMemento memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME))) {
+ IMemento[] deployments = projects[i].getChildren(VERSION);
+ for( int j = 0; j < deployments.length; j++ ) {
+ String s = ((XMLMemento)deployments[j]).getTextData();
+ if( s != null && !s.equals(""))
+ list.add(s);
+ }
+ break;
+ }
+ }
+ } catch( FileNotFoundException fnfe) {}
+ }
+ return (String[]) list.toArray(new String[list.size()]);
+ }
+
+ public static File getDeployDetailsFile(IServer server) {
+ return JBossServerCorePlugin.getServerStateLocation(server)
+ .append("bpel.deployment.versions").toFile();
+ }
+
+ public static class BPELZippedPublisherUtil extends LocalZippedPublisherUtil {
+ private IPath deployPath;
+ public BPELZippedPublisherUtil(IPath deployPath) {
+ this.deployPath = deployPath;
+ }
+ public IPath getOutputFilePath() {
+ return deployPath;
+ }
+ }
+}
Added: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleActionProvider.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleActionProvider.java (rev 0)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleActionProvider.java 2009-11-19 04:58:20 UTC (rev 18740)
@@ -0,0 +1,103 @@
+package org.jboss.tools.bpel.runtimes.ui.view.server;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.jboss.tools.bpel.runtimes.module.JBTBPELPublisher;
+import org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleContentProvider.BPELVersionDeployment;
+
+public class BPELModuleActionProvider extends CommonActionProvider {
+
+ private ICommonActionExtensionSite actionSite;
+ private Action undeployVersionAction;
+ private IStructuredSelection lastSelection;
+ public BPELModuleActionProvider() {
+ super();
+ }
+
+ public void dispose() {
+ super.dispose();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ createActions(aSite);
+ }
+
+ protected void createActions(ICommonActionExtensionSite aSite) {
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ undeployVersionAction = new Action() {
+ public void run() {
+ runUndeployVersion();
+ refreshViewer(getLastServer());
+ }
+ };
+ undeployVersionAction.setText("Undeploy Version");
+ undeployVersionAction.setDescription("Undeploy this version of the module");
+ //undeployVersionAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.PUBLISH_IMAGE));
+ }
+ }
+ }
+
+ protected void runUndeployVersion() {
+ Object firstSel = lastSelection.getFirstElement();
+ if( firstSel instanceof BPELVersionDeployment ) {
+ BPELVersionDeployment deployment = (BPELVersionDeployment)firstSel;
+ JBTBPELPublisher.removeVersion(deployment.getModuleServer().server,
+ deployment.getProject(), deployment.getPath());
+ }
+ }
+
+ protected IServer getLastServer() {
+ Object firstSel = lastSelection.getFirstElement();
+ if( firstSel instanceof IServer )
+ return (IServer)firstSel;
+ if( firstSel instanceof ModuleServer )
+ return ((ModuleServer)firstSel).getServer();
+ if( firstSel instanceof BPELVersionDeployment )
+ return ((BPELVersionDeployment)firstSel).getModuleServer().getServer();
+ return null;
+ }
+
+ protected void refreshViewer(Object o) {
+ actionSite.getStructuredViewer().refresh(o);
+ }
+
+
+ public void fillContextMenu(IMenuManager menu) {
+ lastSelection = getSelection();
+ if( lastSelection.size() == 1 ) {
+ Object sel = lastSelection.getFirstElement();
+ if( sel instanceof BPELVersionDeployment )
+ menu.add(undeployVersionAction);
+ }
+ }
+
+ public IStructuredSelection getSelection() {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider()
+ .getSelection();
+ return selection;
+ }
+ return new StructuredSelection();
+ }
+
+}
Added: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleContentProvider.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleContentProvider.java (rev 0)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleContentProvider.java 2009-11-19 04:58:20 UTC (rev 18740)
@@ -0,0 +1,75 @@
+package org.jboss.tools.bpel.runtimes.ui.view.server;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.jboss.tools.bpel.runtimes.IBPELModuleFacetConstants;
+import org.jboss.tools.bpel.runtimes.module.JBTBPELPublisher;
+
+public class BPELModuleContentProvider implements ITreeContentProvider {
+ public BPELModuleContentProvider() {
+ }
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof ModuleServer ) {
+ IServer s = ((ModuleServer)parentElement).server;
+ IModule[] module = ((ModuleServer)parentElement).module;
+ IModule mod = module.length > 0 ? module[module.length-1] : null;
+ String typeId = mod.getModuleType().getId();
+ if( mod != null && typeId.equals(IBPELModuleFacetConstants.BPEL_MODULE_TYPE)) {
+ // we have a bpel module deployed to a server. List the children
+ String[] versions = JBTBPELPublisher.getDeployedPathsFromDescriptor(s, mod.getProject());
+ return wrap((ModuleServer)parentElement, versions);
+ }
+ }
+ return new Object[]{};
+ }
+
+ protected BPELVersionDeployment[] wrap(ModuleServer ms, String[] vals) {
+ BPELVersionDeployment[] versions = new BPELVersionDeployment[vals.length];
+ for( int i = 0; i < vals.length; i++ ) {
+ versions[i] = new BPELVersionDeployment(ms, vals[i]);
+ }
+ return versions;
+ }
+
+ public static class BPELVersionDeployment {
+ private String path;
+ private ModuleServer ms;
+ public BPELVersionDeployment(ModuleServer ms, String path) {
+ this.path = path;
+ this.ms = ms;
+ }
+ public String getPath() { return path; }
+ public ModuleServer getModuleServer() { return ms; }
+ public IProject getProject() {
+ if( ms.module != null && ms.module.length > 0 )
+ return ms.module[ms.module.length-1].getProject();
+ return null;
+ }
+ }
+
+ public Object getParent(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleLabelProvider.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleLabelProvider.java (rev 0)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/ui/view/server/BPELModuleLabelProvider.java 2009-11-19 04:58:20 UTC (rev 18740)
@@ -0,0 +1,20 @@
+package org.jboss.tools.bpel.runtimes.ui.view.server;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleContentProvider.BPELVersionDeployment;
+
+public class BPELModuleLabelProvider extends LabelProvider {
+ public Image getImage(Object element) {
+ // TODO Add an icon
+ return null;
+ }
+
+ public String getText(Object element) {
+ if( element instanceof BPELVersionDeployment ) {
+ return new Path(((BPELVersionDeployment)element).getPath()).lastSegment();
+ }
+ return element == null ? "" : element.toString();//$NON-NLS-1$
+ }
+}
15 years, 1 month
JBoss Tools SVN: r18739 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: graphical/editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2009-11-18 17:57:30 -0500 (Wed, 18 Nov 2009)
New Revision: 18739
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java
Log:
Fixes for JIRAs: JBIDE-5202, JBIDE-5214, JBIDE-5216, and JBIDE-5220. This adjusts some of the labels to improve readability, removes the Input page and moves its contents to the Process page when you select an Input task, and moves the Overview page to become the Options page with scaled back options.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-18 15:58:52 UTC (rev 18738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-18 22:57:30 UTC (rev 18739)
@@ -10,21 +10,21 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.util.List;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
@@ -41,6 +41,7 @@
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -53,9 +54,6 @@
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.events.HyperlinkAdapter;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.ScrolledPageBook;
@@ -115,6 +113,11 @@
private Text smooksNameText;
private Text smooksAuthorText;
protected boolean lockEventFire = false;
+
+ private Combo streamFilterTypeCombo;
+ private boolean streamFilterTypeSet = false;
+ private Button defaultSerializationOnCheckbox;
+ private boolean defaultSerializationOnSet = false;
public SmooksConfigurationOverviewPage(FormEditor editor, String id, String title, ISmooksModelProvider provider) {
super(editor, id, title);
@@ -142,40 +145,35 @@
Composite mainComposite = pageBook.createPage(pageBook);
pageBook.showPage(pageBook);
- // Composite mainComposite = toolkit.createComposite(form.getBody());
-
GridData gd = new GridData(GridData.FILL_BOTH);
pageBook.setLayoutData(gd);
GridLayout mgl = new GridLayout();
mgl.numColumns = 2;
- mgl.marginHeight = 13;
mgl.horizontalSpacing = 20;
mainComposite.setLayout(mgl);
- settingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR);
+ settingSection = toolkit.createSection(mainComposite, Section.TITLE_BAR);
settingSection.setLayout(new FillLayout());
settingSection.setText("Smooks configuration");
- settingSection.setDescription("Set the description for this Smooks configuration file.");
+// settingSection.setDescription("Set the description for this Smooks configuration file.");
Composite settingComposite = toolkit.createComposite(settingSection);
settingSection.setClient(settingComposite);
gd = new GridData();
gd.widthHint = 500;
+ gd.verticalAlignment = GridData.BEGINNING;
settingSection.setLayoutData(gd);
GridLayout sgl = new GridLayout();
settingComposite.setLayout(sgl);
sgl.numColumns = 2;
- // sgl.verticalSpacing = 8;
createSettingSection(settingComposite, toolkit);
- createSmooksEditorNavigator(mainComposite, toolkit);
-
- globalParamSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
+ globalParamSection = toolkit.createSection(mainComposite, Section.TITLE_BAR
| Section.TWISTIE | Section.EXPANDED);
- globalParamSection.setDescription("Define the global parameters for the Smooks configuration file");
- globalParamSection.setText("Global Paramters");
+// globalParamSection.setDescription("Optional settings to change how Smooks processes and serializes input");
+ globalParamSection.setText("Filter Settings");
globalParamSection.setLayout(new FillLayout());
Composite globalParamComposite = toolkit.createComposite(globalParamSection);
globalParamSection.setClient(globalParamComposite);
@@ -190,60 +188,60 @@
createGlobalParamterSection(globalParamComposite, toolkit);
- generalSettingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
- | Section.TWISTIE | Section.EXPANDED);
- generalSettingSection.setLayout(new FillLayout());
- generalSettingSection.setText("Smooks Default Setting");
- generalSettingSection.setDescription("Define the Smooks configuration file default setting");
- defaultSettingComposite = toolkit.createComposite(generalSettingSection);
- generalSettingSection.setClient(defaultSettingComposite);
- gd = new GridData();
- gd.widthHint = 500;
- generalSettingSection.setLayoutData(gd);
+// generalSettingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
+// | Section.TWISTIE | Section.EXPANDED);
+// generalSettingSection.setLayout(new FillLayout());
+// generalSettingSection.setText("Smooks Default Setting");
+// generalSettingSection.setDescription("Define the Smooks configuration file default setting");
+// defaultSettingComposite = toolkit.createComposite(generalSettingSection);
+// generalSettingSection.setClient(defaultSettingComposite);
+// gd = new GridData();
+// gd.widthHint = 500;
+// generalSettingSection.setLayoutData(gd);
+//
+// GridLayout ggl = new GridLayout();
+// defaultSettingComposite.setLayout(ggl);
+// ggl.numColumns = 2;
+// ggl.verticalSpacing = 0;
+//
+// createDefaultSection(defaultSettingComposite, toolkit);
+//
+// conditionSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
+// | Section.TWISTIE);
+// conditionSection.setText("Conditions");
+// conditionSection.setDescription("Define the conditions");
+// conditionSection.setLayout(new FillLayout());
+// Composite conditionComposite = toolkit.createComposite(conditionSection);
+// conditionSection.setClient(conditionComposite);
+// gd = new GridData();
+// gd.verticalAlignment = GridData.BEGINNING;
+// gd.widthHint = 500;
+// conditionSection.setLayoutData(gd);
+//
+// GridLayout cgl = new GridLayout();
+// conditionComposite.setLayout(cgl);
+// cgl.numColumns = 2;
+//
+// createConditionsSection(conditionComposite, toolkit);
+//
+// profilesSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
+// | Section.TWISTIE);
+// profilesSection.setDescription("Define the profiles");
+// profilesSection.setText("Profiles");
+// profilesSection.setLayout(new FillLayout());
+// Composite profilesComposite = toolkit.createComposite(profilesSection);
+// profilesSection.setClient(profilesComposite);
+// gd = new GridData();
+// gd.verticalAlignment = GridData.BEGINNING;
+// gd.widthHint = 500;
+// profilesSection.setLayoutData(gd);
+//
+// GridLayout pgl = new GridLayout();
+// profilesComposite.setLayout(pgl);
+// pgl.numColumns = 2;
+//
+// createProfilesSection(profilesComposite, toolkit);
- GridLayout ggl = new GridLayout();
- defaultSettingComposite.setLayout(ggl);
- ggl.numColumns = 2;
- ggl.verticalSpacing = 0;
-
- createDefaultSection(defaultSettingComposite, toolkit);
-
- conditionSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
- | Section.TWISTIE);
- conditionSection.setText("Conditions");
- conditionSection.setDescription("Define the conditions");
- conditionSection.setLayout(new FillLayout());
- Composite conditionComposite = toolkit.createComposite(conditionSection);
- conditionSection.setClient(conditionComposite);
- gd = new GridData();
- gd.verticalAlignment = GridData.BEGINNING;
- gd.widthHint = 500;
- conditionSection.setLayoutData(gd);
-
- GridLayout cgl = new GridLayout();
- conditionComposite.setLayout(cgl);
- cgl.numColumns = 2;
-
- createConditionsSection(conditionComposite, toolkit);
-
- profilesSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
- | Section.TWISTIE);
- profilesSection.setDescription("Define the profiles");
- profilesSection.setText("Profiles");
- profilesSection.setLayout(new FillLayout());
- Composite profilesComposite = toolkit.createComposite(profilesSection);
- profilesSection.setClient(profilesComposite);
- gd = new GridData();
- gd.verticalAlignment = GridData.BEGINNING;
- gd.widthHint = 500;
- profilesSection.setLayoutData(gd);
-
- GridLayout pgl = new GridLayout();
- profilesComposite.setLayout(pgl);
- pgl.numColumns = 2;
-
- createProfilesSection(profilesComposite, toolkit);
-
}
private void createSettingSection(Composite settingComposite, FormToolkit toolkit) {
@@ -275,53 +273,53 @@
}
});
- toolkit.createLabel(settingComposite, "Name : ").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- smooksNameText = toolkit.createText(settingComposite, "", SWT.NONE);
- smooksNameText.setLayoutData(gd);
- String name = smooksModelProvider.getSmooksGraphicsExt().getName();
- if (name != null)
- smooksNameText.setText(name);
- smooksNameText.addModifyListener(new ModifyListener() {
+// toolkit.createLabel(settingComposite, "Name : ").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+// smooksNameText = toolkit.createText(settingComposite, "", SWT.NONE);
+// smooksNameText.setLayoutData(gd);
+// String name = smooksModelProvider.getSmooksGraphicsExt().getName();
+// if (name != null)
+// smooksNameText.setText(name);
+// smooksNameText.addModifyListener(new ModifyListener() {
+//
+// public void modifyText(ModifyEvent e) {
+// if (lockEventFire)
+// return;
+// if (smooksModelProvider != null) {
+// Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(), smooksModelProvider
+// .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__NAME,
+// smooksNameText.getText());
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
+// }
+// }
+// });
+//
+// toolkit.paintBordersFor(settingComposite);
+//
+// toolkit.createLabel(settingComposite, "Author : ").setForeground(
+// toolkit.getColors().getColor(IFormColors.TITLE));
+// smooksAuthorText = toolkit.createText(settingComposite, "", SWT.NONE);
+// smooksAuthorText.setLayoutData(gd);
+//
+// String author = smooksModelProvider.getSmooksGraphicsExt().getAuthor();
+// if (author != null)
+// smooksAuthorText.setText(author);
+// smooksAuthorText.addModifyListener(new ModifyListener() {
+//
+// public void modifyText(ModifyEvent e) {
+// if (lockEventFire)
+// return;
+// if (smooksModelProvider != null) {
+// Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(), smooksModelProvider
+// .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__AUTHOR,
+// smooksAuthorText.getText());
+// smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
+// }
+// }
+// });
+//
+// toolkit.createLabel(settingComposite, "");
- public void modifyText(ModifyEvent e) {
- if (lockEventFire)
- return;
- if (smooksModelProvider != null) {
- Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(), smooksModelProvider
- .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__NAME,
- smooksNameText.getText());
- smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
- }
- }
- });
-
toolkit.paintBordersFor(settingComposite);
-
- toolkit.createLabel(settingComposite, "Author : ").setForeground(
- toolkit.getColors().getColor(IFormColors.TITLE));
- smooksAuthorText = toolkit.createText(settingComposite, "", SWT.NONE);
- smooksAuthorText.setLayoutData(gd);
-
- String author = smooksModelProvider.getSmooksGraphicsExt().getAuthor();
- if (author != null)
- smooksAuthorText.setText(author);
- smooksAuthorText.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- if (lockEventFire)
- return;
- if (smooksModelProvider != null) {
- Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(), smooksModelProvider
- .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__AUTHOR,
- smooksAuthorText.getText());
- smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
- }
- }
- });
-
- toolkit.createLabel(settingComposite, "");
-
- toolkit.paintBordersFor(settingComposite);
}
protected void createProfilesSection(Composite profilesComposite, FormToolkit toolkit) {
@@ -949,85 +947,233 @@
// if (m == null)
// return;
- paramViewer = new TableViewer(globalParamComposite);
- GridData gd = new GridData(GridData.FILL_BOTH);
- paramViewer.getControl().setLayoutData(gd);
- toolkit.paintBordersFor(globalParamComposite);
- Composite buttonArea = toolkit.createComposite(globalParamComposite);
- gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = 30;
- GridLayout bgl = new GridLayout();
- buttonArea.setLayout(bgl);
+ toolkit.createLabel(globalParamComposite, "Stream Filter Type:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
+ streamFilterTypeCombo = new Combo(globalParamComposite, SWT.DROP_DOWN | SWT.READ_ONLY );
+ streamFilterTypeCombo.setItems(new String[] {"SAX", "DOM"});
+ streamFilterTypeCombo.setLayoutData(gd);
- newParamButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- newParamButton.setLayoutData(gd);
+ toolkit.createLabel(globalParamComposite, "Default Serialization is On:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ gd = new GridData(SWT.FILL, SWT.NONE, true, false);
+ defaultSerializationOnCheckbox = toolkit.createButton(globalParamComposite, "", SWT.CHECK);
+ defaultSerializationOnCheckbox.setLayoutData(gd);
- removeParamButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- removeParamButton.setLayoutData(gd);
+ if (m != null) {
+ EList<?> parmList = m.getParam();
+ for (int i = 0; i < parmList.size(); i++) {
+ ParamType param = (ParamType)parmList.get(i);
+ if (param.getName().equals("stream.filter.type")) {
+ streamFilterTypeCombo.setText(param.getStringValue());
+ }
+ else if (param.getName().equals("default.serialization.on")) {
+ Boolean boolValue = Boolean.valueOf(param.getStringValue());
+ defaultSerializationOnCheckbox.setSelection(boolValue.booleanValue());
+ }
+ }
+ }
+ else { // set defaults
+ streamFilterTypeCombo.setText("SAX");
+ defaultSerializationOnCheckbox.setSelection(true);
+ }
- upParamButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- upParamButton.setLayoutData(gd);
+ toolkit.paintBordersFor(globalParamComposite);
+
+ streamFilterTypeCombo.addSelectionListener( new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ String value = streamFilterTypeCombo.getText();
+ EObject resource = getSmooksResourceList();
+ if (resource == null)
+ return;
+ if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ return;
+ }
+ ParamsType parent = getParamsType();
+ ParamType param = null;
+ ParamType newparam = null;
+ if (parent != null) {
+ EList<?> parmList = parent.getParam();
+ for (int i = 0; i < parmList.size(); i++) {
+ param = (ParamType)parmList.get(i);
+ if (param.getName().equals("stream.filter.type")) {
+ streamFilterTypeSet = true;
+ break;
+ }
+ }
+ }
+ newparam = SmooksFactory.eINSTANCE.createParamType();
+ newparam.setName("stream.filter.type");
+ newparam.setStringValue(value);
- downParamButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- downParamButton.setLayoutData(gd);
-
- paramPropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- paramPropertiesButton.setLayoutData(gd);
-
- paramViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-
- @Override
- public boolean hasChildren(Object object) {
- return false;
+ if (parent == null) {
+ parent = SmooksFactory.eINSTANCE.createParamsType();
+ Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+ SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
+ if (command.canExecute()) {
+ ((SmooksResourceListType) resource).setParams((ParamsType) parent);
+ }
+ }
+ EditingDomain editingDomain = smooksModelProvider.getEditingDomain();
+ Command command = null;
+ Command command2 = null;
+ EStructuralFeature feature = SmooksPackage.Literals.PARAMS_TYPE__PARAM;
+ if (feature instanceof EReference) {
+ if (streamFilterTypeSet) {
+ command2 = RemoveCommand.create(editingDomain, parent, feature, param);
+ }
+ command = AddCommand.create(editingDomain, parent, feature, newparam);
+ }
+ if (command2 != null && command2.canExecute())
+ editingDomain.getCommandStack().execute(command2);
+ if (command != null)
+ editingDomain.getCommandStack().execute(command);
+ ((SmooksResourceListType) resource).setParams((ParamsType) parent);
+ streamFilterTypeCombo.setText(value);
}
-
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
});
+
+ defaultSerializationOnCheckbox.addSelectionListener( new SelectionListener() {
- paramViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
- .getAdapterFactory()) {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ String value = Boolean.toString(defaultSerializationOnCheckbox.getSelection());
+ EObject resource = getSmooksResourceList();
+ if (resource == null)
+ return;
+ if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ return;
+ }
+ ParamsType parent = getParamsType();
+ ParamType param = null;
+ ParamType newparam = null;
+ if (parent != null) {
+ EList<?> parmList = parent.getParam();
+ for (int i = 0; i < parmList.size(); i++) {
+ param = (ParamType)parmList.get(i);
+ if (param.getName().equals("default.serialization.on")) {
+ defaultSerializationOnSet = true;
+ break;
+ }
+ }
+ }
+ newparam = SmooksFactory.eINSTANCE.createParamType();
+ newparam.setName("default.serialization.on");
+ newparam.setStringValue(value);
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
- * # getText(java.lang.Object)
- */
- @Override
- public String getText(Object object) {
- Object obj = AdapterFactoryEditingDomain.unwrap(object);
- if (obj instanceof AbstractAnyType) {
- return super.getText(obj);
+ if (parent == null) {
+ parent = SmooksFactory.eINSTANCE.createParamsType();
+ Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+ SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
+ if (command.canExecute()) {
+ ((SmooksResourceListType) resource).setParams((ParamsType) parent);
+ }
}
- return super.getText(object);
+ EditingDomain editingDomain = smooksModelProvider.getEditingDomain();
+ Command command = null;
+ Command command2 = null;
+ EStructuralFeature feature = SmooksPackage.Literals.PARAMS_TYPE__PARAM;
+ if (feature instanceof EReference) {
+ if (defaultSerializationOnSet) {
+ command2 = RemoveCommand.create(editingDomain, parent, feature, param);
+ }
+ command = AddCommand.create(editingDomain, parent, feature, newparam);
+ }
+ if (command2 != null && command2.canExecute())
+ editingDomain.getCommandStack().execute(command2);
+ if (command != null)
+ editingDomain.getCommandStack().execute(command);
+ ((SmooksResourceListType) resource).setParams((ParamsType) parent);
+
+// defaultSerializationOnCheckbox.setSelection(Boolean.parseBoolean(value));
}
- }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
- if (m != null) {
- paramViewer.setInput(m);
- }
-
- paramViewer.addDoubleClickListener(new IDoubleClickListener() {
-
- public void doubleClick(DoubleClickEvent event) {
- openParamPropertiesModifyDialog();
+ public void widgetSelected(SelectionEvent e) {
+ widgetDefaultSelected(e);
}
});
-
- paramViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- updateParamButtons();
- }
- });
-
- hookGlobalParamterButtons();
- updateParamButtons();
+
+// paramViewer = new TableViewer(globalParamComposite);
+// GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+// paramViewer.getControl().setLayoutData(gd);
+// toolkit.paintBordersFor(globalParamComposite);
+// Composite buttonArea = toolkit.createComposite(globalParamComposite);
+// gd = new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL);
+// gd.widthHint = 200;
+// GridLayout bgl = new GridLayout();
+// buttonArea.setLayout(bgl);
+//
+// newParamButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// newParamButton.setLayoutData(gd);
+//
+// removeParamButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// removeParamButton.setLayoutData(gd);
+//
+// upParamButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// upParamButton.setLayoutData(gd);
+//
+// downParamButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// downParamButton.setLayoutData(gd);
+//
+// paramPropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// paramPropertiesButton.setLayoutData(gd);
+//
+// paramViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
+//
+// @Override
+// public boolean hasChildren(Object object) {
+// return false;
+// }
+//
+// });
+//
+// paramViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
+// .getAdapterFactory()) {
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+// * # getText(java.lang.Object)
+// */
+// @Override
+// public String getText(Object object) {
+// Object obj = AdapterFactoryEditingDomain.unwrap(object);
+// if (obj instanceof AbstractAnyType) {
+// return super.getText(obj);
+// }
+// return super.getText(object);
+// }
+//
+// }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+// if (m != null) {
+// paramViewer.setInput(m);
+// }
+//
+// paramViewer.addDoubleClickListener(new IDoubleClickListener() {
+//
+// public void doubleClick(DoubleClickEvent event) {
+// openParamPropertiesModifyDialog();
+// }
+// });
+//
+// paramViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+//
+// public void selectionChanged(SelectionChangedEvent event) {
+// updateParamButtons();
+// }
+// });
+//
+// hookGlobalParamterButtons();
+// updateParamButtons();
}
}
@@ -1225,123 +1371,6 @@
}
}
- private void createNavigatorSection(Composite mainNavigatorComposite, FormToolkit toolkit, String title,
- String navigatorFilePath) {
- Section navigator = toolkit.createSection(mainNavigatorComposite, Section.TITLE_BAR);
- navigator.setText(title);
- navigator.setLayout(new FillLayout());
- Composite navigatorComposite = toolkit.createComposite(navigator);
- navigator.setClient(navigatorComposite);
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.verticalAlignment = GridData.BEGINNING;
- navigator.setLayoutData(gd);
-
- FormText formText = toolkit.createFormText(navigatorComposite, true);
- StringBuffer buf = new StringBuffer();
- InputStream inputStream = this.getClass().getResourceAsStream(navigatorFilePath);
- BufferedReader reader = null;
- if (inputStream != null) {
- try {
- reader = new BufferedReader(new InputStreamReader(inputStream));
- String line = reader.readLine();
- while (line != null) {
- buf.append(line);
- line = reader.readLine();
- }
- } catch (IOException e) {
-
- } finally {
- try {
- if (reader != null) {
- reader.close();
- }
- if (inputStream != null) {
- inputStream.close();
- }
- } catch (Throwable t) {
-
- }
- }
- }
- formText.setWhitespaceNormalized(true);
- String content = buf.toString();
- if (content != null) {
- try {
- formText.setText(content, true, false);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- formText.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
- Object href = e.getHref();
- if (href == null)
- return;
- activeNavigatorLink(href.toString());
- }
- });
- navigatorComposite.setLayout(new GridLayout());
- gd = new GridData(GridData.FILL_BOTH);
- formText.setLayoutData(gd);
-
- toolkit.createLabel(navigatorComposite, "");
- }
-
- private void createSmooksEditorNavigator(Composite mainComposite, FormToolkit toolkit) {
- Composite mainNavigatorComposite = toolkit.createComposite(mainComposite);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.verticalSpan = 5;
- mainNavigatorComposite.setLayoutData(gd);
-
- GridLayout gl = new GridLayout();
- // gl.numColumns = 2;
- gl.marginWidth = 0;
- gl.marginHeight = 0;
- mainNavigatorComposite.setLayout(gl);
-
- createNavigatorSection(mainNavigatorComposite, toolkit, "Configuring Smooks Input",
- "/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm");
- createNavigatorSection(mainNavigatorComposite, toolkit, "Configuring Smooks Transform Processes",
- "/org/jboss/tools/smooks/configuration/navigator/MessageFilterNavigator.htm");
- }
-
- protected void activeNavigatorLink(String href) {
- if (href == null)
- return;
- if (href.equals("overview_default_setting")) {
- generalSettingSection.setFocus();
- return;
- }
- if (href.equals("overview_global_param")) {
- globalParamSection.setFocus();
- globalParamSection.setExpanded(true);
- return;
- }
- if (href.equals("overview_condition")) {
- conditionSection.setFocus();
- conditionSection.setExpanded(true);
- return;
- }
- if (href.equals("overview_profile")) {
- profilesSection.setFocus();
- profilesSection.setExpanded(true);
- return;
- }
- if (href.equals("selector_dialog")) {
- SelectorCreationDialog dialog = new SelectorCreationDialog(getEditorSite().getShell(),
- this.smooksModelProvider.getSmooksGraphicsExt(), this.getEditor());
- try {
- dialog.open();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return;
- }
-
- this.getEditor().setActivePage(href);
- }
-
private EObject getSmooksResourceList() {
if (smooksModelProvider != null) {
EObject m = null;
@@ -1400,23 +1429,23 @@
return;
}
- String name = extType.getName();
- if (name != null)
- smooksNameText.setText(name);
+// String name = extType.getName();
+// if (name != null)
+// smooksNameText.setText(name);
+//
+// String author = extType.getAuthor();
+// if (author != null)
+// smooksAuthorText.setText(author);
- String author = extType.getAuthor();
- if (author != null)
- smooksAuthorText.setText(author);
-
lockEventFire = false;
- disposeDefaultSettingCompositeControls();
- createDefaultSection(defaultSettingComposite, this.getManagedForm().getToolkit());
- defaultSettingComposite.getParent().layout();
-
- paramViewer.setInput(getParamsType());
- conditionViewer.setInput(getConditionsType());
- profileViewer.setInput(getProfilesType());
+// disposeDefaultSettingCompositeControls();
+// createDefaultSection(defaultSettingComposite, this.getManagedForm().getToolkit());
+// defaultSettingComposite.getParent().layout();
+//
+// paramViewer.setInput(getParamsType());
+// conditionViewer.setInput(getConditionsType());
+// profileViewer.setInput(getProfilesType());
}
protected void disposeCompositeControls(Composite composite, Control[] ignoreControl) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-11-18 15:58:52 UTC (rev 18738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-11-18 22:57:30 UTC (rev 18739)
@@ -45,7 +45,7 @@
private SmooksGraphicalEditorPart graphicalPage;
- private SmooksConfigurationOverviewPage overViewPage;
+ private SmooksConfigurationOverviewPage optionsPage;
private SmooksReaderFormPage readerPage;
@@ -64,30 +64,29 @@
*/
@Override
protected void addPages() {
- overViewPage = createSmooksConfigurationOverviewPage();
- addValidateListener(overViewPage);
- addSourceSynchronizeListener(overViewPage);
- addSmooksGraphExtetionListener(overViewPage);
- try {
- int index = this.addPage(overViewPage);
- setPageText(index, "Overview");
- } catch (PartInitException e) {
- e.printStackTrace();
- }
+// readerPage = new SmooksReaderFormPage(this, "reader_page", "Input");
+// addValidateListener(readerPage);
+// addSourceSynchronizeListener(readerPage);
+// addSmooksGraphExtetionListener(readerPage);
+// try {
+// int index = this.addPage(readerPage);
+// setPageText(index, "Input");
+// } catch (PartInitException e) {
+// e.printStackTrace();
+// }
- readerPage = new SmooksReaderFormPage(this, "reader_page", "Input");
- addValidateListener(readerPage);
- addSourceSynchronizeListener(readerPage);
- addSmooksGraphExtetionListener(readerPage);
+ addProcessGraphicalEditor();
+
+ optionsPage = createSmooksConfigurationOverviewPage();
+ addValidateListener(optionsPage);
+ addSourceSynchronizeListener(optionsPage);
+ addSmooksGraphExtetionListener(optionsPage);
try {
- int index = this.addPage(readerPage);
- setPageText(index, "Input");
+ int index = this.addPage(optionsPage);
+ setPageText(index, "Options");
} catch (PartInitException e) {
e.printStackTrace();
}
-
- addProcessGraphicalEditor();
-
// addSmooksGraphicalEditor();
// configurationPage = createSmooksConfigurationFormPage();
@@ -143,7 +142,7 @@
// }
private SmooksConfigurationOverviewPage createSmooksConfigurationOverviewPage() {
- return new SmooksConfigurationOverviewPage(this, "overview_page", "Overview", this);
+ return new SmooksConfigurationOverviewPage(this, "options_page", "Options", this);
}
@Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-18 15:58:52 UTC (rev 18738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-18 22:57:30 UTC (rev 18739)
@@ -145,13 +145,13 @@
protected void createFormContent(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
- toolkit.decorateFormHeading(form.getForm());
- form.setText("Input");
+// toolkit.decorateFormHeading(form.getForm());
+// form.setText("Input");
// // create master details UI
// createMasterDetailBlock(managedForm);
Composite leftComposite = toolkit.createComposite(form.getBody());
GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 700;
+ gd.widthHint = 300;
leftComposite.setLayoutData(gd);
Composite rightComposite = toolkit.createComposite(form.getBody());
@@ -186,12 +186,12 @@
}
private void createInputModelViewerSection(FormToolkit toolkit, Composite parent) {
- Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.DESCRIPTION);
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
GridData gd = new GridData(GridData.FILL_BOTH);
// gd.verticalAlignment = GridData.BEGINNING;
section.setLayoutData(gd);
section.setText("Input Model View");
- section.setDescription("View the XML structure model of the input data");
+// section.setDescription("View the XML structure model of the input data");
FillLayout flayout = new FillLayout();
section.setLayout(flayout);
@@ -200,7 +200,7 @@
mainContainer.setLayout(gl);
section.setClient(mainContainer);
- Hyperlink refreshLink = toolkit.createHyperlink(mainContainer, "Refresh Input Model Viewer", SWT.NONE);
+ Hyperlink refreshLink = toolkit.createHyperlink(mainContainer, "Refresh", SWT.NONE);
refreshLink.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
@@ -256,11 +256,11 @@
}
private void createReaderConfigSection(FormToolkit toolkit, Composite parent) {
- Section section = toolkit.createSection(parent, Section.TITLE_BAR);
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
GridData gd = new GridData(GridData.FILL_BOTH);
section.setLayoutData(gd);
section.setText("Input Configuration");
- section.setDescription("Configurate the input data");
+ section.setDescription("Specify reader details");
FillLayout flayout = new FillLayout();
section.setLayout(flayout);
@@ -279,12 +279,12 @@
}
private void createReaderSection(FormToolkit toolkit, Composite parent) {
- Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.DESCRIPTION);
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.verticalAlignment = GridData.BEGINNING;
section.setLayoutData(gd);
section.setText("Input Type");
- section.setDescription("Select the input type");
+// section.setDescription("Select the input type");
FillLayout flayout = new FillLayout();
section.setLayout(flayout);
@@ -294,7 +294,7 @@
gl.numColumns = 2;
mainComposite.setLayout(gl);
- toolkit.createLabel(mainComposite, "Input Type : ");
+ toolkit.createLabel(mainComposite, "Input Type:");
readerCombo = new Combo(mainComposite, SWT.NONE | SWT.READ_ONLY);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -701,11 +701,11 @@
}
protected void createInputDataSection(FormToolkit toolkit, Composite parent) {
- Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.DESCRIPTION);
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.DESCRIPTION | Section.TWISTIE | Section.EXPANDED);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
section.setLayoutData(gd);
section.setText("Input Data");
- section.setDescription("Add a file to be the input data");
+ section.setDescription("Select a sample data file");
FillLayout flayout = new FillLayout();
section.setLayout(flayout);
@@ -720,7 +720,7 @@
fillLayout.marginHeight = 1;
fillLayout.marginWidth = 1;
gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
+ gd.heightHint = 70;
tableComposite.setLayoutData(gd);
tableComposite.setBackground(GraphicsConstants.BORDER_CORLOR);
tableComposite.setLayout(fillLayout);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-18 15:58:52 UTC (rev 18738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-18 22:57:30 UTC (rev 18739)
@@ -76,6 +76,7 @@
import org.eclipse.zest.layouts.LayoutStyles;
import org.eclipse.zest.layouts.algorithms.HorizontalTreeLayoutAlgorithm;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+import org.jboss.tools.smooks.configuration.editors.SmooksReaderFormPage;
import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.editor.ISourceSynchronizeListener;
@@ -495,9 +496,8 @@
}
protected void createProcessGraphicalSection(FormToolkit toolkit, Composite parent) {
- Section processGraphSection = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ Section processGraphSection = toolkit.createSection(parent, Section.TITLE_BAR);
processGraphSection.setText("Process Map");
- processGraphSection.setDescription("Right-Click to open the PopMenu to add or remove task node");
Composite processGraphComposite = toolkit.createComposite(processGraphSection);
@@ -604,9 +604,8 @@
taskDetailsFillLayout.marginHeight = 5;
taskDetailsComposite.setLayout(taskDetailsFillLayout);
- Section section = toolkit.createSection(taskDetailsComposite, Section.DESCRIPTION | Section.TITLE_BAR);
+ Section section = toolkit.createSection(taskDetailsComposite, Section.TITLE_BAR);
section.setText("Task Configuration");
- section.setDescription("Configurate the selected task");
pageBook = new ScrolledPageBook(section);
pageBook.setBackground(toolkit.getColors().getBackground());
section.setClient(pageBook);
@@ -773,6 +772,12 @@
smooksModelProvider);
this.registeTaskDetailsPage(freemarkerPart, TaskTypeManager.TASK_ID_FREEMARKER_TEMPLATE);
+ SmooksReaderFormPage readerPage = new SmooksReaderFormPage(getEditor(), "input", "input");
+ this.registeTaskDetailsPage(readerPage, TaskTypeManager.TASK_ID_INPUT);
+
+ if (smooksModelProvider != null) {
+ this.handleCommandStack(smooksModelProvider.getEditingDomain().getCommandStack());
+ }
// SmooksXSLTemplateGraphicalEditor xsltemplatePart = new
// SmooksXSLTemplateGraphicalEditor(smooksModelProvider);
// this.registeTaskDetailsPage(xsltemplatePart,
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java 2009-11-18 15:58:52 UTC (rev 18738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java 2009-11-18 22:57:30 UTC (rev 18739)
@@ -63,10 +63,10 @@
allTaskList.add(new TaskTypeDescriptor(TASK_ID_INPUT, "Input", GraphicsConstants.IMAGE_INPUT_TASK));
allTaskList.add(new TaskTypeDescriptor(TASK_ID_JAVA_MAPPING, "Java Mapping",
GraphicsConstants.IMAGE_JAVA_AMPPING_TASK));
- allTaskList.add(new TaskTypeDescriptor(TASK_ID_FREEMARKER_TEMPLATE, "Apply Freemaker Template",
+ allTaskList.add(new TaskTypeDescriptor(TASK_ID_FREEMARKER_TEMPLATE, "Apply Template",
GraphicsConstants.IMAGE_APPLY_FREEMARKER_TASK));
- allTaskList.add(new TaskTypeDescriptor(TASK_ID_XSL_TEMPLATE, "Apply XSL Template",
- GraphicsConstants.IMAGE_APPLY_XSL_TASK));
+// allTaskList.add(new TaskTypeDescriptor(TASK_ID_XSL_TEMPLATE, "Apply XSL Template",
+// GraphicsConstants.IMAGE_APPLY_XSL_TASK));
}
return allTaskList;
}
@@ -95,7 +95,7 @@
public static String getTaskLabel(String taskId) {
if (taskId != null) {
if (taskId.equals(TASK_ID_FREEMARKER_TEMPLATE)) {
- return "Apply Freemarker Template";
+ return "Apply Template";
}
if (taskId.equals(TASK_ID_INPUT)) {
return "Input Task";
15 years, 1 month