Author: tfennelly
Date: 2010-04-01 12:02:12 -0400 (Thu, 01 Apr 2010)
New Revision: 21202
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/actions/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/calc/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/dbrouting/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/esbrouter/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/filerouting/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/iorouting/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/jms/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/jms12/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/persistence12/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/rule10/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/validation10/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/XSLLabelProvider.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5983
[SPRING CLEAN] Remove useless codes from Smooks tools projects.
removed some more unused code from the ui plugin
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -13,15 +13,11 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.tools.smooks.configuration.editors.calc.CounterUICreator;
import
org.jboss.tools.smooks.configuration.editors.csv12.Csv12ReaderBindingPropertyUICreator;
import
org.jboss.tools.smooks.configuration.editors.csv12.Csv12ReaderMapBindingPropertyUICreator;
import org.jboss.tools.smooks.configuration.editors.csv12.Csv12ReaderUICreator;
import org.jboss.tools.smooks.configuration.editors.datasource.DataSourceJndiUICreator;
import org.jboss.tools.smooks.configuration.editors.datasource.DirectUICreator;
-import org.jboss.tools.smooks.configuration.editors.dbrouting.ExecutorUICreator;
-import
org.jboss.tools.smooks.configuration.editors.dbrouting.ResultSetRowSelectorUICreator;
-import org.jboss.tools.smooks.configuration.editors.dbrouting.ResultSetUICreator;
import org.jboss.tools.smooks.configuration.editors.edi.ComponentUICreator;
import org.jboss.tools.smooks.configuration.editors.edi.DelimitersUICreator;
import org.jboss.tools.smooks.configuration.editors.edi.DescriptionUICreator;
@@ -32,30 +28,14 @@
import org.jboss.tools.smooks.configuration.editors.edi.SegmentsUICreator;
import org.jboss.tools.smooks.configuration.editors.edi.SubComponentUICreator;
import org.jboss.tools.smooks.configuration.editors.edireader12.EDIReader12UICreator;
-import
org.jboss.tools.smooks.configuration.editors.esbrouter.RouteBeanPropertyUICreator;
-import org.jboss.tools.smooks.configuration.editors.filerouting.HighWaterMarkUICreator;
-import org.jboss.tools.smooks.configuration.editors.filerouting.OutputStreamUICreator;
import org.jboss.tools.smooks.configuration.editors.freemarker.FreemarkerUICreator;
import org.jboss.tools.smooks.configuration.editors.freemarker.InlineUICreator;
import org.jboss.tools.smooks.configuration.editors.freemarker.UseUICreator;
-import org.jboss.tools.smooks.configuration.editors.groovy.GroovyUICreator;
-import org.jboss.tools.smooks.configuration.editors.groovy.ScriptUICreator;
-import org.jboss.tools.smooks.configuration.editors.iorouting.IORouterUICreator;
import
org.jboss.tools.smooks.configuration.editors.javabean12.JavaBean12PropertyUICreator;
import
org.jboss.tools.smooks.configuration.editors.javabean12.Javabean12ExpressionUICreator;
import
org.jboss.tools.smooks.configuration.editors.javabean12.JavabeanValueBinding12UICreator;
import
org.jboss.tools.smooks.configuration.editors.javabean12.JavabeanWiringBiding12UICreator;
-import org.jboss.tools.smooks.configuration.editors.jms12.JMSRouter12UICreator;
import org.jboss.tools.smooks.configuration.editors.json12.Json12ReaderUICreator;
-import org.jboss.tools.smooks.configuration.editors.persistence12.DeleterUICreator;
-import org.jboss.tools.smooks.configuration.editors.persistence12.FlusherUICreator;
-import org.jboss.tools.smooks.configuration.editors.persistence12.InserterUICreator;
-import
org.jboss.tools.smooks.configuration.editors.persistence12.LocatorExpressionParamUICreator;
-import org.jboss.tools.smooks.configuration.editors.persistence12.LocatorUICreator;
-import
org.jboss.tools.smooks.configuration.editors.persistence12.LocatorValueParamUICreator;
-import
org.jboss.tools.smooks.configuration.editors.persistence12.LocatorWiringParamUICreator;
-import org.jboss.tools.smooks.configuration.editors.persistence12.UpdaterUICreator;
-import org.jboss.tools.smooks.configuration.editors.rule10.Rules10RulebaseUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ConditionTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ConditionsTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.FeaturesTypeUICreator;
@@ -72,32 +52,16 @@
import org.jboss.tools.smooks.configuration.editors.smooks.SetOffTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.SetOnTypeUICreator;
import
org.jboss.tools.smooks.configuration.editors.smooks.SmooksResourceListTypeUICreator;
-import org.jboss.tools.smooks.configuration.editors.validation10.RuleUICreator;
-import org.jboss.tools.smooks.configuration.editors.xsl.BindToUICreator;
-import org.jboss.tools.smooks.configuration.editors.xsl.OutputToUICreator;
-import org.jboss.tools.smooks.configuration.editors.xsl.TemplateUICreator;
-import org.jboss.tools.smooks.configuration.editors.xsl.XslUICreator;
-import org.jboss.tools.smooks.model.calc.impl.CounterImpl;
import org.jboss.tools.smooks.model.csv12.impl.BindingImpl;
import org.jboss.tools.smooks.model.csv12.impl.CSV12ReaderImpl;
import org.jboss.tools.smooks.model.csv12.impl.MapBindingImpl;
import org.jboss.tools.smooks.model.datasource.impl.DataSourceJndiImpl;
import org.jboss.tools.smooks.model.datasource.impl.DirectImpl;
-import org.jboss.tools.smooks.model.dbrouting.impl.ExecutorImpl;
-import org.jboss.tools.smooks.model.dbrouting.impl.ResultSetImpl;
-import org.jboss.tools.smooks.model.dbrouting.impl.ResultSetRowSelectorImpl;
import org.jboss.tools.smooks.model.edi12.impl.EDI12ReaderImpl;
-import org.jboss.tools.smooks.model.esbrouting.impl.RouteBeanImpl;
-import org.jboss.tools.smooks.model.fileRouting.impl.HighWaterMarkImpl;
-import org.jboss.tools.smooks.model.fileRouting.impl.OutputStreamImpl;
import org.jboss.tools.smooks.model.freemarker.impl.FreemarkerImpl;
import org.jboss.tools.smooks.model.freemarker.impl.InlineImpl;
import org.jboss.tools.smooks.model.freemarker.impl.UseImpl;
-import org.jboss.tools.smooks.model.groovy.impl.GroovyImpl;
-import org.jboss.tools.smooks.model.groovy.impl.ScriptTypeImpl;
-import org.jboss.tools.smooks.model.iorouting.impl.IORouterImpl;
import org.jboss.tools.smooks.model.javabean12.impl.BeanTypeImpl;
-import org.jboss.tools.smooks.model.jmsrouting12.impl.JMS12RouterImpl;
import org.jboss.tools.smooks.model.json12.impl.Json12ReaderImpl;
import org.jboss.tools.smooks.model.medi.impl.ComponentImpl;
import org.jboss.tools.smooks.model.medi.impl.DelimitersImpl;
@@ -108,15 +72,6 @@
import org.jboss.tools.smooks.model.medi.impl.SegmentImpl;
import org.jboss.tools.smooks.model.medi.impl.SegmentsImpl;
import org.jboss.tools.smooks.model.medi.impl.SubComponentImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.DeleterImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.ExpressionParameterImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.FlusherImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.InserterImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.LocatorImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.UpdaterImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.ValueParameterImpl;
-import org.jboss.tools.smooks.model.persistence12.impl.WiringParameterImpl;
-import org.jboss.tools.smooks.model.rules10.impl.RuleBaseImpl;
import org.jboss.tools.smooks.model.smooks.impl.ConditionTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.ConditionsTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.FeaturesTypeImpl;
@@ -133,11 +88,6 @@
import org.jboss.tools.smooks.model.smooks.impl.SetOffTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.SetOnTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.SmooksResourceListTypeImpl;
-import org.jboss.tools.smooks.model.validation10.impl.RuleTypeImpl;
-import org.jboss.tools.smooks.model.xsl.impl.BindToImpl;
-import org.jboss.tools.smooks.model.xsl.impl.OutputToImpl;
-import org.jboss.tools.smooks.model.xsl.impl.TemplateImpl;
-import org.jboss.tools.smooks.model.xsl.impl.XslImpl;
/**
* @author Dart (dpeng(a)redhat.com)
@@ -182,12 +132,6 @@
map.put(SetOnTypeImpl.class, new SetOnTypeUICreator());
map.put(SmooksResourceListTypeImpl.class, new SmooksResourceListTypeUICreator());
- // for xsl models
- map.put(BindToImpl.class, new BindToUICreator());
- map.put(OutputToImpl.class, new OutputToUICreator());
- map.put(TemplateImpl.class, new TemplateUICreator());
- map.put(XslImpl.class, new XslUICreator());
-
// for freemarker
map.put(org.jboss.tools.smooks.model.freemarker.impl.BindToImpl.class,
new org.jboss.tools.smooks.configuration.editors.freemarker.BindToUICreator());
@@ -199,14 +143,6 @@
new org.jboss.tools.smooks.configuration.editors.freemarker.TemplateUICreator());
map.put(UseImpl.class, new UseUICreator());
- // for groovy
- map.put(GroovyImpl.class, new GroovyUICreator());
- map.put(ScriptTypeImpl.class, new ScriptUICreator());
-
- // for filerouting
- map.put(HighWaterMarkImpl.class, new HighWaterMarkUICreator());
- map.put(OutputStreamImpl.class, new OutputStreamUICreator());
-
// for medi
map.put(ComponentImpl.class, new ComponentUICreator());
map.put(DelimitersImpl.class, new DelimitersUICreator());
@@ -222,27 +158,9 @@
// for JSON 1.2
map.put(Json12ReaderImpl.class, new Json12ReaderUICreator());
-
- // for IO Routing
- map.put(IORouterImpl.class, new IORouterUICreator());
-
- // for JMS
- map.put(HighWaterMarkImpl.class, new HighWaterMarkUICreator());
-
- // for DB routing
- map.put(ExecutorImpl.class, new ExecutorUICreator());
- map.put(ResultSetImpl.class, new ResultSetUICreator());
- map.put(ResultSetRowSelectorImpl.class, new ResultSetRowSelectorUICreator());
-
- // for calc
- map.put(CounterImpl.class, new CounterUICreator());
-
// for datasource
map.put(DirectImpl.class, new DirectUICreator());
map.put(DataSourceJndiImpl.class, new DataSourceJndiUICreator());
-
- // for ESB router
- map.put(RouteBeanImpl.class, new RouteBeanPropertyUICreator());
/*
* up is for smooks1.1
*/
@@ -261,23 +179,6 @@
map.put(org.jboss.tools.smooks.model.javabean12.impl.WiringTypeImpl.class,
new JavabeanWiringBiding12UICreator());
- // for JMS Router v1.2
- map.put(JMS12RouterImpl.class, new JMSRouter12UICreator());
-
- // for Persistence v1.2
- map.put(DeleterImpl.class, new DeleterUICreator());
- map.put(UpdaterImpl.class, new UpdaterUICreator());
- map.put(InserterImpl.class, new InserterUICreator());
- map.put(LocatorImpl.class, new LocatorUICreator());
- map.put(FlusherImpl.class, new FlusherUICreator());
-
- map.put(ValueParameterImpl.class, new LocatorValueParamUICreator());
- map.put(WiringParameterImpl.class, new LocatorWiringParamUICreator());
- map.put(ExpressionParameterImpl.class, new LocatorExpressionParamUICreator());
-
- // for Validation v1.0
- map.put(RuleTypeImpl.class, new RuleUICreator());
-
// for CSV Reader v1.2
map.put(BindingImpl.class, new Csv12ReaderBindingPropertyUICreator());
map.put(MapBindingImpl.class, new Csv12ReaderMapBindingPropertyUICreator());
@@ -285,9 +186,6 @@
// for EDI Reader v1.2
map.put(EDI12ReaderImpl.class, new EDIReader12UICreator());
-
- // for Rules v1.0
- map.put(RuleBaseImpl.class, new Rules10RulebaseUICreator());
}
public void registePropertyUICreator(Class<?> key, IPropertyUICreator creator) {
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -1,812 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.CommandParameter;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.edit.ui.action.CopyAction;
-import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
-import org.eclipse.emf.edit.ui.action.CutAction;
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-import org.eclipse.emf.edit.ui.action.PasteAction;
-import org.eclipse.emf.edit.ui.action.RedoAction;
-import org.eclipse.emf.edit.ui.action.UndoAction;
-import org.eclipse.emf.edit.ui.action.ValidateAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.SubContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-import org.jboss.tools.smooks.configuration.actions.AddSmooksResourceAction;
-import org.jboss.tools.smooks.configuration.actions.ValidateSmooksAction;
-import org.jboss.tools.smooks.configuration.editors.actions.Calc11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Database11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Datasources11ActionGrouper;
-import
org.jboss.tools.smooks.configuration.editors.actions.FragmentRouting11ActionGrouper;
-import
org.jboss.tools.smooks.configuration.editors.actions.FragmentRouting12ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.JavaBean11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.JavaBean12ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.PersistenceActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Reader11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Reader12ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Scripting11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.SeparatorActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Templating11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Validation10ActionGrouper;
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
-import org.jboss.tools.smooks.model.medi.EdiMap;
-import org.jboss.tools.smooks.model.medi.MEdiFactory;
-import org.jboss.tools.smooks.model.medi.MEdiPackage;
-import org.jboss.tools.smooks.model.smooks.DocumentRoot;
-import org.jboss.tools.smooks.model.smooks.SmooksFactory;
-import org.jboss.tools.smooks.model.smooks.SmooksPackage;
-import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
-
-/**
- * This is the action bar contributor for the Smooks model editor. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
-public class SmooksActionBarContributor extends EditingDomainActionBarContributor
implements ISelectionChangedListener {
-
- protected ISelection selection;
- /**
- * This keeps track of the active editor. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- protected IEditorPart activeEditorPart;
-
- /**
- * This keeps track of the current selection provider. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected ISelectionProvider selectionProvider;
-
- /**
- * This action opens the Properties view. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- protected IAction showPropertiesViewAction = new
Action(Messages.SmooksActionBarContributor_OpenProperyViewActionLabel) {
- @Override
- public void run() {
- try {
- getPage().showView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
- } catch (PartInitException exception) {
- SmooksConfigurationActivator.getDefault().log(exception);
- }
- }
- };
-
- protected IAction addSmooks11ResourceListAction = new Action("Add Smooks Resource
List") { //$NON-NLS-1$
-
- @Override
- public void run() {
- addSmooks11ResourceList();
- }
-
- };
-
- protected IAction addSmooks10ResourceListAction = new Action("Add Smooks Resource
List") { //$NON-NLS-1$
-
- @Override
- public void run() {
-// addSmooks10ResourceList();
- }
-
- };
-
- protected IAction addMap10ResourceListAction = new Action("Add MappNode") {
//$NON-NLS-1$
-
- @Override
- public void run() {
- addMapNode();
- }
-
- };
-
- /**
- * This action refreshes the viewer of the current editor if the editor
- * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected IAction refreshViewerAction = new
Action(Messages.SmooksActionBarContributor_RefreshViewActionLabel) {
- @Override
- public boolean isEnabled() {
- return activeEditorPart instanceof IViewerProvider;
- }
-
- @Override
- public void run() {
- if (activeEditorPart instanceof IViewerProvider) {
- Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer();
- if (viewer != null) {
- viewer.refresh();
- }
- }
- }
- };
-
- /**
- * This will contain one
- * {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to
- * each descriptor generated for the current selection by the item provider.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> createChildActions;
-
- /**
- * This is the menu manager into which menu contribution items should be
- * added for CreateChild actions. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @generated
- */
- protected IMenuManager createChildMenuManager;
-
- /**
- * This will contain one
- * {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding
- * to each descriptor generated for the current selection by the item
- * provider. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> createSiblingActions;
-
- /**
- * This is the menu manager into which menu contribution items should be
- * added for CreateSibling actions. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- protected IMenuManager createSiblingMenuManager;
-
- private ValidateSmooksAction validateSmooksAction;
-
- /**
- * This creates an instance of the contributor. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- public SmooksActionBarContributor() {
- super(ADDITIONS_LAST_STYLE);
- // loadResourceAction = new LoadResourceAction();
- validateAction = new ValidateAction();
- // controlAction = new ControlAction();
- }
-
- protected void addMapNode() {
- ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
- EObject model = formEditor.getSmooksModel();
- if (model instanceof org.jboss.tools.smooks.model.medi.DocumentRoot) {
- EdiMap mappingNode = MEdiFactory.eINSTANCE.createEdiMap();
- Command command = AddCommand.create(formEditor.getEditingDomain(), model,
MEdiPackage.eINSTANCE
- .getMappingNode(), mappingNode);
- formEditor.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
-// protected void addSmooks10ResourceList() {
-// ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
-// EObject model = formEditor.getSmooksModel();
-// if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
-// org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
-// .createSmooksResourceListType();
-// Command command = AddCommand.create(formEditor.getEditingDomain(), model,
-// org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
-// resourceList);
-// formEditor.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-
- protected void addSmooks11ResourceList() {
- ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
- EObject model = formEditor.getSmooksModel();
- if (model instanceof DocumentRoot) {
- SmooksResourceListType resourceList =
SmooksFactory.eINSTANCE.createSmooksResourceListType();
- Command command = AddCommand.create(formEditor.getEditingDomain(), model,
SmooksPackage.eINSTANCE
- .getSmooksResourceListType(), resourceList);
- formEditor.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- @Override
- public void update() {
- super.update();
- }
-
- /**
- * This adds Separators for editor additions to the tool bar. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- toolBarManager.add(new Separator("smooks-settings")); //$NON-NLS-1$
- toolBarManager.add(new Separator("smooks-additions")); //$NON-NLS-1$
- }
-
- /**
- * This adds to the menu bar a menu and some separators for editor
- * additions, as well as the sub-menus for object creation items. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void contributeToMenu(IMenuManager menuManager) {
- super.contributeToMenu(menuManager);
-
- IMenuManager submenuManager = new MenuManager("Smooks",
"smooksMenuID"); //$NON-NLS-1$ //$NON-NLS-2$
- menuManager.insertAfter("additions", submenuManager); //$NON-NLS-1$
- submenuManager.add(new Separator("settings")); //$NON-NLS-1$
- submenuManager.add(new Separator("actions")); //$NON-NLS-1$
- submenuManager.add(new Separator("additions")); //$NON-NLS-1$
- submenuManager.add(new Separator("additions-end")); //$NON-NLS-1$
-
- // Prepare for CreateChild item addition or removal.
- //
- createChildMenuManager = new
MenuManager(Messages.SmooksActionBarContributor_AddSmooksReasourceActionLabel);
- submenuManager.insertBefore("additions", createChildMenuManager);
//$NON-NLS-1$
-
- // Prepare for CreateSibling item addition or removal.
- //
- createSiblingMenuManager = new
MenuManager(Messages.SmooksActionBarContributor_NewSiblingActionLabel);
- submenuManager.insertBefore("additions", createSiblingMenuManager);
//$NON-NLS-1$
-
- submenuManager.insertBefore("additions", addSmooks11ResourceListAction);
//$NON-NLS-1$
-
- // Force an update because Eclipse hides empty menus now.
- //
- submenuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager menuManager) {
- menuManager.updateAll(true);
- }
- });
-
- addGlobalActions(submenuManager);
- }
-
- /**
- * When the active editor changes, this remembers the change and registers
- * with it as a selection provider. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- @Override
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
- activeEditorPart = part;
-
- // Switch to the new selection provider.
- //
- if (selectionProvider != null) {
- selectionProvider.removeSelectionChangedListener(this);
- }
- if (part == null) {
- selectionProvider = null;
- } else {
- selectionProvider = part.getSite().getSelectionProvider();
- selectionProvider.addSelectionChangedListener(this);
-
- // Fake a selection changed event to update the menus.
- //
- if (selectionProvider.getSelection() != null) {
- selectionChanged(new SelectionChangedEvent(selectionProvider,
selectionProvider.getSelection()));
- }
- }
- }
-
- @Override
- public void init(IActionBars actionBars) {
- super.init(actionBars);
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
-
- validateSmooksAction = new ValidateSmooksAction();
- validateSmooksAction.setText(Messages.SmooksActionBarContributor_ValidateActionLabel);
-
- cutAction = new CutAction() {
-
- public void runWithEvent(Event event) {
- Widget widget = event.widget;
- if (widget instanceof Text) {
- ((Text) widget).cut();
- return;
- }
- if (widget instanceof Combo) {
- ((Combo) widget).cut();
- return;
- }
- super.runWithEvent(event);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#isEnabled()
- */
- @Override
- public boolean isEnabled() {
- return super.isEnabled();
- }
-
- };
- cutAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
-
- copyAction = new CopyAction() {
-
- public void runWithEvent(Event event) {
- Widget widget = event.widget;
- if (widget instanceof Text) {
- ((Text) widget).copy();
- return;
- }
- if (widget instanceof Combo) {
- ((Combo) widget).copy();
- return;
- }
- super.runWithEvent(event);
- }
-
- };
- copyAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
-
- pasteAction = new PasteAction() {
-
- public void runWithEvent(Event event) {
- Widget widget = event.widget;
- if (widget instanceof Text) {
- ((Text) widget).paste();
- return;
- }
- if (widget instanceof Combo) {
- ((Combo) widget).paste();
- return;
- }
- super.runWithEvent(event);
- }
-
- @Override
- public boolean updateSelection(IStructuredSelection selection) {
- super.updateSelection(selection);
- return true;
- }
-
- };
- pasteAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
-
- undoAction = new UndoAction();
- undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
-
- redoAction = new RedoAction();
- redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
-
- }
-
- /**
- * This implements
- * {@link org.eclipse.jface.viewers.ISelectionChangedListener}, handling
- * {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for
- * the children and siblings that can be added to the selected object and
- * updating the menus accordingly. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @generated
- */
- public void selectionChanged(SelectionChangedEvent event) {
- // Remove any menu items for old selection.
- //
- if (createChildMenuManager != null) {
- depopulateManager(createChildMenuManager, createChildActions);
- }
- if (createSiblingMenuManager != null) {
- depopulateManager(createSiblingMenuManager, createSiblingActions);
- }
-
- // Query the new selection for appropriate new child/sibling descriptors
- //
- Collection<?> newChildDescriptors = null;
- // Collection<?> newSiblingDescriptors = null;
-
- ISelection selection = event.getSelection();
- this.selection = selection;
- if (selection instanceof IStructuredSelection && ((IStructuredSelection)
selection).size() == 1) {
- Object object = ((IStructuredSelection) selection).getFirstElement();
- object = AdapterFactoryEditingDomain.unwrap(object);
- EditingDomain domain = ((IEditingDomainProvider)
activeEditorPart).getEditingDomain();
-
- newChildDescriptors = domain.getNewChildDescriptors(object, null);
-
- validateSmooksAction.setResource(domain.getResourceSet().getResources().get(0));
- validateSmooksAction.setEditingDomain(domain);
- // newSiblingDescriptors = domain.getNewChildDescriptors(null,
- // object);
- }
-
- // Generate actions for selection; populate and redraw the menus.
- //
- createChildActions = generateCreateChildActions(newChildDescriptors, selection);
- // createSiblingActions =
- // generateCreateSiblingActions(newSiblingDescriptors, selection);
-
- if (createChildMenuManager != null) {
- populateManager(createChildMenuManager, createChildActions, null);
- createChildMenuManager.update(true);
- }
- if (createSiblingMenuManager != null) {
- populateManager(createSiblingMenuManager, createSiblingActions, null);
- createSiblingMenuManager.update(true);
- }
- }
-
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction}
- * for each object in <code>descriptors</code>, and returns the collection
- * of these actions. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> generateCreateChildActions(Collection<?>
descriptors, ISelection selection) {
-// return SmooksUIUtils.generateCreateChildActions(activeEditorPart, descriptors,
selection);
- Collection<IAction> actions = new ArrayList<IAction>();
- // if (selection != null && selection.isEmpty() && descriptors !=
null)
- // {
- // CommandParameter cp =
- // createChildParameter(SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE,
- // SmooksFactory.eINSTANCE.createSmooksResourceListType());
- // CommandParameter cp2 =
- // createChildParameter(EdiPackage.Literals.EDI_MAP,
- // EdiFactory.eINSTANCE.createEdiMap());
- // descriptors.add(cp);
- // descriptors.add(cp2);
- // }
- if (descriptors != null) {
- for (Object descriptor : descriptors) {
- actions.add(new AddSmooksResourceAction(activeEditorPart, selection, descriptor));
- }
- }
- return actions;
- }
-
- protected CommandParameter createChildParameter(Object feature, Object child) {
- return new CommandParameter(null, feature, child);
- }
-
- /**
- * This generates a
- * {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each
- * object in <code>descriptors</code>, and returns the collection of these
- * actions. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> generateCreateSiblingActions(Collection<?>
descriptors, ISelection selection) {
- Collection<IAction> actions = new ArrayList<IAction>();
- if (descriptors != null) {
- for (Object descriptor : descriptors) {
- actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
- }
- }
- return actions;
- }
-
- /**
- * This populates the specified <code>manager</code> with
- * {@link org.eclipse.jface.action.ActionContributionItem}s based on the
- * {@link org.eclipse.jface.action.IAction}s contained in the
- * <code>actions</code> collection, by inserting them before the specified
- * contribution item <code>contributionID</code>. If
- * <code>contributionID</code> is <code>null</code>, they are
simply added.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected void populateManager(IContributionManager manager, Collection<? extends
IAction> actions,
- String contributionID) {
- if (actions != null) {
- for (IAction action : actions) {
- if (contributionID != null) {
- manager.insertBefore(contributionID, action);
- } else {
- manager.add(action);
- }
- }
- }
- }
-
- /**
- * This removes from the specified <code>manager</code> all
- * {@link org.eclipse.jface.action.ActionContributionItem}s based on the
- * {@link org.eclipse.jface.action.IAction}s contained in the
- * <code>actions</code> collection. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- protected void depopulateManager(IContributionManager manager, Collection<? extends
IAction> actions) {
- if (actions != null) {
- IContributionItem[] items = manager.getItems();
- for (int i = 0; i < items.length; i++) {
- // Look into SubContributionItems
- //
- IContributionItem contributionItem = items[i];
- while (contributionItem instanceof SubContributionItem) {
- contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
- }
-
- // Delete the ActionContributionItems with matching action.
- //
- if (contributionItem instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem) contributionItem).getAction();
- if (actions.contains(action)) {
- manager.remove(contributionItem);
- }
- }
- }
- }
- }
-
- /**
- * This populates the pop-up menu before it appears. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void menuAboutToShow(IMenuManager menuManager) {
- menuManager.add(new Separator("edit")); //$NON-NLS-1$
- menuManager.add(new ActionContributionItem(undoAction));
- menuManager.add(new ActionContributionItem(redoAction));
- menuManager.add(new Separator());
- menuManager.add(new ActionContributionItem(deleteAction));
- menuManager.add(new Separator());
- menuManager.add(new ActionContributionItem(cutAction));
- menuManager.add(new ActionContributionItem(copyAction));
- menuManager.add(new ActionContributionItem(pasteAction));
- menuManager.add(new Separator());
-
- // if ((style & ADDITIONS_LAST_STYLE) != 0)
- // {
- // menuManager.add(new Separator("additions"));
- // menuManager.add(new Separator());
- // }
- // Add our other standard marker.
- //
- menuManager.add(new Separator("additions-end")); //$NON-NLS-1$
- MenuManager submenuManager = null;
-
- updateRootElementAddAction();
-
- if (addSmooks11ResourceListAction.isEnabled()) {
- menuManager.insertBefore("edit", addSmooks11ResourceListAction);
//$NON-NLS-1$
- }
-
- if (addSmooks10ResourceListAction.isEnabled()) {
- menuManager.insertBefore("edit", addSmooks10ResourceListAction);
//$NON-NLS-1$
- }
-
- if (addMap10ResourceListAction.isEnabled()) {
- menuManager.insertBefore("edit", addMap10ResourceListAction); //$NON-NLS-1$
- }
-
- submenuManager = new
MenuManager(Messages.SmooksActionBarContributor_AddSmooksResourceActionLabel);
- if (isSmooksResourceListElement()) {
- groupActions(submenuManager, createChildActions);
- } else {
- populateManager(submenuManager, createChildActions, null);
- }
- menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
-
- submenuManager = new
MenuManager(Messages.SmooksActionBarContributor_CreateSiblingActionLabel);
- populateManager(submenuManager, createSiblingActions, null);
- menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
- // don't show properties that
- // menuManager.insertAfter("additions-end", showPropertiesViewAction);
- menuManager.insertAfter("additions-end", validateSmooksAction);
//$NON-NLS-1$
- this.addGlobalActions(menuManager);
- }
-
- private boolean isSmooksResourceListElement() {
- if (this.selection != null && selection instanceof IStructuredSelection) {
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (element instanceof SmooksResourceListType) {
- return true;
- }
- }
- return false;
- }
-
- private List<ISmooksActionGrouper> getSmooksActionGrouper() {
- List<ISmooksActionGrouper> grouperList = new
ArrayList<ISmooksActionGrouper>();
-
- grouperList.add(new JavaBean11ActionGrouper());
- grouperList.add(new Reader11ActionGrouper());
- grouperList.add(new Calc11ActionGrouper());
- grouperList.add(new Database11ActionGrouper());
- grouperList.add(new Datasources11ActionGrouper());
- grouperList.add(new FragmentRouting11ActionGrouper());
- grouperList.add(new Scripting11ActionGrouper());
- grouperList.add(new Templating11ActionGrouper());
- grouperList.add(new SeparatorActionGrouper("V1.1-V1.2")); //$NON-NLS-1$
- grouperList.add(new JavaBean12ActionGrouper());
- grouperList.add(new Reader12ActionGrouper());
- grouperList.add(new FragmentRouting12ActionGrouper());
- grouperList.add(new PersistenceActionGrouper());
- grouperList.add(new Validation10ActionGrouper());
- grouperList.add(new SeparatorActionGrouper("No Group actions"));
//$NON-NLS-1$
- return grouperList;
- }
-
- protected void groupActions(MenuManager manager, Collection<?> createChildActions)
{
-
- Map<Object, Object> map = new HashMap<Object, Object>();
-
- List<ISmooksActionGrouper> grouperList = getSmooksActionGrouper();
- for (Iterator<?> iterator1 = grouperList.iterator(); iterator1.hasNext();) {
- ISmooksActionGrouper grouper = (ISmooksActionGrouper) iterator1.next();
- if (grouper.isSeparator()) {
- String name = grouper.getGroupName();
- if(name == null) name = Messages.SmooksActionBarContributor_33;
- Separator s = new Separator(name);
- manager.add(s);
- continue;
- } else {
- String name = grouper.getGroupName();
- if (name != null) {
- MenuManager newMenu = new MenuManager(name);
- manager.add(newMenu);
- map.put(newMenu, grouper);
- }
- }
- }
-
- for (Iterator<?> iterator = createChildActions.iterator(); iterator.hasNext();)
{
- boolean added = false;
- AddSmooksResourceAction action = (AddSmooksResourceAction) iterator.next();
- Object descriptor = action.getDescriptor();
- Iterator<?> menuIterator = map.keySet().iterator();
- while (menuIterator.hasNext()) {
- MenuManager newMenu = (MenuManager) menuIterator.next();
- ISmooksActionGrouper grouper = (ISmooksActionGrouper) map.get(newMenu);
- if (grouper.belongsToGroup(descriptor)) {
- newMenu.add(action);
- added = true;
- break;
- }
- }
-
- if (!added) {
- manager.add(action);
- }
- }
-
- Iterator<?> menuIterator = map.keySet().iterator();
- while (menuIterator.hasNext()) {
- MenuManager newMenu = (MenuManager) menuIterator.next();
- ISmooksActionGrouper grouper = (ISmooksActionGrouper) map.get(newMenu);
- grouper.orderActions(newMenu);
- }
-
- }
-
- protected void updateRootElementAddAction() {
- addSmooks11ResourceListAction.setEnabled(false);
- addMap10ResourceListAction.setEnabled(false);
- addSmooks10ResourceListAction.setEnabled(false);
-
- ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
- EObject model = formEditor.getSmooksModel();
- if (model instanceof DocumentRoot) {
- SmooksResourceListType resourceList =
SmooksFactory.eINSTANCE.createSmooksResourceListType();
- Command command = AddCommand.create(formEditor.getEditingDomain(), model,
SmooksPackage.eINSTANCE
- .getSmooksResourceListType(), resourceList);
- addSmooks11ResourceListAction.setEnabled(command.canExecute());
- }
-
- if (model instanceof org.jboss.tools.smooks.model.medi.DocumentRoot) {
- EdiMap mappingNode = MEdiFactory.eINSTANCE.createEdiMap();
- Command command = AddCommand.create(formEditor.getEditingDomain(), model,
- MEdiPackage.eINSTANCE.getEdiMap(), mappingNode);
- addMap10ResourceListAction.setEnabled(command.canExecute());
- }
-// if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
-// org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
-// .createSmooksResourceListType();
-// Command command = AddCommand.create(formEditor.getEditingDomain(), model,
-// org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
-// resourceList);
-// addSmooks10ResourceListAction.setEnabled(command.canExecute());
-// }
- }
-
- /**
- * This inserts global actions before the "additions-end" separator. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected void addGlobalActions(IMenuManager menuManager) {
- // menuManager.insertAfter("additions-end", new
- // Separator("ui-actions"));
- // menuManager.insertAfter("additions-end", showPropertiesViewAction);
-
- // refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
- // menuManager.insertAfter("ui-actions", refreshViewerAction);
-
- // super.addGlobalActions(menuManager);
- }
-
- /**
- * This ensures that a delete action will clean up all references to deleted
- * objects. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected boolean removeAllReferencesOnDelete() {
- return true;
- }
-
-}
\ No newline at end of file
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -34,7 +34,6 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -53,7 +52,6 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-import org.jboss.tools.smooks.configuration.wizards.NewSmooksElementWizard;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
@@ -372,19 +370,7 @@
}
private void hookButtons() {
- addButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- NewSmooksElementWizard wizard = new NewSmooksElementWizard(editingDomain,
getTreeViewerInput(),
- getViewerFilters(), getNewSmooksElementTitle(), getNewSmooksElementDescription());
- WizardDialog dialog = new WizardDialog(formEditor.getSite().getShell(), wizard);
- dialog.open();
- }
-
- });
-
removeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
List<?> list = getViewerSelections();
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -137,7 +137,6 @@
import org.jboss.tools.smooks.configuration.editors.OpenFileHyperLinkListener;
import org.jboss.tools.smooks.configuration.editors.SelectorAttributes;
import org.jboss.tools.smooks.configuration.editors.SelectorCreationDialog;
-import org.jboss.tools.smooks.configuration.editors.groovy.GroovyUICreator;
import org.jboss.tools.smooks.configuration.editors.input.InputParameter;
import org.jboss.tools.smooks.configuration.editors.input.InputType;
import org.jboss.tools.smooks.configuration.editors.javabean.JavaBeanModel;
@@ -3010,9 +3009,6 @@
if (model instanceof Xsl) {
return XslPackage.Literals.XSL__APPLY_ON_ELEMENT_NS;
}
- if (model instanceof GroovyUICreator) {
- return GroovyPackage.Literals.GROOVY__EXECUTE_ON_ELEMENT_NS;
- }
if (model instanceof ResourceConfigType) {
return SmooksPackage.Literals.RESOURCE_CONFIG_TYPE__SELECTOR_NAMESPACE;
}
@@ -3055,9 +3051,6 @@
if (model instanceof Xsl) {
return XslPackage.Literals.XSL__APPLY_ON_ELEMENT;
}
- if (model instanceof GroovyUICreator) {
- return GroovyPackage.Literals.GROOVY__EXECUTE_ON_ELEMENT;
- }
if (model instanceof ResourceConfigType) {
return SmooksPackage.Literals.RESOURCE_CONFIG_TYPE__SELECTOR;
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.Wizard;
-import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-
-/**
- * @author Dart
- *
- */
-public class NewSmooksElementWizard extends Wizard {
-
- private EObject parentElement;
-
- private AdapterFactoryEditingDomain editingDomain;
-
- private NewSmooksElementWizardPage page;
-
- private ViewerFilter[] filters;
-
- private String text;
-
- private String description;
-
- public NewSmooksElementWizard(AdapterFactoryEditingDomain editingDomain, EObject
parentElement,
- ViewerFilter[] filters, String text, String description) {
- super();
- this.parentElement = parentElement;
- this.editingDomain = editingDomain;
- this.filters = filters;
- this.text = text;
- this.description = description;
- }
-
- @Override
- public void addPages() {
- Collection<?> childDescriptors =
editingDomain.getNewChildDescriptors(parentElement, null);
- Collection<IAction> actions =
SmooksUIUtils.generateCreateChildActions(editingDomain, childDescriptors,
- new StructuredSelection(parentElement));
- page = new NewSmooksElementWizardPage(Messages.NewSmooksElementWizard_Smooks_Elements,
actions , filters , text , description);
-
- this.addPage(page);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- @Override
- public boolean performFinish() {
- final IAction action = page.getSelectedAction();
- if (action != null) {
- try {
- this.getContainer().run(false, false, new IRunnableWithProgress() {
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
- action.run();
- }
- });
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return true;
- }
- return false;
- }
-
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.wizards;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.edit.command.CommandParameter;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-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.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.smooks.configuration.actions.AddSmooksResourceAction;
-import org.jboss.tools.smooks.configuration.editors.actions.Calc11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Database11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Datasources11ActionGrouper;
-import
org.jboss.tools.smooks.configuration.editors.actions.FragmentRouting11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.JavaBean11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.PersistenceActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Reader11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Scripting11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Templating11ActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.Validation10ActionGrouper;
-
-/**
- * @author Dart
- *
- */
-public class NewSmooksElementWizardPage extends org.eclipse.jface.wizard.WizardPage {
-
- private Collection<IAction> childDescriptor = null;
-
- private IAction selectedAction;
-
- private TreeViewer actionViewer = null;
-
- private ViewerFilter[] filters;
-
- public NewSmooksElementWizardPage(String pageName, String title, ImageDescriptor
titleImage,
- Collection<IAction> childDescriptor, ViewerFilter[] filters, String text, String
description) {
- super(pageName, title, titleImage);
- this.childDescriptor = childDescriptor;
- this.setTitle(Messages.NewSmooksElementWizardPage_Page_Title);
- this.setDescription(Messages.NewSmooksElementWizardPage_Page_Description);
- if (text != null) {
- this.setTitle(text);
- }
- if (description != null) {
- this.setDescription(description);
- }
- this.filters = filters;
- }
-
- public NewSmooksElementWizardPage(String pageName, Collection<IAction>
childDescriptor, ViewerFilter[] filters,
- String text, String description) {
- super(pageName);
- this.childDescriptor = childDescriptor;
- this.setTitle(Messages.NewSmooksElementWizardPage_Page_Title);
- this.setDescription(Messages.NewSmooksElementWizardPage_Page_Description);
- if (text != null) {
- this.setTitle(text);
- }
- if (description != null) {
- this.setDescription(description);
- }
- this.filters = filters;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
- * .Composite)
- */
- public void createControl(Composite parent) {
- selectedAction = null;
- actionViewer = new TreeViewer(parent, SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_BOTH);
- actionViewer.getControl().setLayoutData(gd);
-
- actionViewer.setContentProvider(new SmooksElementActionsContentProvider());
- actionViewer.setLabelProvider(new SmooksElementActionsLabelProvider());
- actionViewer.setInput(getActions());
- actionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- selectedAction = (IAction) ((IStructuredSelection)
event.getSelection()).getFirstElement();
- updatePageStatus();
- }
- });
-
- actionViewer.addDoubleClickListener(new IDoubleClickListener() {
-
- public void doubleClick(DoubleClickEvent event) {
- // getWizard().get
- }
- });
- this.setControl(parent);
- }
-
- public IAction getSelectedAction() {
- return selectedAction;
- }
-
- protected void updatePageStatus() {
- this.setPageComplete(true);
- if (selectedAction instanceof GroupAction) {
- this.setPageComplete(false);
- }
- }
-
- private void filterAction() {
- if (this.filters != null) {
- for (Iterator<?> iterator = childDescriptor.iterator(); iterator.hasNext();) {
- AddSmooksResourceAction action = (AddSmooksResourceAction) iterator.next();
- if (!action.isEnabled()) {
- continue;
- }
- for (int i = 0; i < filters.length; i++) {
- ViewerFilter vf = filters[i];
- Object descriptor = action.getDescriptor();
- if (descriptor instanceof CommandParameter) {
- CommandParameter parameter = (CommandParameter) descriptor;
- if (parameter.getValue() != null) {
- Object value = AdapterFactoryEditingDomain.unwrap(parameter.getValue());
- boolean enable = vf.select(null, null, value);
- action.setEnabled(enable);
- if (!enable) {
- break;
- }
- }
- }
- }
- }
-
- }
- }
-
- private Collection<IAction> getActions() {
- filterAction();
- List<IAction> actions = new ArrayList<IAction>();
- List<ISmooksActionGrouper> grouperList = getSmooksActionGrouper();
- for (Iterator<?> iterator = grouperList.iterator(); iterator.hasNext();) {
- ISmooksActionGrouper iSmooksActionGrouper = (ISmooksActionGrouper) iterator.next();
- GroupAction ga = new GroupAction();
- ga.setText(iSmooksActionGrouper.getGroupName());
- fillGroupAction(ga, iSmooksActionGrouper);
- if (!ga.getChildrenAction().isEmpty())
- actions.add(ga);
- }
- List<IAction> tempActions = new ArrayList<IAction>(actions);
- for (Iterator<?> iterator2 = this.childDescriptor.iterator();
iterator2.hasNext();) {
- IAction c = (IAction) iterator2.next();
- boolean exsit = false;
- for (Iterator<?> iterator = tempActions.iterator(); iterator.hasNext();) {
- IAction iAction = (IAction) iterator.next();
- if (iAction instanceof GroupAction) {
- List<IAction> childrenAction = ((GroupAction) iAction).getChildrenAction();
- if (childrenAction.indexOf(c) != -1) {
- exsit = true;
- break;
- }
- }
- }
- if (!exsit && c.isEnabled()) {
- actions.add(c);
- }
- }
-
- return actions;
- }
-
- private void fillGroupAction(GroupAction ga, ISmooksActionGrouper grouper) {
- if (childDescriptor != null) {
- for (Iterator<?> iterator = childDescriptor.iterator(); iterator.hasNext();) {
- AddSmooksResourceAction action = (AddSmooksResourceAction) iterator.next();
- Object descriptor = action.getDescriptor();
- if (grouper.belongsToGroup(descriptor) && action.isEnabled()) {
- ga.addAction(action);
- }
- }
- }
- }
-
- private List<ISmooksActionGrouper> getSmooksActionGrouper() {
- List<ISmooksActionGrouper> grouperList = new
ArrayList<ISmooksActionGrouper>();
-
- grouperList.add(new JavaBean11ActionGrouper());
- grouperList.add(new Reader11ActionGrouper());
- grouperList.add(new Calc11ActionGrouper());
- grouperList.add(new Database11ActionGrouper());
- grouperList.add(new Datasources11ActionGrouper());
- grouperList.add(new FragmentRouting11ActionGrouper());
- grouperList.add(new Scripting11ActionGrouper());
- grouperList.add(new Templating11ActionGrouper());
- // grouperList.add(new SeparatorActionGrouper("V1.1-V1.2"));
-// grouperList.add(new JavaBean12ActionGrouper());
-// grouperList.add(new Reader12ActionGrouper());
-// grouperList.add(new FragmentRouting12ActionGrouper());
- grouperList.add(new PersistenceActionGrouper());
- grouperList.add(new Validation10ActionGrouper());
- // grouperList.add(new SeparatorActionGrouper("No Group actions"));
- return grouperList;
- }
-
- private class SmooksElementActionsContentProvider implements ITreeContentProvider {
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Collection<?>) {
- return ((Collection<?>) parentElement).toArray();
- }
- if (parentElement instanceof GroupAction) {
- return ((GroupAction) parentElement).getChildrenAction().toArray();
- }
- return new Object[] {};
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof Collection<?>)
- return !((Collection<?>) element).isEmpty();
- if (element instanceof GroupAction) {
- return !((GroupAction) element).getChildrenAction().isEmpty();
- }
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof Collection<?>) {
- return ((Collection<?>) inputElement).toArray();
- }
- return new Object[] {};
- }
-
- public void dispose() {
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
- }
-
- private class GroupAction extends Action {
-
- private List<IAction> childrenAction = null;
-
- @Override
- public void run() {
- }
-
- public List<IAction> getChildrenAction() {
- if (childrenAction == null) {
- childrenAction = new ArrayList<IAction>();
- }
- return childrenAction;
- }
-
- public void addAction(IAction action) {
- this.getChildrenAction().add(action);
- }
-
- // public void removeAction(IAction action){
- // this.getChildrenAction().remove(action);
- // }
-
- }
-
- private class SmooksElementActionsLabelProvider extends LabelProvider {
-
- private Map<Object, Object> imageMap = new HashMap<Object, Object>();
-
- @Override
- public void dispose() {
- if (imageMap != null) {
- Collection<?> values = imageMap.values();
- for (Iterator<?> iterator = values.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
- if (object != null && object instanceof Image) {
- ((Image) object).dispose();
- }
- }
- }
- super.dispose();
- }
-
- @Override
- public Image getImage(Object element) {
- if (element instanceof IAction) {
- String key = ((IAction) element).getText();
- Image img = (Image) imageMap.get(key);
- if (img == null) {
- ImageDescriptor id = ((IAction) element).getImageDescriptor();
- if (id == null)
- return null;
- img = id.createImage();
- ((IAction) element).getDisabledImageDescriptor();
- imageMap.put(key, img);
- } else {
-
- }
- return img;
- }
- return super.getImage(element);
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof IAction) {
- return ((IAction) element).getText();
- }
- return super.getText(element);
- }
-
- }
-}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -37,7 +37,6 @@
import org.eclipse.jface.resource.ImageRegistry;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
-import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.gef.tree.model.TriggerConnection;
@@ -89,82 +88,9 @@
.getDescriptor(GraphicsConstants.IMAGE_LINK24)));
root.add(drawer);
- createPaletteDrawer(root);
-
return root;
}
- private void createPaletteDrawer(PaletteRoot root) {
- if (resourceList == null)
- return;
-
- IEditingDomainItemProvider provider = (IEditingDomainItemProvider)
editingDomain.getAdapterFactory().adapt(
- this.resourceList, IEditingDomainItemProvider.class);
- if (provider != null) {
- Collection<?> newChildrenDescripter =
provider.getNewChildDescriptors(this.resourceList, editingDomain,
- null);
- List<ISmooksActionGrouper> grouperList = getSmooksActionGrouper();
- for (Iterator<?> iterator = grouperList.iterator(); iterator.hasNext();) {
- ISmooksActionGrouper iSmooksActionGrouper = (ISmooksActionGrouper) iterator.next();
- PaletteDrawer drawer = new PaletteDrawer(iSmooksActionGrouper.getGroupName());
- fillDrawer(drawer, newChildrenDescripter, iSmooksActionGrouper);
- root.add(drawer);
-
- }
- }
- }
-
- private void fillDrawer(PaletteDrawer drawer, Collection<?> allchildren,
ISmooksActionGrouper grouper) {
- for (Iterator<?> iterator = allchildren.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
-
- if (grouper.belongsToGroup(object)) {
- if (object instanceof CommandParameter) {
- Object v = ((CommandParameter) object).getValue();
- v = AdapterFactoryEditingDomain.unwrap(v);
- v = EcoreUtil.copy((EObject) v);
-
- IEditingDomainItemProvider editDomainIemProvider = (IEditingDomainItemProvider)
editingDomain
- .getAdapterFactory().adapt(v, IEditingDomainItemProvider.class);
- IItemLabelProvider itemLabelProvider = (IItemLabelProvider)
editingDomain.getAdapterFactory()
- .adapt(v, IItemLabelProvider.class);
-
- if (SmooksUIUtils.isUnSupportElement(smooksModelProvider.getPlatformVersion(),
(EObject) v)) {
- continue;
- }
- if (isIgnoreType(v)) {
- continue;
- }
- EClass clazz = ((EObject) v).eClass();
-
- Object newModel = ((CommandParameter) object).getValue();
- if (newModel instanceof FeatureMap.Entry) {
- newModel = FeatureMapUtil.createEntry(((FeatureMap.Entry)
newModel).getEStructuralFeature(), v);
- }
-
- String entryName = clazz.getName();
-
- ImageDescriptor smallImage = null;
- if (itemLabelProvider != null) {
- entryName = itemLabelProvider.getText(v);
- Object imageObj = itemLabelProvider.getImage(v);
- smallImage = ExtendedImageRegistry.getInstance().getImageDescriptor(imageObj);
- }
-
- CombinedTemplateCreationEntry toolEntry = new
CombinedTemplateCreationEntry(entryName, entryName,
- new SmooksModelCreationFactory(newModel, ((CommandParameter)
object).getFeature()),
- smallImage, smallImage);
- drawer.add(toolEntry);
-
- if (needtToCreateChildrenEntry(v)) {
-
- fillDrawer(drawer, editDomainIemProvider.getNewChildDescriptors(v, editingDomain,
null));
- }
- }
- }
- }
- }
-
private boolean isIgnoreType(Object element) {
if (element instanceof ConditionType) {
return true;
@@ -229,25 +155,6 @@
return false;
}
- protected void fillActionGrouper(List<ISmooksActionGrouper> grouperList) {
-
- }
-
- protected List<ISmooksActionGrouper> getSmooksActionGrouper() {
- List<ISmooksActionGrouper> grouperList = new
ArrayList<ISmooksActionGrouper>();
- fillActionGrouper(grouperList);
- // grouperList.add(new Reader11ActionGrouper());
- // grouperList.add(new Calc11ActionGrouper());
- // grouperList.add(new Database11ActionGrouper());
- // grouperList.add(new Datasources11ActionGrouper());
- // grouperList.add(new FragmentRouting11ActionGrouper());
- // grouperList.add(new Scripting11ActionGrouper());
- // grouperList.add(new Templating11ActionGrouper());
- // grouperList.add(new PersistenceActionGrouper());
- // grouperList.add(new Validation10ActionGrouper());
- return grouperList;
- }
-
public class SmooksModelCreationFactory implements CreationFactory {
private Object type = null;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -18,12 +18,9 @@
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.jboss.tools.smooks.configuration.editors.IFieldMarker;
-import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.JavaBean11ActionGrouper;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.gef.common.RootModel;
@@ -159,34 +156,6 @@
* (non-Javadoc)
*
* @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
- * getPaletteRoot()
- */
- // @Override
- protected PaletteRoot getPaletteRoot() {
- SmooksGraphicalEditorPaletteRootCreator creator = new
SmooksGraphicalEditorPaletteRootCreator(
- this.smooksModelProvider, (AdapterFactoryEditingDomain)
this.smooksModelProvider.getEditingDomain(),
- getSmooksResourceListType()) {
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.graphical.editors.
- * SmooksGraphicalEditorPaletteRootCreator
- * #fillActionGrouper(java.util.List)
- */
- @Override
- protected void fillActionGrouper(List<ISmooksActionGrouper> grouperList) {
- grouperList.add(new JavaBean11ActionGrouper());
- }
-
- };
- return creator.createPaletteRoot();
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
* getAutoLayout()
*/
@Override
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import java.util.List;
-
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.jboss.tools.smooks.configuration.editors.actions.AbstractSmooksActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
-import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
-import org.jboss.tools.smooks.gef.tree.model.TreeContainerModel;
-import org.jboss.tools.smooks.graphical.actions.xsltemplate.XSLActionCreator;
-import org.jboss.tools.smooks.graphical.editors.autolayout.IAutoLayout;
-import org.jboss.tools.smooks.graphical.editors.autolayout.XSLMappingAutoLayout;
-import org.jboss.tools.smooks.graphical.editors.model.xsl.XSLTemplateContentProvider;
-import org.jboss.tools.smooks.graphical.editors.model.xsl.XSLTemplateGraphicalModel;
-import org.jboss.tools.smooks.model.xsl.Xsl;
-
-/**
- * @author Dart
- *
- */
-public class SmooksXSLTemplateGraphicalEditor extends SmooksGraphicalEditorPart {
-
- private XSLMappingAutoLayout autoLayout = null;
-
- public SmooksXSLTemplateGraphicalEditor(ISmooksModelProvider provider) {
- super(provider);
- // TODO Auto-generated constructor stub
- }
-
-
-
- /* (non-Javadoc)
- * @see
org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#getAutoLayout()
- */
- @Override
- public IAutoLayout getAutoLayout() {
- if(autoLayout == null){
- autoLayout = new XSLMappingAutoLayout();
- }
- return autoLayout;
- }
-
-
-
- /* (non-Javadoc)
- * @see
org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#createActions()
- */
- @Override
- protected void createActions() {
- super.createActions();
- XSLActionCreator creator = new XSLActionCreator();
- creator.registXSLActions(getActionRegistry(), getSelectionActions(), this);
- }
-
-
-
- /* (non-Javadoc)
- * @see
org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#getPaletteRoot()
- */
-// @Override
- protected PaletteRoot getPaletteRoot() {
- SmooksGraphicalEditorPaletteRootCreator creator = new
SmooksGraphicalEditorPaletteRootCreator(
- this.smooksModelProvider, (AdapterFactoryEditingDomain)
this.smooksModelProvider.getEditingDomain(),
- getSmooksResourceListType()){
-
- /* (non-Javadoc)
- * @see
org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPaletteRootCreator#fillActionGrouper(java.util.List)
- */
- @Override
- protected void fillActionGrouper(List<ISmooksActionGrouper> grouperList) {
- AbstractSmooksActionGrouper xslgrouper = new AbstractSmooksActionGrouper() {
-
- public String getGroupName() {
- return Messages.SmooksXSLTemplateGraphicalEditor_Group_Name;
- }
-
- @Override
- protected boolean canAdd(Object value) {
- if (value instanceof Xsl) {
- return true;
- }
- return false;
- }
- };
- grouperList.add(xslgrouper);
- }
-
- };
- return creator.createPaletteRoot();
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
- * createConnectionModelFactory()
- */
- @Override
- protected ConnectionModelFactory createConnectionModelFactory() {
- return new XSLTemplateConnectionModelFactory();
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
- * createGraphicalModelFactory()
- */
- @Override
- protected GraphicalModelFactory createGraphicalModelFactory() {
- return new XSLTemplateGraphicalModelFactory();
- }
-
- private class XSLTemplateConnectionModelFactory extends ConnectionModelFactoryImpl {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.jboss.tools.smooks.graphical.editors.ConnectionModelFactoryImpl
- * #hasBeanIDConnection
- * (org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel)
- */
- @Override
- public boolean hasBeanIDConnection(AbstractSmooksGraphicalModel model) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.jboss.tools.smooks.graphical.editors.ConnectionModelFactoryImpl
- * #hasSelectorConnection
- * (org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel)
- */
- @Override
- public boolean hasSelectorConnection(AbstractSmooksGraphicalModel model) {
- return false;
- }
- }
-
- private class XSLTemplateGraphicalModelFactory extends GraphicalModelFactoryImpl {
- /*
- * (non-Javadoc)
- *
- * @see
- * org.jboss.tools.smooks.graphical.editors.GraphicalModelFactoryImpl
- * #createGraphicalModel(java.lang.Object,
- * org.jboss.tools.smooks.editor.ISmooksModelProvider)
- */
- @Override
- public Object createGraphicalModel(Object model, ISmooksModelProvider provider) {
- if (canCreateGraphicalModel(model, provider)) {
- AbstractSmooksGraphicalModel graphModel = null;
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)
provider.getEditingDomain();
- ITreeContentProvider contentProvider = new
AdapterFactoryContentProvider(editingDomain
- .getAdapterFactory());
- ILabelProvider labelProvider =
createLabelProvider(editingDomain.getAdapterFactory());
-
- if (model instanceof Xsl) {
- graphModel = new XSLTemplateGraphicalModel(model, new
XSLTemplateContentProvider(contentProvider),
- new XSLLabelProvider(labelProvider), provider);
- ((TreeContainerModel) graphModel).setHeaderVisable(true);
- }
- if (graphModel != null) {
- return graphModel;
- }
- return super.createGraphicalModel(graphModel, provider);
- }
- return null;
- }
-
- }
-
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/XSLLabelProvider.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/XSLLabelProvider.java 2010-04-01
15:41:39 UTC (rev 21201)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/XSLLabelProvider.java 2010-04-01
16:02:12 UTC (rev 21202)
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.smooks.configuration.editors.xml.TagPropertyObject;
-import org.jboss.tools.smooks.configuration.editors.xml.XMLStructuredDataLabelProvider;
-import org.jboss.tools.smooks.configuration.editors.xml.XSLModelAnalyzer;
-import org.jboss.tools.smooks.configuration.editors.xml.XSLTagObject;
-import org.jboss.tools.smooks.model.xsl.Xsl;
-
-/**
- * @author Dart
- *
- */
-public class XSLLabelProvider extends LabelProvider {
-
- private XMLStructuredDataLabelProvider provider = new XMLStructuredDataLabelProvider();
-
- private ILabelProvider parentLabelProvider = null;
-
- public XSLLabelProvider(ILabelProvider parentLabelProvider) {
- this.parentLabelProvider = parentLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof Xsl) {
- return parentLabelProvider.getText(element);
- }
- if (element instanceof TagPropertyObject) {
- String name = ((TagPropertyObject) element).getName();
- String value = ((TagPropertyObject) element).getValue();
- if (value == null || value.trim().length() == 0 ) {
- return name + Messages.XSLLabelProvider_Text_Null_Value;
- }
- }
- if(element instanceof XSLTagObject){
- if(XSLModelAnalyzer.isXSLTagObject((XSLTagObject)element)){
- if(((XSLTagObject)element).isTemplateElement()){
- String match = ((XSLTagObject)element).getMatchValue();
- String name = ((XSLTagObject)element).getName();
- if (match != null) {
- match = match.trim();
- if (!"".equals(match)) { //$NON-NLS-1$
- return name + " (" + match+")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
-
- if(XSLModelAnalyzer.isXSLTagObject((XSLTagObject)element)){
- if(((XSLTagObject)element).isApplyTemplatesElement()){
- String select = ((XSLTagObject)element).getSelectValue();
- String name = ((XSLTagObject)element).getName();
- if (select != null) {
- select = select.trim();
- if (!"".equals(select)) { //$NON-NLS-1$
- return name + " -> " + select; //$NON-NLS-1$
- }
- }
- }
- }
- }
- return provider.getText(element);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage(Object element) {
- if (element instanceof Xsl) {
- return parentLabelProvider.getImage(element);
- }
-
- return provider.getImage(element);
- }
-}