JBoss Tools SVN: r19537 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-22 11:28:27 -0500 (Tue, 22 Dec 2009)
New Revision: 19537
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5559
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-12-22 15:31:52 UTC (rev 19536)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-12-22 16:28:27 UTC (rev 19537)
@@ -13,14 +13,15 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -30,9 +31,6 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Preferences;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
@@ -60,6 +58,7 @@
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
@@ -85,6 +84,7 @@
import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
import org.jboss.tools.seam.internal.core.project.facet.DataSourceXmlDeployer;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegate;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
import org.jboss.tools.seam.ui.ISeamHelpContextIds;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
@@ -107,6 +107,8 @@
private Control[] dependentServerControls;
private Combo serverRuntimeTargetCombo;
+ private IPreset oldPreset;
+
public SeamProjectWizard() {
super();
setWindowTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_NEW_SEAM_PROJECT);
@@ -161,6 +163,13 @@
public void handleEvent(IFacetedProjectEvent event) {
IPreset preset = getFacetedProjectWorkingCopy().getSelectedPreset();
if(preset!=null) {
+ Set<IProjectFacetVersion> facets = preset.getProjectFacets();
+ for (IProjectFacetVersion facet : facets) {
+ if(SeamFacetInstallDelegate.SEAM_FACET_ID.equals(facet.getProjectFacet().getId())) {
+ oldPreset = null;
+ break;
+ }
+ }
setSeamConfigTemplate(templates.get(preset.getId()));
}
}
@@ -182,7 +191,44 @@
firstPage.isPageComplete();
}
- private void synchSeamActionModels() {
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard#setRuntimeAndDefaultFacets(org.eclipse.wst.common.project.facet.core.runtime.IRuntime)
+ */
+ @Override
+ protected void setRuntimeAndDefaultFacets(IRuntime runtime) {
+ IPreset preset = getFacetedProjectWorkingCopy().getSelectedPreset();
+ if(preset!=null) {
+ oldPreset = preset;
+ }
+ IFacetedProjectWorkingCopy dm = getFacetedProjectWorkingCopy();
+ dm.setTargetedRuntimes(Collections.<IRuntime> emptySet());
+ boolean dontUseRuntimeConfig = false;
+ if (runtime != null) {
+ if(oldPreset!=null) {
+ dm.setProjectFacets(oldPreset.getProjectFacets());
+ dontUseRuntimeConfig = true;
+ } else {
+ Set<IProjectFacetVersion> minFacets = new HashSet<IProjectFacetVersion>();
+ try {
+ for (IProjectFacet f : dm.getFixedProjectFacets()) {
+ minFacets.add(f.getLatestSupportedVersion(runtime));
+ }
+ } catch (CoreException e) {
+ throw new RuntimeException(e);
+ }
+ dm.setProjectFacets(minFacets);
+ }
+ dm.setTargetedRuntimes(Collections.singleton(runtime));
+ }
+ if(dontUseRuntimeConfig) {
+ dm.setSelectedPreset(oldPreset.getId());
+ } else {
+ dm.setSelectedPreset(FacetedProjectFramework.DEFAULT_CONFIGURATION_PRESET_ID);
+ }
+ }
+
+ private void synchSeamActionModels() {
Set<Action> actions = getFacetedProjectWorkingCopy().getProjectFacetActions();
for (Action action : actions) {
if(ISeamFacetDataModelProperties.SEAM_FACET_ID.equals(action.getProjectFacetVersion().getProjectFacet().getId())) {
15 years, 1 month
JBoss Tools SVN: r19536 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa: process/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-12-22 10:31:52 -0500 (Tue, 22 Dec 2009)
New Revision: 19536
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5430 - fixed; https://jira.jboss.org/jira/browse/JBIDE-5330 - fixed for "Generate Hibernate/JPA Annotations"
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-12-22 14:27:00 UTC (rev 19535)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-12-22 15:31:52 UTC (rev 19536)
@@ -128,7 +128,7 @@
return;
}
Iterator<ICompilationUnit> it = compileUnitCollector.setSelectionCUIterator();
- /**/
+ collector.initCollector();
while (it.hasNext()) {
ICompilationUnit cu = it.next();
collector.collect(cu);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java 2009-12-22 14:27:00 UTC (rev 19535)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java 2009-12-22 15:31:52 UTC (rev 19536)
@@ -10,10 +10,14 @@
******************************************************************************/
package org.hibernate.eclipse.jdt.ui.internal.jpa.process.wizard;
+import java.util.Iterator;
+import java.util.Map;
+
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
@@ -46,7 +50,10 @@
@SuppressWarnings("restriction")
public class EntitiesList extends UserInputWizardPage {
- protected final int COLUMN_CLASS = 0;
+ private enum Columns {
+ PROJECT,
+ CLASS,
+ }
protected TableViewer listViewer;
@@ -80,17 +87,43 @@
if (listViewer != null) {
listViewer.setContentProvider(createContentProvider(data));
listViewer.setInput(data.getEntities());
+ //
+ for (int i = 0; i < listViewer.getTable().getColumnCount(); i++) {
+ String property = (String)listViewer.getColumnProperties()[i];
+ if (Columns.PROJECT.toString().equals(property)) {
+ listViewer.getTable().getColumn(i).setWidth(isOneProject() ? 0 : 200);
+ listViewer.getTable().getColumn(i).setResizable(!isOneProject());
+ listViewer.getTable().getColumn(i).pack();
+ break;
+ }
+ }
}
}
+ public boolean isOneProject() {
+ Map<String, EntityInfo> mapEntities = data.getEntities();
+ Iterator<EntityInfo> it = mapEntities.values().iterator();
+ boolean res = true;
+ String javaProjectName = null;
+ while (it.hasNext()) {
+ EntityInfo ei = it.next();
+ if (javaProjectName != null && !javaProjectName.equalsIgnoreCase(ei.getJavaProjectName())) {
+ res = false;
+ break;
+ }
+ javaProjectName = ei.getJavaProjectName();
+ }
+ return res;
+ }
+
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 1;
- Label label = new Label(container, SWT.NULL);
- label.setText(JdtUiMessages.AllEntitiesProcessor_message);
+ //Label label = new Label(container, SWT.NULL);
+ //label.setText(JdtUiMessages.AllEntitiesProcessor_message);
listViewer = new TableViewer(container, SWT.SINGLE | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.BORDER);
@@ -100,37 +133,16 @@
| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
gridData.heightHint = convertHeightInCharsToPixels(10);
control.setLayoutData(gridData);
+ String[] columnProperties = new String[] {
+ Columns.CLASS.toString(), Columns.PROJECT.toString(),
+ };
+ listViewer.setColumnProperties(columnProperties);
listViewer.setContentProvider(createContentProvider(data));
- listViewer.setLabelProvider(new LabelProvider() {
-
- private Image classImage;
-
- {
- classImage = JavaElementImageProvider.getTypeImageDescriptor(false, false, 0, false).createImage();
-
- }
- @Override
- public String getText(Object element) {
- EntityInfo info = (EntityInfo) element;
- return info.getFullyQualifiedName();
- }
-
- @Override
- public Image getImage(Object element) {
- return classImage;
- }
-
- @Override
- public void dispose() {
- classImage.dispose();
- super.dispose();
- }
- });
-
+ listViewer.setLabelProvider(new TableLableProvider(listViewer));
+ createTableColumns(listViewer.getTable());
listViewer.setInput(data.getEntities());
listViewer.getTable().setHeaderVisible(true);
listViewer.getTable().setLinesVisible(true);
- createTableColumns(listViewer.getTable());
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
.grab(true, true)
.hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
@@ -150,11 +162,9 @@
int idx = 0;
if (params.getAnnotationStyle().equals(AnnotStyle.FIELDS)) {
idx = 0;
- }
- else if (params.getAnnotationStyle().equals(AnnotStyle.GETTERS)) {
+ } else if (params.getAnnotationStyle().equals(AnnotStyle.GETTERS)) {
idx = 1;
- }
- else if (params.getAnnotationStyle().equals(AnnotStyle.AUTO)) {
+ } else if (params.getAnnotationStyle().equals(AnnotStyle.AUTO)) {
idx = 2;
}
generateChoice.select(idx);
@@ -234,10 +244,53 @@
}
protected void createTableColumns(Table table) {
+
TableColumn column = null;
+ int i = 0;
- column = new TableColumn(table, SWT.LEFT, COLUMN_CLASS);
+ column = new TableColumn(table, SWT.LEFT, i++);
column.setText(JdtUiMessages.ResolveAmbiguous_column_Class);
column.setWidth(200);
+
+ column = new TableColumn(table, SWT.LEFT, i++);
+ column.setText(JdtUiMessages.NewHibernateMappingFilePage_project_name_column);
+ column.setWidth(isOneProject() ? 0: 200);
+ column.setResizable(!isOneProject());
}
+
+ protected class TableLableProvider extends LabelProvider implements ITableLabelProvider {
+
+ protected final TableViewer tv;
+
+ protected Image classImage = JavaElementImageProvider.getTypeImageDescriptor(false, false, 0, false).createImage();
+
+ public TableLableProvider(TableViewer tv) {
+ this.tv = tv;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ String property = (String) tv.getColumnProperties()[columnIndex];
+ if (Columns.CLASS.toString().equals(property)) {
+ return classImage;
+ }
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ String property = (String) tv.getColumnProperties()[columnIndex];
+ EntityInfo info = (EntityInfo) element;
+ if (Columns.CLASS.toString().equals(property)) {
+ return info.getFullyQualifiedName();
+ } else if (Columns.PROJECT.toString().equals(property)) {
+ return info.getJavaProjectName();
+ }
+ return "";//$NON-NLS-1$
+ }
+
+ @Override
+ public void dispose() {
+ classImage.dispose();
+ super.dispose();
+ }
+ }
}
15 years, 1 month
JBoss Tools SVN: r19535 - 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-12-22 09:27:00 -0500 (Tue, 22 Dec 2009)
New Revision: 19535
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.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/converters/ConverterConstants.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5552
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-22 14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-22 14:27:00 UTC (rev 19535)
@@ -31,6 +31,9 @@
class="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"/>
<xclass id="org.jboss.tools.esb.core.model.ESBRouteToImpl"
class="org.jboss.tools.esb.core.model.ESBRouteToImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.EJBParamImpl"
+ class="org.jboss.tools.esb.core.model.EJBParamImpl"/>
+
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddGenericActionSupport"
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-12-22 14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-12-22 14:27:00 UTC (rev 19535)
@@ -534,10 +534,11 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="action" name="ESBPreActionEJBProcessor120">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBPreEJBParam"/>
</XChildrenEntities>
<XEntityRenderer>
<ICONS>
@@ -587,7 +588,17 @@
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"/>
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add EJB Param..." kind="action" name="AddEJBParam">
+ <EntityData EntityName="ESBPreEJBParam">
+ <AttributeData AttributeName="index"/>
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="type" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -787,7 +798,7 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="action" name="ESBPreActionHTTPRouter120">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -1438,7 +1449,7 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="action" name="ESBPreActionSOAPProxy120">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -1762,7 +1773,7 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
XMLSUBPATH="action" name="ESBPreActionSmooksAction101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -2482,6 +2493,41 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.EJBParamImpl"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=arg"
+ XMLSUBPATH="arg" name="ESBPreEJBParam">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="EJB param" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true" name="index">
+ <Constraint loader="Int"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name" xmlname="text"/>
+ <XModelAttribute PROPERTIES="category=general" name="type" xmlname="type">
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=fieldalias"
XMLSUBPATH="field-alias" name="ESBPreFieldAlias">
@@ -2508,24 +2554,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2553,24 +2585,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2601,24 +2619,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2646,24 +2650,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2691,7 +2681,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="entity=AnyElement" WizardClassName="%Default%"
+ PROPERTIES="entity=ESBPreTarget" WizardClassName="%Default%"
displayName="Add Target..." kind="action" name="CreateTarget">
<EntityData EntityName="ESBPreTarget">
<AttributeData AttributeName="class"/>
@@ -2793,24 +2783,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2837,24 +2813,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2890,24 +2852,10 @@
</XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-22 14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-22 14:27:00 UTC (rev 19535)
@@ -1823,7 +1823,7 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.esb.core.model.ESBPropertyImpl"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="property" name="ESBProperty">
<XChildrenEntities>
<XChildEntity name="AnyElement"/>
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java 2009-12-22 14:27:00 UTC (rev 19535)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.esb.core.model;
+
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.impl.CustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class EJBParamImpl extends CustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public EJBParamImpl() {}
+
+ public String getPresentationString() {
+ return getAttributeValue("index") + " " + getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-12-22 14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2009-12-22 14:27:00 UTC (rev 19535)
@@ -63,6 +63,7 @@
propertyConverters.put("attributealias", ConverterConstants.ATTRIBUTE_ALIAS_CONVERTER);
propertyConverters.put("converter", ConverterConstants.CONVERTER_CONVERTER);
propertyConverters.put("routernamespace", ConverterConstants.ROUTER_NAMESPACES_CONVERTER);
+ propertyConverters.put("arg", ConverterConstants.EJB_PARAM_CONVERTER);
}
public boolean isPreActionEntity(XModelObject object) {
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java 2009-12-22 14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java 2009-12-22 14:27:00 UTC (rev 19535)
@@ -65,4 +65,7 @@
String ATTRIBUTE_ALIASES = "attribute-aliases";
IPropertyConverter ATTRIBUTE_ALIAS_CONVERTER = new BasicListConverter(ATTRIBUTE_ALIASES, ATTRIBUTE_ALIAS_ENTITY);
+ String EJB_PARAM_ENTITY = "ESBPreEJBParam";
+ String EJB_PARAMS = "ejb-params";
+ IPropertyConverter EJB_PARAM_CONVERTER = new EJBParamConverter(EJB_PARAMS, EJB_PARAM_ENTITY);
}
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java 2009-12-22 14:27:00 UTC (rev 19535)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.esb.core.model.converters;
+
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class EJBParamConverter extends BasicListConverter {
+
+ public EJBParamConverter(String propertyName, String itemEntityName) {
+ super(propertyName, itemEntityName);
+ }
+
+ protected boolean isRelevantTag(String tag, XModelObject object) {
+ if(object == null || tag == null) {
+ return false;
+ }
+ String baseName = object.getModelEntity().getXMLSubPath();
+ if(!tag.startsWith(baseName)) {
+ return false;
+ }
+ String suff = tag.substring(baseName.length());
+ if(suff.length() == 0) {
+ return false;
+ }
+ int index = 0;
+ try {
+ index = Integer.parseInt(suff);
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ object.setAttributeValue("index", "" + index);
+ return true;
+ }
+
+ protected String getTagName(XModelObject specific, int index) {
+ return "" + super.getTagName(specific, index) + "" + specific.getAttributeValue("index");
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2009-12-22 14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2009-12-22 14:27:00 UTC (rev 19535)
@@ -58,12 +58,12 @@
basicAction.addChild(p);
}
- public static XModelObject fromAnyElement(XModelObject any, String toEntity) {
+ public XModelObject fromAnyElement(XModelObject any, String toEntity) {
String tag = any.getAttributeValue("tag");
Map<String, String> attr = toMap(((AnyElementObjectImpl)any).getAttributes());
XModelObject a = any.getModel().createModelObject(toEntity, null);
- if(a == null || tag == null || !tag.equals(a.getModelEntity().getXMLSubPath())) {
+ if(!isRelevantTag(tag, a)) {
return null;
}
@@ -101,9 +101,13 @@
return a;
}
- public static XModelObject toAnyElement(XModelObject specific, int index) {
+ protected boolean isRelevantTag(String tag, XModelObject object) {
+ return (object != null && tag != null && tag.equals(object.getModelEntity().getXMLSubPath()));
+ }
+
+ public XModelObject toAnyElement(XModelObject specific, int index) {
XModelObject t = specific.getModel().createModelObject("AnyElement", null);
- t.setAttributeValue("tag", specific.getModelEntity().getXMLSubPath());
+ t.setAttributeValue("tag", getTagName(specific, index));
StringBuffer sb = new StringBuffer();
XModelEntity entity = specific.getModelEntity();
XAttribute[] attrs = entity.getAttributes();
@@ -142,7 +146,11 @@
return t;
}
- static Map<String, String> toMap(String[][] attributes) {
+ protected String getTagName(XModelObject specific, int index) {
+ return specific.getModelEntity().getXMLSubPath();
+ }
+
+ protected Map<String, String> toMap(String[][] attributes) {
Map<String,String> map = new HashMap<String, String>();
for (int i = 0; i < attributes.length; i++) {
map.put(attributes[i][0], attributes[i][1]);
15 years, 1 month
JBoss Tools SVN: r19534 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor/template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-12-22 09:21:09 -0500 (Tue, 22 Dec 2009)
New Revision: 19534
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5470, "Add" button was added, edit dialog was updated: tag name and tag uri fields were added, messages were updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2009-12-22 11:56:18 UTC (rev 19533)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2009-12-22 14:21:09 UTC (rev 19534)
@@ -28,10 +28,12 @@
import org.jboss.tools.vpe.editor.template.VpeAnyData;
import org.jboss.tools.vpe.editor.template.VpeEditAnyDialog;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.messages.VpeUIMessages;
public class TemplatesPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage, CommandBarListener {
+ static String ADD = VpeUIMessages.TemplatesPreferencePage_Add;
static String EDIT = VpeUIMessages.TemplatesPreferencePage_Edit;
static String REMOVE = VpeUIMessages.TemplatesPreferencePage_Remove;
protected TemplatesTableProvider tableProvider;// = new TemplatesTableProvider();
@@ -57,7 +59,7 @@
bar.getLayout().buttonWidth = 80;
bar.getLayout().direction = SWT.VERTICAL;
- bar.setCommands(new String[]{EDIT, REMOVE});
+ bar.setCommands(new String[]{ADD, EDIT, REMOVE});
bar.addCommandBarListener(this);
table.setTableProvider(tableProvider);
}
@@ -80,6 +82,7 @@
widgetSelected(e);
}
});
+
update();
return c;
}
@@ -89,7 +92,9 @@
public void action(String command) {
int index = table.getSelectionIndex();
- if(EDIT.equals(command)) {
+ if(ADD.equals(command)) {
+ add(index);
+ } else if(EDIT.equals(command)) {
edit(index);
} else if(REMOVE.equals(command)) {
remove(index);
@@ -103,6 +108,15 @@
return super.performOk();
}
+ void add(int index) {
+ VpeAnyData data = new VpeAnyData(Constants.EMPTY, Constants.EMPTY, Constants.EMPTY);
+ VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data);
+ editDialog.open();
+ if(data.isChanged()){
+ VpeTemplateManager.getInstance().setAnyTemplate(data);
+ }
+ }
+
void edit(int index) {
VpeAnyData data = (VpeAnyData)dataList.get(index);
VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2009-12-22 11:56:18 UTC (rev 19533)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2009-12-22 14:21:09 UTC (rev 19534)
@@ -10,15 +10,21 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template;
+import java.io.IOException;
+import java.net.URL;
import java.text.MessageFormat;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -35,6 +41,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.outline.cssdialog.CSSStyleDialog;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
@@ -43,6 +50,9 @@
import org.jboss.tools.vpe.editor.Message;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilderException;
import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.jboss.tools.vpe.resref.Activator;
+import org.jboss.tools.vpe.resref.core.Messages;
+import org.osgi.framework.Bundle;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -54,25 +64,51 @@
public class VpeEditAnyDialog extends TitleAreaDialog {
private VpeAnyData data;
- private CheckControl ctlChildren;
+ private Button childrenCheckbox;
private Text txtTagForDisplay;
private Text txtValue;
private Text txtStyle;
private VpeEditAnyDialogValidator templateVerifier;
+ private final String DIALOG_TITLE_IMAGE_PATH = "/images/xstudio/wizards/EclipseDefault.png"; //$NON-NLS-1$
public VpeEditAnyDialog(Shell shell, VpeAnyData data) {
super(shell);
this.data = data;
+ setHelpAvailable(false);
}
@Override
protected Control createDialogArea(Composite parent) {
- templateVerifier = new VpeEditAnyDialogValidator();
+ /*
+ * Setting dialog Title, Message, Image.
+ */
+ Bundle bundle = Platform.getBundle(ModelUIPlugin.PLUGIN_ID);
+ URL url = null;
+ if (null != bundle) {
+ try {
+ url = FileLocator.resolve(bundle.getEntry(DIALOG_TITLE_IMAGE_PATH));
+ } catch (IOException e) {
+ Activator.getDefault().logError(
+ NLS.bind(Messages.VRD_TITLE_IMAGE_CANNOT_BE_RESOLVED,
+ url), e);
+ }
+ }
+ if (null != url) {
+ ImageDescriptor image = ImageDescriptor.createFromURL(url);
+ setTitleImage(image.createImage(null));
+ }
getShell().setText(VpeUIMessages.TEMPLATE);
setTitle(VpeUIMessages.TAG_ATTRIBUTES);
-
- setMessage(getDefaultMessage());
-
+ setMessage(VpeUIMessages.UNKNOWN_TAGS_DIALOG_DESCRIPTION);
+
+ /*
+ * Create validator
+ */
+ templateVerifier = new VpeEditAnyDialogValidator();
+
+ /*
+ * Create composites.
+ */
Composite topComposite = (Composite)super.createDialogArea(parent);
((GridData)topComposite.getLayoutData()).widthHint = 300;
@@ -82,51 +118,118 @@
gridLayout.marginHeight = 20;
gridLayout.horizontalSpacing = 5;
composite.setLayout(gridLayout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setBackground(parent.getBackground());
composite.setForeground(parent.getForeground());
composite.setFont(parent.getFont());
- //added by estherbin https://jira.jboss.org/jira/browse/JBIDE-2521
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- Label tagFDisplayLabel = makeLabel(composite, VpeUIMessages.TAG_FOR_DISPLAY);
+ /*
+ * Create Tag Name label
+ */
+ Label tagNameLabel = new Label(composite, SWT.NONE);
+ tagNameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false, 1, 1));
+ tagNameLabel.setText(VpeUIMessages.TAG_NAME);
+
+ /*
+ * Create Tag Name value
+ */
+ Text tagName = new Text(composite, SWT.BORDER);
+ tagName.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));
+ String text = Constants.EMPTY;
+ if ((data != null) && (data.getName() != null)){
+ text = data.getName();
+ }
+ tagName.setText(text);
+
+ /*
+ * Create Tag URI label
+ */
+ Label tagUriLabel = new Label(composite, SWT.NONE);
+ tagUriLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false, 1, 1));
+ tagUriLabel.setText(VpeUIMessages.TAG_URI);
+
+ /*
+ * Create Tag URI value
+ */
+ Text tagUri = new Text(composite, SWT.BORDER);
+ tagUri.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));
+ text = Constants.EMPTY;
+ if ((data != null) && (data.getUri() != null)) {
+ text = data.getUri();
+ }
+ tagUri.setText(text);
+
+ /*
+ * Create Tag for display label
+ */
+ Label tagForDisplayLabel = new Label(composite, SWT.NONE);
+ tagForDisplayLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false, 1, 1));
+ tagForDisplayLabel.setText(VpeUIMessages.TAG_FOR_DISPLAY);
- tagFDisplayLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- txtTagForDisplay = new Text(composite,SWT.BORDER);
- gd.horizontalSpan=2;
- txtTagForDisplay.setLayoutData(gd);
- txtTagForDisplay.setText(data.getTagForDisplay() != null ? data.getTagForDisplay() : ""); //$NON-NLS-1$
+ /*
+ * Create Tag for display value
+ */
+ txtTagForDisplay = new Text(composite, SWT.BORDER);
+ txtTagForDisplay.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));
+ text = Constants.EMPTY;
+ if ((data != null) && (data.getTagForDisplay() != null)) {
+ text = data.getTagForDisplay();
+ }
+ txtTagForDisplay.setText(text);
txtTagForDisplay.addModifyListener(templateVerifier);
-// txtTagForDisplay.select(tagNameItemIndex);
+ /*
+ * Create Children label
+ */
+ Label childrenCheckboxLabel = new Label(composite, SWT.NONE);
+ childrenCheckboxLabel.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false, 1, 1));
+ childrenCheckboxLabel.setText(VpeUIMessages.CHILDREN);
+
+ /*
+ * Create check box for Children
+ */
+ childrenCheckbox = new Button(composite, SWT.CHECK);
+ childrenCheckbox.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, true, false, 2, 1));
-// ctlCaseSensitive = new CheckControl(composite, "Case sensitive", data.isCaseSensitive());
- ctlChildren = new CheckControl(composite, VpeUIMessages.CHILDREN, data.isChildren());
-// ctlModify = new CheckControl(composite, "Modify", data.isModify());
-
- //value control
- Label lblValue = makeLabel(composite, VpeUIMessages.VALUE);
- lblValue.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ /*
+ * Create value label
+ */
+ Label lblValue = new Label(composite, SWT.NONE);
+ lblValue.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false, 1, 1));
+ lblValue.setText( VpeUIMessages.VALUE);
+
+ /*
+ * Create value
+ */
txtValue = new Text(composite, SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- txtValue.setLayoutData(gd);
+ txtValue.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));
txtValue.setText(data.getValue() != null ? data.getValue() : ""); //$NON-NLS-1$
txtValue.addModifyListener(templateVerifier);
- //style control
- Label lbStyle = makeLabel(composite, VpeUIMessages.STYLE);
- lbStyle.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ /*
+ * Create style label
+ */
+ Label lbStyle = new Label(composite, SWT.NONE);
+ lbStyle.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false, 1, 1));
+ lbStyle.setText(VpeUIMessages.TAG_STYLE);
+
+ /*
+ * Create style value
+ */
txtStyle = new Text(composite, SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 1;
- gd.grabExcessHorizontalSpace = true;
- txtStyle.setLayoutData(gd);
- txtStyle.setText(data.getStyle() !=null ? data.getStyle() : ""); //$NON-NLS-1$
+ txtStyle.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1));
+ text = Constants.EMPTY;
+ if ((data != null) && (data.getStyle() != null)) {
+ text = data.getStyle();
+ }
+ txtStyle.setText(text);
+ /*
+ * Create style button
+ */
Button button = new Button(composite, SWT.PUSH);
- button.setLayoutData(new GridData());
+ button.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false, 1, 1));
button.setToolTipText(VpeUIMessages.BACKGROUND_COLOR_TIP);
ImageDescriptor colorDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
@@ -151,8 +254,6 @@
return composite;
}
-
-
@Override
public void create() {
@@ -160,26 +261,11 @@
templateVerifier.validateAll(false);
}
- private IMessageProvider getDefaultMessage() {
- final String message = (data.getUri() != null
- ? (MessageFormat.format(VpeUIMessages.TAG_URI, data.getUri()) + "\n") //$NON-NLS-1$
- : "") //$NON-NLS-1$
- + MessageFormat.format(VpeUIMessages.TAG_NAME, data.getName());
- return new Message(message, IMessageProvider.NONE);
- }
-
- private Label makeLabel(Composite parent, String text) {
- Label lbl = new Label(parent, SWT.NONE);
- lbl.setText(text);
- lbl.setBackground(parent.getBackground());
- return lbl;
- }
-
@Override
protected void okPressed() {
- data.setChanged(data.isChanged() || (data.isChildren() != ctlChildren.getSelection()));
- data.setChildren(ctlChildren.getSelection());
+ data.setChanged(data.isChanged() || (data.isChildren() != childrenCheckbox.getSelection()));
+ data.setChildren(childrenCheckbox.getSelection());
data.setChanged(isChanged(data,data.getTagForDisplay(),txtTagForDisplay.getText()));
data.setTagForDisplay(txtTagForDisplay.getText().trim());
@@ -219,31 +305,6 @@
}
}
- private static class CheckControl {
- private Label label;
- private Button button;
-
- public CheckControl(Composite parent, String labelText, boolean value) {
- label = new Label(parent, SWT.NONE);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- label.setText(labelText);
- button = new Button(parent, SWT.CHECK);
- GridData gd = new GridData(GridData.BEGINNING);
- gd.horizontalSpan = 2;
- button.setLayoutData(gd);
- button.setSelection(value);
- }
-
- public void setVisible(boolean visible) {
- label.setVisible(visible);
- button.setVisible(visible);
- }
-
- public boolean getSelection() {
- return button.getSelection();
- }
- }
-
/**
* Validator of {@link VpeEditAnyDialog}.
*
@@ -310,7 +371,7 @@
* @param updateMessage if it is {@code true}, the dialog's message will be updated.
*/
void validateAll(boolean updateMessage) {
- IMessageProvider message = VpeEditAnyDialog.this.getDefaultMessage();
+ IMessageProvider message = null;
IMessageProvider tagForDisplayMessage = validateTagForDisplay();
IMessageProvider valueMessage = validateValue();
@@ -319,10 +380,15 @@
message = tagForDisplayMessage;
} else if (valueMessage != null) {
message = valueMessage;
+ } else {
+ /*
+ * If everything is OK - set default message
+ */
+ setMessage(VpeUIMessages.UNKNOWN_TAGS_DIALOG_DESCRIPTION);
}
Button okButton = getButton(IDialogConstants.OK_ID);
- if (message.getMessageType() <= IMessageProvider.INFORMATION) {
+ if ((message == null) || (message.getMessageType() <= IMessageProvider.INFORMATION)) {
okButton.setEnabled(true);
} else {
okButton.setEnabled(false);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2009-12-22 11:56:18 UTC (rev 19533)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2009-12-22 14:21:09 UTC (rev 19534)
@@ -37,9 +37,12 @@
public static String GENERAL;
public static String TEMPLATES;
public static String TEMPLATE;
+ public static String UNKNOWN_TAGS_DIALOG_DESCRIPTION;
public static String TAG_ATTRIBUTES;
public static String TAG_NAME;
public static String TAG_URI;
+ public static String TAG_FOR_DISPLAY;
+ public static String TAG_STYLE;
public static String CHILDREN;
public static String VALUE;
public static String VALUE_IS_NOT_VALID;
@@ -78,11 +81,11 @@
public static String SHOW;
public static String HIDE;
public static String TAG_FOR_DISPLAY_IS_NOT_VALID;
- public static String TAG_FOR_DISPLAY;
public static String MenuCreationHelper_Cut;
public static String MenuCreationHelper_Paste;
public static String MenuCreationHelper_Test;
public static String SelectionBar_MoreNodes;
+ public static String TemplatesPreferencePage_Add;
public static String TemplatesPreferencePage_Edit;
public static String TemplatesPreferencePage_Remove;
public static String TemplatesTableProvider_Children;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-12-22 11:56:18 UTC (rev 19533)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-12-22 14:21:09 UTC (rev 19534)
@@ -14,14 +14,20 @@
MOZILLA_LOADING_ERROR_LINK=http://www.jboss.org/community/docs/DOC-10862
# END NON-TRANSLATABLE
GENERAL=General
+
+# Unknown tags templates dialog messages
TEMPLATES=Templates
-TEMPLATE=Template
-TAG_ATTRIBUTES=Tag Attributes
-TAG_NAME=Tag Name: {0}
-TAG_URI=Tag URI: {0}
-CHILDREN=Children
-VALUE=Value
+TEMPLATE=Unknown tag template
+UNKNOWN_TAGS_DIALOG_DESCRIPTION=Set up parameters for the unknown tag
+TAG_ATTRIBUTES=Set up tag attributes
+TAG_NAME=Tag Name:
+TAG_URI=Tag URI:
+TAG_FOR_DISPLAY=Tag For Display:
+TAG_STYLE=Tag style:
+CHILDREN=Allow tag children:
+VALUE=Value:
VALUE_IS_NOT_VALID=Value is not valid ({0}).
+
BACKGROUND_COLOR=Background Color
ERROR_OF_TYPE_CONVERSION=Error of type conversion
INCORRECT_PARAMETER_ERROR=Incorrect parameter error
@@ -57,11 +63,11 @@
SHOW=Show
HIDE=Hide
TAG_FOR_DISPLAY_IS_NOT_VALID=Tag for display is not valid ({0}).
-TAG_FOR_DISPLAY=Tag for Display
MenuCreationHelper_Cut=Cut
MenuCreationHelper_Paste=Paste
MenuCreationHelper_Test=Test
SelectionBar_MoreNodes=More Nodes...
+TemplatesPreferencePage_Add=Add
TemplatesPreferencePage_Edit=Edit
TemplatesPreferencePage_Remove=Remove
TemplatesTableProvider_Children=Children
15 years, 1 month
JBoss Tools SVN: r19533 - trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-22 06:56:18 -0500 (Tue, 22 Dec 2009)
New Revision: 19533
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenESBResourceHandler.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5486
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenESBResourceHandler.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenESBResourceHandler.java 2009-12-22 11:54:46 UTC (rev 19532)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenESBResourceHandler.java 2009-12-22 11:56:18 UTC (rev 19533)
@@ -1,10 +1,22 @@
package org.jboss.tools.esb.core.model.handlers;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultRedirectHandler;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.files.handlers.CreateFileSupport;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class OpenESBResourceHandler extends DefaultRedirectHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ if(super.isEnabled(object)) return true;
+ return object != null && object.isObjectEditable();
+ }
protected XModelObject getTrueSource(XModelObject source) {
String attr = action.getProperty("attribute");
@@ -17,4 +29,44 @@
return r.getChildByPath(path);
}
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ if(!isEnabled(object)) return;
+ if(super.isEnabled(object)) {
+ super.executeHandler(object, p);
+ } else {
+ XModelObject r = FileSystemsHelper.getWebRoot(object.getModel());
+
+ IResource resource = r != null ? (IResource)r.getAdapter(IResource.class) : null;
+ if(resource == null) resource = EclipseResourceUtil.getProject(object);
+
+ String attr = action.getProperty("attribute");
+ String path = object.getAttributeValue(attr);
+ if(path == null) return;
+ int s = path.lastIndexOf('/');
+ String folder = (s < 0) ? "" : path.substring(0, s);
+ if(folder.length() > 0 && !folder.startsWith("/")) folder = "/" + folder;
+ String fileName = (s < 0) ? path : path.substring(s + 1);
+ Properties p1 = new Properties();
+ p1.setProperty(CreateFileSupport.INITIAL_FOLDER_PROPERTY, resource.getFullPath() + folder);
+ p1.setProperty(CreateFileSupport.INITIAL_FILE_PROPERTY, fileName);
+ if(r == null) {
+ XModelObject fo = object.getParent();
+ while(fo != null && fo.getFileType() <= XModelObject.FILE) fo = fo.getParent();
+ r = fo;
+ }
+ XActionInvoker.invoke("CreateActions/CreateFiles/Common/CreateFile", r, p1);
+ XModelObject newFile = (XModelObject)p1.get("created");
+ if(newFile == null) return;
+ IResource newResource = (IResource)newFile.getAdapter(IResource.class);
+ if(newResource == null) return;
+ String path1 = resource.getFullPath().toString();
+ String path2 = newResource.getFullPath().toString();
+ if(path2.startsWith(path1)) {
+ String value = path2.substring(path1.length());
+ object.setAttributeValue(attr, value);
+ }
+
+ }
+ }
+
}
15 years, 1 month
JBoss Tools SVN: r19532 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-22 06:54:46 -0500 (Tue, 22 Dec 2009)
New Revision: 19532
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5486
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java 2009-12-22 11:45:57 UTC (rev 19531)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java 2009-12-22 11:54:46 UTC (rev 19532)
@@ -31,6 +31,9 @@
import org.jboss.tools.common.util.FileUtil;
public class CreateFileSupport extends SpecialWizardSupport {
+ public static String INITIAL_FOLDER_PROPERTY = "initialFolder"; //$NON-NLS-1$
+ public static String INITIAL_FILE_PROPERTY = "initialFile"; //$NON-NLS-1$
+
static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
static final String ATTR_FOLDER = "folder"; //$NON-NLS-1$
@@ -67,6 +70,14 @@
targetHolder.revalidate(r.getFullPath().toString());
setAttributeValue(0, ATTR_FOLDER, "" + targetHolder.path); //$NON-NLS-1$
}
+ String initialFolder = p.getProperty(INITIAL_FOLDER_PROPERTY);
+ if(initialFolder != null && initialFolder.length() > 0) {
+ setAttributeValue(0, ATTR_FOLDER, initialFolder);
+ }
+ String initialFile = p.getProperty(INITIAL_FILE_PROPERTY);
+ if(initialFile != null && initialFile.length() > 0) {
+ setAttributeValue(0, XModelObjectConstants.ATTR_NAME, initialFile);
+ }
initVersions();
}
15 years, 1 month
JBoss Tools SVN: r19531 - in trunk/esb/plugins/org.jboss.tools.esb.core: src/org/jboss/tools/esb/core/model/converters and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-22 06:45:57 -0500 (Tue, 22 Dec 2009)
New Revision: 19531
Modified:
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/converters/EndpointConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5553
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-12-22 11:15:20 UTC (rev 19530)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-12-22 11:45:57 UTC (rev 19531)
@@ -1473,7 +1473,7 @@
<Editor name="TreeChooser"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="endpoint url" xmlname="endpointUrl"/>
- <XModelAttribute PROPERTIES="category=general" name="file" xmlname="file">
+ <XModelAttribute PROPERTIES="category=general;pre=true" name="file" xmlname="file">
<Constraint loader="Tree">
<value name="ESBResourceTree"/>
<value name="extensions=properties"/>
@@ -1481,10 +1481,18 @@
</Constraint>
<Editor name="TreeChooser"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general;pre=true" default="GET"
- name="method" xmlname="method">
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ default="Default(true)" name="client credentials required" xmlname="clientCredentialsRequired">
<Constraint loader="ListString">
- <value name="GET"/>
+ <value name="Default(true)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;pre=true" name="method" xmlname="method">
+ <Constraint loader="ListString">
+ <value/>
<value name="POST"/>
</Constraint>
<Editor name="ListString"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EndpointConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EndpointConverter.java 2009-12-22 11:15:20 UTC (rev 19530)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EndpointConverter.java 2009-12-22 11:45:57 UTC (rev 19531)
@@ -37,7 +37,10 @@
p.setAttributeValue(ESBConstants.ATTR_VALUE, endpointURL);
}
String file = specificAction.getAttributeValue(ATTR_FILE);
- if(file != null && file.length() > 0) {
+ if(file != null && file.length() > 0
+ && specificAction.getModelEntity().getAttribute(ATTR_FILE) != null
+ && !"true".equals(specificAction.getModelEntity().getAttribute(ATTR_FILE).getProperty("pre"))
+ ) {
empty = false;
XModelObject f = basicAction.getModel().createModelObject(getItemEntityName(), null);
f.setAttributeValue(ESBConstants.ATTR_NAME, ATTR_FILE);
@@ -59,7 +62,10 @@
if(as[i] instanceof AnyElementObjectImpl) {
XModelObject a = fromAnyElement(as[i], getItemEntityName());
if(a != null) {
- if(ATTR_FILE.equals(a.getAttributeValue(ESBConstants.ATTR_NAME))) {
+ if(ATTR_FILE.equals(a.getAttributeValue(ESBConstants.ATTR_NAME))
+ && specificAction.getModelEntity().getAttribute(ATTR_FILE) != null
+ && !"true".equals(specificAction.getModelEntity().getAttribute(ATTR_FILE).getProperty("pre"))
+ ) {
specificAction.setAttributeValue(ATTR_FILE, a.getAttributeValue(ESBConstants.ATTR_VALUE));
} else {
specificAction.addChild(a);
15 years, 1 month
JBoss Tools SVN: r19530 - trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-22 06:15:20 -0500 (Tue, 22 Dec 2009)
New Revision: 19530
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5550
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-12-22 11:08:46 UTC (rev 19529)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-12-22 11:15:20 UTC (rev 19530)
@@ -1733,15 +1733,6 @@
</Constraint>
<Editor name="ListString"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="pre=true;category=general"
- default="Default(true)" name="cache script" xmlname="cacheScript">
- <Constraint loader="ListString">
- <value name="Default(true)"/>
- <value name="true"/>
- <value name="false"/>
- </Constraint>
- <Editor name="ListString"/>
- </XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
<Editor name="Uneditable"/>
</XModelAttribute>
15 years, 1 month
JBoss Tools SVN: r19529 - trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-22 06:08:46 -0500 (Tue, 22 Dec 2009)
New Revision: 19529
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5539
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-22 07:40:23 UTC (rev 19528)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-22 11:08:46 UTC (rev 19529)
@@ -947,11 +947,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="war security" loader="ElementType" name="element type">
+ <XModelAttribute default="WAR security" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true"
- default="War Security" name="name" visibility="false">
+ default="WAR Security" name="name" visibility="false">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="method" xmlname="method">
15 years, 1 month
JBoss Tools SVN: r19528 - in trunk/esb/plugins/org.jboss.tools.esb.ui: src/org/jboss/tools/esb/ui/wizard/newfile and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-12-22 02:40:23 -0500 (Tue, 22 Dec 2009)
New Revision: 19528
Added:
trunk/esb/plugins/org.jboss.tools.esb.ui/resources/org/jboss/tools/esb/ui/wizard/newfile/EclipseCreateNewProject.png
Modified:
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/newfile/NewESBFileWizard.java
Log:
JBIDE-5502:New ESB File wizard still uses old (Seam?!) icon
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/resources/org/jboss/tools/esb/ui/wizard/newfile/EclipseCreateNewProject.png
===================================================================
(Binary files differ)
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/resources/org/jboss/tools/esb/ui/wizard/newfile/EclipseCreateNewProject.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/newfile/NewESBFileWizard.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/newfile/NewESBFileWizard.java 2009-12-22 07:34:03 UTC (rev 19527)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/newfile/NewESBFileWizard.java 2009-12-22 07:40:23 UTC (rev 19528)
@@ -20,7 +20,7 @@
public class NewESBFileWizard extends NewFileWizardEx {
public NewESBFileWizard() {
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(NewESBFileWizard.class, "ESB_File_wiz.png")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(NewESBFileWizard.class, "EclipseCreateNewProject.png")); //$NON-NLS-1$
}
protected NewFileContextEx createNewFileContext() {
15 years, 1 month