JBoss Tools SVN: r16338 - in trunk/seam/tests/org.jboss.tools.seam.core.test: src/org/jboss/tools/seam/core/test/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-07-02 07:50:50 -0400 (Thu, 02 Jul 2009)
New Revision: 16338
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestContextVariableOut.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestContextVariableOut.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestContextVariableOut.java 2009-07-02 11:47:17 UTC (rev 16337)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestContextVariableOut.java 2009-07-02 11:50:50 UTC (rev 16338)
@@ -9,7 +9,7 @@
@Name("computer2")
-public class TestContextVariableFactory
+public class TestContextVariableOut
{
@Logger Log log;
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java 2009-07-02 11:47:17 UTC (rev 16337)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java 2009-07-02 11:50:50 UTC (rev 16338)
@@ -158,11 +158,11 @@
renameContextVariable(seamEjbProject, "/WebContent/factory.jsp", "cba", "ccc", list);
}
- public void t_estSeamContextVariable_Out1_Rename() throws CoreException {
+ public void testSeamContextVariable_Out1_Rename() throws CoreException {
ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
TestChangeStructure structure = new TestChangeStructure(ejbProject.getProject(), "/ejbModule/org/domain/"+warProjectName+"/session/TestContextVariableOut.java");
- TestTextChange change = new TestTextChange(464, 5, "\"bbb\"");
+ TestTextChange change = new TestTextChange(461, 5, "\"bbb\"");
structure.addTextChange(change);
list.add(structure);
13 years, 8 months
JBoss Tools SVN: r16337 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-07-02 07:47:17 -0400 (Thu, 02 Jul 2009)
New Revision: 16337
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4102, comment node updating was changed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-07-02 10:37:10 UTC (rev 16336)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-07-02 11:47:17 UTC (rev 16337)
@@ -181,6 +181,7 @@
private boolean mouseUpSelectionReasonFlag;
private boolean mouseDownSelectionFlag;
private boolean sourceChangeFlag;
+ private boolean commentNodeChanged;
private VpePageContext pageContext;
private BundleMap bundle;
private VpeEditorPart editPart;
@@ -616,19 +617,47 @@
break;
case INodeNotifier.ADD:
- // we should remove all parent nodes from vpe cash
- visualBuilder.removeNode((Node) newValue);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4102
+ * Do nothing on comment node adding,
+ * it is already updated in {@code INodeNotifier.REMOVE} case.
+ */
+ if (Node.COMMENT_NODE != ((Node) newValue).getNodeType()) {
+ /*
+ * we should remove all parent nodes from vpe cash
+ */
+ visualBuilder.removeNode((Node) newValue);
+ }
break;
case INodeNotifier.REMOVE:
- visualBuilder.stopToggle((Node) feature);
- visualBuilder.removeNode((Node) feature);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4102
+ * When comment is changed there is no need
+ * to update its parent or the whole structure,
+ * only the comment node should be updated.
+ */
+ if (Node.COMMENT_NODE == ((Node) feature).getNodeType()) {
+ visualBuilder.updateNode((Node) feature);
+ commentNodeChanged = true;
+ } else {
+ visualBuilder.stopToggle((Node) feature);
+ visualBuilder.removeNode((Node) feature);
+ }
break;
case INodeNotifier.STRUCTURE_CHANGED:
- visualEditor.hideResizer();
- visualBuilder.setSelectionRectangle(null);
- visualBuilder.updateNode((Node) notifier);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4102
+ * Do not update parent tag when a comment was changed,
+ */
+ if (!commentNodeChanged) {
+ visualEditor.hideResizer();
+ visualBuilder.setSelectionRectangle(null);
+ visualBuilder.updateNode((Node) notifier);
+ } else {
+ commentNodeChanged = false;
+ }
break;
case INodeNotifier.CONTENT_CHANGED:
if (!sourceChangeFlag) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-07-02 10:37:10 UTC (rev 16336)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-07-02 11:47:17 UTC (rev 16337)
@@ -963,9 +963,6 @@
case Node.DOCUMENT_NODE:
rebuildDom((Document) sourceNode);
break;
- // case Node.COMMENT_NODE:
- // updateComment(sourceNode);
- // break;
default:
updateElement(getNodeForUpdate(sourceNode));
}
13 years, 8 months
JBoss Tools SVN: r16336 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-07-02 06:37:10 -0400 (Thu, 02 Jul 2009)
New Revision: 16336
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
Log:
JBIDE-4532: make up the change for missing the sflanigan's commit
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 09:38:29 UTC (rev 16335)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 10:37:10 UTC (rev 16336)
@@ -14,7 +14,7 @@
public final class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.bpel.ui.messages";//$NON-NLS-1
+ private static final String BUNDLE_NAME = "org.eclipse.bpel.ui.messages"; //$NON-NLS-1$
private Messages() {
13 years, 8 months
JBoss Tools SVN: r16335 - in trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui: commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-07-02 05:38:29 -0400 (Thu, 02 Jul 2009)
New Revision: 16335
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
Log:
JBIDE-4532: apply the changes for this issue
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 09:35:12 UTC (rev 16334)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 09:38:29 UTC (rev 16335)
@@ -702,6 +702,9 @@
public static String OutlinePage_showOverviewView;
public static String OutlinePage_showOutlineView;
+
+ public static String DeletePartnerLinkTypeWarningMessage;
+ public static String DeletePartnerLinkTypeWarningDialogTitle;
static {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java 2009-07-02 09:35:12 UTC (rev 16334)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java 2009-07-02 09:38:29 UTC (rev 16335)
@@ -34,12 +34,14 @@
import org.eclipse.bpel.ui.util.ModelHelper;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.wsdl.Definition;
/**
- * Deletes a model object from an IContainer, and removes any references to it from other
- * model objects.
+ * Deletes a model object from an IContainer, and removes any references to it
+ * from other model objects.
*
* This is more or less the opposite of InsertInContainerCommand.
*
@@ -49,28 +51,30 @@
private EObject fChild;
private EObject fParent;
-
+
IContainer fContainer;
-
+
Resource[] resourcesToModify = null;
-
+
CompoundCommand fDeleteLinksCmd;
- CompoundCommand fDeletePLTsCmd;
-
+ CompoundCommand fDeletePLTsCmd;
+
public DeleteChildCommand(EObject child) {
super(new ArrayList(2));
fParent = child.eContainer();
-
+
if (fParent instanceof FaultHandler || fParent instanceof EventHandler) {
- // If the child of the FH/EH is the *only* child, then we want to delete the
+ // If the child of the FH/EH is the *only* child, then we want to
+ // delete the
// entire FH/EH, since it has no meaningful attributes of its own.
- IContainer<EObject> container = BPELUtil.adapt(fParent, IContainer.class);
+ IContainer<EObject> container = BPELUtil.adapt(fParent,
+ IContainer.class);
List<EObject> children = container.getChildren(fParent);
if (children.size() == 1 && children.contains(child)) {
// delete the FH instead
child = fParent;
- fParent = child.eContainer();
+ fParent = child.eContainer();
}
}
this.fChild = child;
@@ -78,19 +82,21 @@
if (fParent != null) {
addModelRoot(fParent);
}
-
+
fContainer = BPELUtil.adapt(fParent, IContainer.class);
-
+
String childType = null;
- ILabeledElement labeledElement = BPELUtil.adapt(child, ILabeledElement.class);
+ ILabeledElement labeledElement = BPELUtil.adapt(child,
+ ILabeledElement.class);
if (labeledElement != null) {
childType = labeledElement.getTypeLabel(child);
}
- if (childType == null) {
- childType = Messages.DeleteChildCommand_Item_1;
+ if (childType == null) {
+ childType = Messages.DeleteChildCommand_Item_1;
}
- setLabel(NLS.bind(Messages.DeleteChildCommand_Delete_2, (new Object[] { childType })));
+ setLabel(NLS.bind(Messages.DeleteChildCommand_Delete_2,
+ (new Object[] { childType })));
}
/**
@@ -98,10 +104,10 @@
*/
@Override
public boolean canDoExecute() {
- if (fChild == null || fParent == null || fContainer==null ) {
+ if (fChild == null || fParent == null || fContainer == null) {
return false;
- }
- return fContainer.canRemoveChild ( fParent, fChild );
+ }
+ return fContainer.canRemoveChild(fParent, fChild);
}
// TODO: this is a hack.
@@ -109,78 +115,103 @@
public Resource[] getResources() {
if (resourcesToModify == null) {
Process process = ModelHelper.getProcess(fParent);
- if (process == null) return EMPTY_RESOURCE_ARRAY;
+ if (process == null)
+ return EMPTY_RESOURCE_ARRAY;
BPELEditor bpelEditor = ModelHelper.getBPELEditor(process);
-
+
Set<Resource> resultSet = new HashSet<Resource>();
resultSet.add(fParent.eResource());
-
+
// Figure out which model objects are being deleted.
HashSet<Object> deletingSet = new HashSet<Object>();
ModelHelper.addSubtreeToCollection(fChild, deletingSet);
-
- // If we are deleting any PartnerLinks which reference PLTs in the Artifacts WSDL
+
+ // If we are deleting any PartnerLinks which reference PLTs in the
+ // Artifacts WSDL
// file, also delete the referenced PLTs.
Set<PartnerLinkType> partnerLinkTypes = null;
- Definition artifactsDefinition = bpelEditor.getArtifactsDefinition();
-
- for (Iterator it = deletingSet.iterator(); it.hasNext(); ) {
+ Definition artifactsDefinition = bpelEditor
+ .getArtifactsDefinition();
+
+ for (Iterator it = deletingSet.iterator(); it.hasNext();) {
Object object = it.next();
if (object instanceof PartnerLink) {
- PartnerLinkType plt = ((PartnerLink)object).getPartnerLinkType();
- if ((plt != null) && (plt.getEnclosingDefinition() == artifactsDefinition)) {
- if (partnerLinkTypes == null) partnerLinkTypes = new HashSet<PartnerLinkType>();
+ PartnerLinkType plt = ((PartnerLink) object)
+ .getPartnerLinkType();
+ if ((plt != null)
+ && (plt.getEnclosingDefinition() == artifactsDefinition)) {
+ if (partnerLinkTypes == null)
+ partnerLinkTypes = new HashSet<PartnerLinkType>();
if (partnerLinkTypes.add(plt)) {
resultSet.add(plt.eResource());
}
}
}
}
- resourcesToModify = resultSet.toArray(new Resource[resultSet.size()]);
+ resourcesToModify = resultSet
+ .toArray(new Resource[resultSet.size()]);
}
return resourcesToModify;
}
-
+
/**
* @see org.eclipse.bpel.ui.commands.util.AutoUndoCommand#doExecute()
*/
@Override
public void doExecute() {
-
- if (!canExecute()) {
+
+ if (!canExecute()) {
throw new IllegalStateException();
}
Process process = ModelHelper.getProcess(fParent);
- if (process == null) return;
+ if (process == null)
+ return;
BPELEditor bpelEditor = ModelHelper.getBPELEditor(process);
-
+
EObject topModelObject = process;
-
- // Multi-delete safety: if the child does not have a resource, assume it has
+
+ // Multi-delete safety: if the child does not have a resource, assume it
+ // has
// already been deleted, and do nothing.
if (fChild.eResource() == null) {
return;
}
-
+
// Figure out which model objects are being deleted.
HashSet deletingSet = new HashSet();
ModelHelper.addSubtreeToCollection(fChild, deletingSet);
-
- // If we are deleting any PartnerLinks which reference PLTs in the Artifacts WSDL
+
+ // If we are deleting any PartnerLinks which reference PLTs in the
+ // Artifacts WSDL
// file, also delete the referenced PLTs.
Set<PartnerLinkType> partnerLinkTypes = null;
Definition artifactsDefinition = bpelEditor.getArtifactsDefinition();
- for (Iterator it = deletingSet.iterator(); it.hasNext(); ) {
+ for (Iterator it = deletingSet.iterator(); it.hasNext();) {
Object object = it.next();
if (object instanceof PartnerLink) {
- PartnerLinkType plt = ((PartnerLink)object).getPartnerLinkType();
- if ((plt != null) && (plt.getEnclosingDefinition() == artifactsDefinition)) {
- if (partnerLinkTypes == null) partnerLinkTypes = new HashSet<PartnerLinkType>();
- if (partnerLinkTypes.add(plt)) {
- if (fDeletePLTsCmd == null) fDeletePLTsCmd = new CompoundCommand();
- fDeletePLTsCmd.add(new DeletePartnerLinkTypeCommand(plt));
+ PartnerLinkType plt = ((PartnerLink) object)
+ .getPartnerLinkType();
+ if ((plt != null)
+ && (plt.getEnclosingDefinition() == artifactsDefinition)) {
+ // We should ask the user if delete the partner link type
+ if (MessageDialog
+ .openQuestion(
+ PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow()
+ .getShell(),
+ Messages.DeletePartnerLinkTypeWarningDialogTitle,
+ NLS.bind(Messages.DeletePartnerLinkTypeWarningMessage,
+ (new Object[] {((PartnerLink) object).getName(), plt.getName() })))) {
+ if (partnerLinkTypes == null)
+ partnerLinkTypes = new HashSet<PartnerLinkType>();
+ if (partnerLinkTypes.add(plt)) {
+ if (fDeletePLTsCmd == null)
+ fDeletePLTsCmd = new CompoundCommand();
+ fDeletePLTsCmd
+ .add(new DeletePartnerLinkTypeCommand(plt));
+ }
}
}
}
@@ -191,49 +222,61 @@
ModelHelper.addSubtreeToCollection(topModelObject, notDeletingSet);
notDeletingSet.removeAll(deletingSet);
- // We also need to find any flow links which involve a deleted object and remove them.
+ // We also need to find any flow links which involve a deleted object
+ // and remove them.
// This is a hack, but it could be worse..
// step 1: find all the flows which contain deleted objects
HashSet<Flow> flowSet = new HashSet<Flow>();
- for (Iterator<EObject> it = deletingSet.iterator(); it.hasNext(); ) {
- Flow [] flws = FlowLinkUtil.getParentFlows(it.next());
+ for (Iterator<EObject> it = deletingSet.iterator(); it.hasNext();) {
+ Flow[] flws = FlowLinkUtil.getParentFlows(it.next());
flowSet.addAll(Arrays.asList(flws));
}
// step 2: if any of the flows is being deleted, we can ignore it
- // this is safe because the source, dest and link itself are all children of the flow
+ // this is safe because the source, dest and link itself are all
+ // children of the flow
flowSet.removeAll(deletingSet);
-
- // step 3: check each link in each of the remaining flows to see if it involves a
- // deleted object. Even if both source and target are being deleted, we should still
- // delete the link, since it is a child of the Flow which is not being deleted.
+
+ // step 3: check each link in each of the remaining flows to see if it
+ // involves a
+ // deleted object. Even if both source and target are being deleted, we
+ // should still
+ // delete the link, since it is a child of the Flow which is not being
+ // deleted.
fDeleteLinksCmd = new CompoundCommand();
- for (Iterator<Flow> flowIt = flowSet.iterator(); flowIt.hasNext(); ) {
+ for (Iterator<Flow> flowIt = flowSet.iterator(); flowIt.hasNext();) {
Flow flow = flowIt.next();
- for (Iterator<Link> it = FlowLinkUtil.getFlowLinks(flow).iterator(); it.hasNext(); ) {
+ for (Iterator<Link> it = FlowLinkUtil.getFlowLinks(flow).iterator(); it
+ .hasNext();) {
Link link = it.next();
- if (deletingSet.contains(FlowLinkUtil.getLinkSource(link)) || deletingSet.contains(FlowLinkUtil.getLinkTarget(link))) {
- // NOTE: this is safe even if the link is scheduled for deletion by
+ if (deletingSet.contains(FlowLinkUtil.getLinkSource(link))
+ || deletingSet.contains(FlowLinkUtil
+ .getLinkTarget(link))) {
+ // NOTE: this is safe even if the link is scheduled for
+ // deletion by
// a GEF DeleteAction, see comment in DeleteLinkCommand.
DeleteLinkCommand child = new DeleteLinkCommand(link);
- if (child.canExecute()) fDeleteLinksCmd.add(child);
+ if (child.canExecute())
+ fDeleteLinksCmd.add(child);
}
}
}
-
+
fDeleteLinksCmd.doExecute();
-
+
if (fDeletePLTsCmd != null) {
fDeletePLTsCmd.doExecute();
}
-
+
// finally, we can remove the child.
fContainer.removeChild(fParent, fChild);
- // IMPORTANT: since the parent is a not-deleted object and the child will be
- // a deleted object, this step must be done *after* the IContainer removal ;)
- for (Iterator it = notDeletingSet.iterator(); it.hasNext(); ) {
- BPELUtil.deleteNonContainmentRefs((EObject)it.next(), deletingSet);
+ // IMPORTANT: since the parent is a not-deleted object and the child
+ // will be
+ // a deleted object, this step must be done *after* the IContainer
+ // removal ;)
+ for (Iterator it = notDeletingSet.iterator(); it.hasNext();) {
+ BPELUtil.deleteNonContainmentRefs((EObject) it.next(), deletingSet);
}
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java 2009-07-02 09:35:12 UTC (rev 16334)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java 2009-07-02 09:38:29 UTC (rev 16335)
@@ -10,8 +10,12 @@
*******************************************************************************/
package org.eclipse.bpel.ui.commands;
+import java.util.HashSet;
+import java.util.Set;
+
import org.eclipse.bpel.model.partnerlinktype.PartnerLinkType;
import org.eclipse.bpel.ui.IBPELUIConstants;
+import org.eclipse.bpel.ui.util.ModelHelper;
/**
@@ -26,4 +30,20 @@
public DeletePartnerLinkTypeCommand(PartnerLinkType plt) {
super(plt);
}
+
+ /**
+ * Override super's method because we should not delete other partner link
+ */
+ @Override
+ public void doExecute() {
+ fDefinition = fElement.getEnclosingDefinition();
+
+ Set<Object> modelRootSet = new HashSet<Object>();
+ modelRootSet.add(fElement.eResource());
+ modelRootSet.add(ModelHelper.getBPELEditor(fElement).getResource());
+
+ fElement.setEnclosingDefinition(null);
+ fDefinition.getEExtensibilityElements().remove(fElement);
+
+ }
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-07-02 09:35:12 UTC (rev 16334)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-07-02 09:38:29 UTC (rev 16335)
@@ -136,10 +136,7 @@
BPELPreferencePage_WSIL_EnterLocation = <enter location>
#
# This has \n for a reason. The wrapping in the widget works, but not as expected.
-BPELPreferencePage_WSIL_Description = \
-The document above contains links to other WSIL documents shown below.\n\
-You can add or remove WSIL links to/from the above document.\n\
-The result will be shown in the WSIL browser of the editor.
+BPELPreferencePage_WSIL_Description =
#
BPELUIRegistry_Expression_language_editors_must_provide_expressionLanguage_and_class__8=Expression language editors must provide expressionLanguage and class.
BPELUtil__unknown_URI__54=<unknown URI>
@@ -696,3 +693,5 @@
SaveImageAction_2=Overwrite {0}?
SaveImageAction_3=Error
SaveImageAction_4=Can't save image to the file {0}
+DeletePartnerLinkTypeWarningDialogTitle=Warning
+DeletePartnerLinkTypeWarningMessage=When you delete the PartnerLink -- ''{0}'', you may delete its reference PartnerLinkType -- ''{1}'' too, do you want to delete the PartnerLinkType?
13 years, 8 months
JBoss Tools SVN: r16334 - in trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui: commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-07-02 05:35:12 -0400 (Thu, 02 Jul 2009)
New Revision: 16334
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
Log:
JBIDE-4532: revert the change for this issue
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 09:18:17 UTC (rev 16333)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 09:35:12 UTC (rev 16334)
@@ -14,7 +14,7 @@
public final class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.bpel.ui.messages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.eclipse.bpel.ui.messages";//$NON-NLS-1
private Messages() {
@@ -702,9 +702,6 @@
public static String OutlinePage_showOverviewView;
public static String OutlinePage_showOutlineView;
-
- public static String DeletePartnerLinkTypeWarningMessage;
- public static String DeletePartnerLinkTypeWarningDialogTitle;
static {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java 2009-07-02 09:18:17 UTC (rev 16333)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java 2009-07-02 09:35:12 UTC (rev 16334)
@@ -34,14 +34,12 @@
import org.eclipse.bpel.ui.util.ModelHelper;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.wsdl.Definition;
/**
- * Deletes a model object from an IContainer, and removes any references to it
- * from other model objects.
+ * Deletes a model object from an IContainer, and removes any references to it from other
+ * model objects.
*
* This is more or less the opposite of InsertInContainerCommand.
*
@@ -51,30 +49,28 @@
private EObject fChild;
private EObject fParent;
-
+
IContainer fContainer;
-
+
Resource[] resourcesToModify = null;
-
+
CompoundCommand fDeleteLinksCmd;
- CompoundCommand fDeletePLTsCmd;
-
+ CompoundCommand fDeletePLTsCmd;
+
public DeleteChildCommand(EObject child) {
super(new ArrayList(2));
fParent = child.eContainer();
-
+
if (fParent instanceof FaultHandler || fParent instanceof EventHandler) {
- // If the child of the FH/EH is the *only* child, then we want to
- // delete the
+ // If the child of the FH/EH is the *only* child, then we want to delete the
// entire FH/EH, since it has no meaningful attributes of its own.
- IContainer<EObject> container = BPELUtil.adapt(fParent,
- IContainer.class);
+ IContainer<EObject> container = BPELUtil.adapt(fParent, IContainer.class);
List<EObject> children = container.getChildren(fParent);
if (children.size() == 1 && children.contains(child)) {
// delete the FH instead
child = fParent;
- fParent = child.eContainer();
+ fParent = child.eContainer();
}
}
this.fChild = child;
@@ -82,21 +78,19 @@
if (fParent != null) {
addModelRoot(fParent);
}
-
+
fContainer = BPELUtil.adapt(fParent, IContainer.class);
-
+
String childType = null;
- ILabeledElement labeledElement = BPELUtil.adapt(child,
- ILabeledElement.class);
+ ILabeledElement labeledElement = BPELUtil.adapt(child, ILabeledElement.class);
if (labeledElement != null) {
childType = labeledElement.getTypeLabel(child);
}
- if (childType == null) {
- childType = Messages.DeleteChildCommand_Item_1;
+ if (childType == null) {
+ childType = Messages.DeleteChildCommand_Item_1;
}
- setLabel(NLS.bind(Messages.DeleteChildCommand_Delete_2,
- (new Object[] { childType })));
+ setLabel(NLS.bind(Messages.DeleteChildCommand_Delete_2, (new Object[] { childType })));
}
/**
@@ -104,10 +98,10 @@
*/
@Override
public boolean canDoExecute() {
- if (fChild == null || fParent == null || fContainer == null) {
+ if (fChild == null || fParent == null || fContainer==null ) {
return false;
- }
- return fContainer.canRemoveChild(fParent, fChild);
+ }
+ return fContainer.canRemoveChild ( fParent, fChild );
}
// TODO: this is a hack.
@@ -115,103 +109,78 @@
public Resource[] getResources() {
if (resourcesToModify == null) {
Process process = ModelHelper.getProcess(fParent);
- if (process == null)
- return EMPTY_RESOURCE_ARRAY;
+ if (process == null) return EMPTY_RESOURCE_ARRAY;
BPELEditor bpelEditor = ModelHelper.getBPELEditor(process);
-
+
Set<Resource> resultSet = new HashSet<Resource>();
resultSet.add(fParent.eResource());
-
+
// Figure out which model objects are being deleted.
HashSet<Object> deletingSet = new HashSet<Object>();
ModelHelper.addSubtreeToCollection(fChild, deletingSet);
-
- // If we are deleting any PartnerLinks which reference PLTs in the
- // Artifacts WSDL
+
+ // If we are deleting any PartnerLinks which reference PLTs in the Artifacts WSDL
// file, also delete the referenced PLTs.
Set<PartnerLinkType> partnerLinkTypes = null;
- Definition artifactsDefinition = bpelEditor
- .getArtifactsDefinition();
-
- for (Iterator it = deletingSet.iterator(); it.hasNext();) {
+ Definition artifactsDefinition = bpelEditor.getArtifactsDefinition();
+
+ for (Iterator it = deletingSet.iterator(); it.hasNext(); ) {
Object object = it.next();
if (object instanceof PartnerLink) {
- PartnerLinkType plt = ((PartnerLink) object)
- .getPartnerLinkType();
- if ((plt != null)
- && (plt.getEnclosingDefinition() == artifactsDefinition)) {
- if (partnerLinkTypes == null)
- partnerLinkTypes = new HashSet<PartnerLinkType>();
+ PartnerLinkType plt = ((PartnerLink)object).getPartnerLinkType();
+ if ((plt != null) && (plt.getEnclosingDefinition() == artifactsDefinition)) {
+ if (partnerLinkTypes == null) partnerLinkTypes = new HashSet<PartnerLinkType>();
if (partnerLinkTypes.add(plt)) {
resultSet.add(plt.eResource());
}
}
}
}
- resourcesToModify = resultSet
- .toArray(new Resource[resultSet.size()]);
+ resourcesToModify = resultSet.toArray(new Resource[resultSet.size()]);
}
return resourcesToModify;
}
-
+
/**
* @see org.eclipse.bpel.ui.commands.util.AutoUndoCommand#doExecute()
*/
@Override
public void doExecute() {
-
- if (!canExecute()) {
+
+ if (!canExecute()) {
throw new IllegalStateException();
}
Process process = ModelHelper.getProcess(fParent);
- if (process == null)
- return;
+ if (process == null) return;
BPELEditor bpelEditor = ModelHelper.getBPELEditor(process);
-
+
EObject topModelObject = process;
-
- // Multi-delete safety: if the child does not have a resource, assume it
- // has
+
+ // Multi-delete safety: if the child does not have a resource, assume it has
// already been deleted, and do nothing.
if (fChild.eResource() == null) {
return;
}
-
+
// Figure out which model objects are being deleted.
HashSet deletingSet = new HashSet();
ModelHelper.addSubtreeToCollection(fChild, deletingSet);
-
- // If we are deleting any PartnerLinks which reference PLTs in the
- // Artifacts WSDL
+
+ // If we are deleting any PartnerLinks which reference PLTs in the Artifacts WSDL
// file, also delete the referenced PLTs.
Set<PartnerLinkType> partnerLinkTypes = null;
Definition artifactsDefinition = bpelEditor.getArtifactsDefinition();
- for (Iterator it = deletingSet.iterator(); it.hasNext();) {
+ for (Iterator it = deletingSet.iterator(); it.hasNext(); ) {
Object object = it.next();
if (object instanceof PartnerLink) {
- PartnerLinkType plt = ((PartnerLink) object)
- .getPartnerLinkType();
- if ((plt != null)
- && (plt.getEnclosingDefinition() == artifactsDefinition)) {
- // We should ask the user if delete the partner link type
- if (MessageDialog
- .openQuestion(
- PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow()
- .getShell(),
- Messages.DeletePartnerLinkTypeWarningDialogTitle,
- NLS.bind(Messages.DeletePartnerLinkTypeWarningMessage,
- (new Object[] {((PartnerLink) object).getName(), plt.getName() })))) {
- if (partnerLinkTypes == null)
- partnerLinkTypes = new HashSet<PartnerLinkType>();
- if (partnerLinkTypes.add(plt)) {
- if (fDeletePLTsCmd == null)
- fDeletePLTsCmd = new CompoundCommand();
- fDeletePLTsCmd
- .add(new DeletePartnerLinkTypeCommand(plt));
- }
+ PartnerLinkType plt = ((PartnerLink)object).getPartnerLinkType();
+ if ((plt != null) && (plt.getEnclosingDefinition() == artifactsDefinition)) {
+ if (partnerLinkTypes == null) partnerLinkTypes = new HashSet<PartnerLinkType>();
+ if (partnerLinkTypes.add(plt)) {
+ if (fDeletePLTsCmd == null) fDeletePLTsCmd = new CompoundCommand();
+ fDeletePLTsCmd.add(new DeletePartnerLinkTypeCommand(plt));
}
}
}
@@ -222,61 +191,49 @@
ModelHelper.addSubtreeToCollection(topModelObject, notDeletingSet);
notDeletingSet.removeAll(deletingSet);
- // We also need to find any flow links which involve a deleted object
- // and remove them.
+ // We also need to find any flow links which involve a deleted object and remove them.
// This is a hack, but it could be worse..
// step 1: find all the flows which contain deleted objects
HashSet<Flow> flowSet = new HashSet<Flow>();
- for (Iterator<EObject> it = deletingSet.iterator(); it.hasNext();) {
- Flow[] flws = FlowLinkUtil.getParentFlows(it.next());
+ for (Iterator<EObject> it = deletingSet.iterator(); it.hasNext(); ) {
+ Flow [] flws = FlowLinkUtil.getParentFlows(it.next());
flowSet.addAll(Arrays.asList(flws));
}
// step 2: if any of the flows is being deleted, we can ignore it
- // this is safe because the source, dest and link itself are all
- // children of the flow
+ // this is safe because the source, dest and link itself are all children of the flow
flowSet.removeAll(deletingSet);
-
- // step 3: check each link in each of the remaining flows to see if it
- // involves a
- // deleted object. Even if both source and target are being deleted, we
- // should still
- // delete the link, since it is a child of the Flow which is not being
- // deleted.
+
+ // step 3: check each link in each of the remaining flows to see if it involves a
+ // deleted object. Even if both source and target are being deleted, we should still
+ // delete the link, since it is a child of the Flow which is not being deleted.
fDeleteLinksCmd = new CompoundCommand();
- for (Iterator<Flow> flowIt = flowSet.iterator(); flowIt.hasNext();) {
+ for (Iterator<Flow> flowIt = flowSet.iterator(); flowIt.hasNext(); ) {
Flow flow = flowIt.next();
- for (Iterator<Link> it = FlowLinkUtil.getFlowLinks(flow).iterator(); it
- .hasNext();) {
+ for (Iterator<Link> it = FlowLinkUtil.getFlowLinks(flow).iterator(); it.hasNext(); ) {
Link link = it.next();
- if (deletingSet.contains(FlowLinkUtil.getLinkSource(link))
- || deletingSet.contains(FlowLinkUtil
- .getLinkTarget(link))) {
- // NOTE: this is safe even if the link is scheduled for
- // deletion by
+ if (deletingSet.contains(FlowLinkUtil.getLinkSource(link)) || deletingSet.contains(FlowLinkUtil.getLinkTarget(link))) {
+ // NOTE: this is safe even if the link is scheduled for deletion by
// a GEF DeleteAction, see comment in DeleteLinkCommand.
DeleteLinkCommand child = new DeleteLinkCommand(link);
- if (child.canExecute())
- fDeleteLinksCmd.add(child);
+ if (child.canExecute()) fDeleteLinksCmd.add(child);
}
}
}
-
+
fDeleteLinksCmd.doExecute();
-
+
if (fDeletePLTsCmd != null) {
fDeletePLTsCmd.doExecute();
}
-
+
// finally, we can remove the child.
fContainer.removeChild(fParent, fChild);
- // IMPORTANT: since the parent is a not-deleted object and the child
- // will be
- // a deleted object, this step must be done *after* the IContainer
- // removal ;)
- for (Iterator it = notDeletingSet.iterator(); it.hasNext();) {
- BPELUtil.deleteNonContainmentRefs((EObject) it.next(), deletingSet);
+ // IMPORTANT: since the parent is a not-deleted object and the child will be
+ // a deleted object, this step must be done *after* the IContainer removal ;)
+ for (Iterator it = notDeletingSet.iterator(); it.hasNext(); ) {
+ BPELUtil.deleteNonContainmentRefs((EObject)it.next(), deletingSet);
}
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java 2009-07-02 09:18:17 UTC (rev 16333)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeletePartnerLinkTypeCommand.java 2009-07-02 09:35:12 UTC (rev 16334)
@@ -10,12 +10,8 @@
*******************************************************************************/
package org.eclipse.bpel.ui.commands;
-import java.util.HashSet;
-import java.util.Set;
-
import org.eclipse.bpel.model.partnerlinktype.PartnerLinkType;
import org.eclipse.bpel.ui.IBPELUIConstants;
-import org.eclipse.bpel.ui.util.ModelHelper;
/**
@@ -30,20 +26,4 @@
public DeletePartnerLinkTypeCommand(PartnerLinkType plt) {
super(plt);
}
-
- /**
- * Override super's method because we should not delete other partner link
- */
- @Override
- public void doExecute() {
- fDefinition = fElement.getEnclosingDefinition();
-
- Set<Object> modelRootSet = new HashSet<Object>();
- modelRootSet.add(fElement.eResource());
- modelRootSet.add(ModelHelper.getBPELEditor(fElement).getResource());
-
- fElement.setEnclosingDefinition(null);
- fDefinition.getEExtensibilityElements().remove(fElement);
-
- }
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-07-02 09:18:17 UTC (rev 16333)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-07-02 09:35:12 UTC (rev 16334)
@@ -136,7 +136,10 @@
BPELPreferencePage_WSIL_EnterLocation = <enter location>
#
# This has \n for a reason. The wrapping in the widget works, but not as expected.
-BPELPreferencePage_WSIL_Description =
+BPELPreferencePage_WSIL_Description = \
+The document above contains links to other WSIL documents shown below.\n\
+You can add or remove WSIL links to/from the above document.\n\
+The result will be shown in the WSIL browser of the editor.
#
BPELUIRegistry_Expression_language_editors_must_provide_expressionLanguage_and_class__8=Expression language editors must provide expressionLanguage and class.
BPELUtil__unknown_URI__54=<unknown URI>
@@ -693,5 +696,3 @@
SaveImageAction_2=Overwrite {0}?
SaveImageAction_3=Error
SaveImageAction_4=Can't save image to the file {0}
-DeletePartnerLinkTypeWarningDialogTitle=Warning
-DeletePartnerLinkTypeWarningMessage=When you delete the PartnerLink -- ''{0}'', you may delete its reference PartnerLinkType -- ''{1}'' too, do you want to delete the PartnerLinkType?
13 years, 8 months
JBoss Tools SVN: r16333 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: csv and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-02 05:18:17 -0400 (Thu, 02 Jul 2009)
New Revision: 16333
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataConfigurationWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataPathWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVInputDataWizard.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java
Log:
JBIDE-4551
Add wizard page for setting CSV configurations and selecting CSV file.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java 2009-07-02 08:31:50 UTC (rev 16332)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java 2009-07-02 09:18:17 UTC (rev 16333)
@@ -102,7 +102,7 @@
String type = wizard1.getInputDataTypeID();
String path = wizard1.getStructuredDataSourcePath();
- wizard1.complate(this.getFormEditor());
+// wizard1.complate(this.getFormEditor());
SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
if (type != null && path != null && extType != null) {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataConfigurationWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataConfigurationWizardPage.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataConfigurationWizardPage.java 2009-07-02 09:18:17 UTC (rev 16333)
@@ -0,0 +1,512 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.configuration.editors.csv;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.smooks.configuration.editors.json.JsonDataConfiguraitonWizardPage.KeyValueModel;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.model.csv.CsvReader;
+import org.jboss.tools.smooks.model.csv.impl.CsvReaderImpl;
+import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
+
+/**
+ * @author Dart
+ *
+ */
+public class CSVDataConfigurationWizardPage extends WizardPage {
+
+ private SmooksResourceListType smooksResourceList;
+ private Button newReaderConfigButton;
+ private Button useAvailableReaderConfigButton;
+ private Composite configComposite;
+ private Text separatorText;
+ private Text quoteCharText;
+ private Text skipLinesText;
+ private Text encodingText;
+ private Composite fieldsComposite;
+ private TableViewer fieldsViewer;
+ private Button addButton;
+ private Button removeButton;
+ private Button createCSVReaderButton;
+
+ private boolean useAvailabelReader = false;
+
+ private boolean hasReader = false;
+
+ private boolean createCSVReader = true;
+
+ private String speartor;
+
+ private String skipLines;
+
+ private String quoteChar;
+
+ private String encoding;
+
+ private List<FieldString> fieldsList = new ArrayList<FieldString>();
+
+ public CSVDataConfigurationWizardPage(String pageName, String title, ImageDescriptor titleImage) {
+ super(pageName, title, titleImage);
+ }
+
+ public CSVDataConfigurationWizardPage(String pageName) {
+ super(pageName);
+ this.setTitle("CSV Reader configurations");
+ this.setDescription("Set the configurations for parsing CSV file.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ initValue();
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ mainComposite.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ mainComposite.setLayoutData(gd);
+
+ Composite radioButtonComposite = new Composite(mainComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ radioButtonComposite.setLayoutData(gd);
+
+ GridLayout rgl = new GridLayout();
+ rgl.numColumns = 2;
+ rgl.marginHeight = 0;
+ rgl.marginWidth = 0;
+ radioButtonComposite.setLayout(rgl);
+
+ Composite spaceComposite = new Composite(mainComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ gd.heightHint = 20;
+ spaceComposite.setLayoutData(gd);
+
+ newReaderConfigButton = new Button(radioButtonComposite, SWT.RADIO);
+ newReaderConfigButton.setText("Create new CSV reader configurations");
+ newReaderConfigButton.setSelection(true);
+
+ useAvailableReaderConfigButton = new Button(radioButtonComposite, SWT.RADIO);
+ useAvailableReaderConfigButton.setText("Use available CSV reader configurations");
+
+ configComposite = new Composite(mainComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ configComposite.setLayoutData(gd);
+
+ GridLayout cgl = new GridLayout();
+ cgl.marginHeight = 0;
+ cgl.marginWidth = 0;
+ cgl.numColumns = 2;
+ configComposite.setLayout(cgl);
+ /**
+ * String fields, char separator, char quoteChar, int skipLines, String
+ * encoding
+ */
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ Label rootnameLabel = new Label(configComposite, SWT.NONE);
+ rootnameLabel.setText("Separator");
+ separatorText = new Text(configComposite, SWT.BORDER);
+ separatorText.setLayoutData(gd);
+
+ Label arrayElementNameLabel = new Label(configComposite, SWT.NONE);
+ arrayElementNameLabel.setText("Quote Char");
+ quoteCharText = new Text(configComposite, SWT.BORDER);
+ quoteCharText.setLayoutData(gd);
+
+ Label skiplineLabel = new Label(configComposite, SWT.NONE);
+ skiplineLabel.setText("Skip Lines");
+ skipLinesText = new Text(configComposite, SWT.BORDER);
+ skipLinesText.setLayoutData(gd);
+
+ Label encodingLabel = new Label(configComposite, SWT.NONE);
+ encodingLabel.setText("Encoding");
+ encodingText = new Text(configComposite, SWT.BORDER);
+ encodingText.setLayoutData(gd);
+ encodingText.setText(encoding);
+
+ Label keyMapLabel = new Label(configComposite, SWT.NONE);
+ keyMapLabel.setText("Fields List:");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ keyMapLabel.setLayoutData(gd);
+
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+
+ fieldsComposite = new Composite(configComposite, SWT.NONE);
+ fieldsComposite.setLayoutData(gd);
+
+ GridLayout kgl = new GridLayout();
+ kgl.numColumns = 2;
+ fieldsComposite.setLayout(kgl);
+
+ gd = new GridData(GridData.FILL_BOTH);
+
+ fieldsViewer = new TableViewer(fieldsComposite, SWT.BORDER | SWT.MULTI);
+ fieldsViewer.getControl().setLayoutData(gd);
+// fieldsViewer.getTable().setHeaderVisible(true);
+ fieldsViewer.getTable().setLinesVisible(true);
+ fieldsViewer.setContentProvider(new FieldsContentProvider());
+ fieldsViewer.setLabelProvider(new FieldsLabelProvider());
+
+ CellEditor fieldCellEditor = new TextCellEditor(fieldsViewer.getTable(), SWT.BORDER);
+
+ fieldsViewer.setCellEditors(new CellEditor[] { fieldCellEditor });
+
+ fieldsViewer.setColumnProperties(new String[] { "field" });
+
+ fieldsViewer.setCellModifier(new ICellModifier() {
+
+ public void modify(Object element, String property, Object value) {
+ Object el = null;
+ if (element instanceof Item) {
+ el = ((Item) element).getData();
+ }
+ if (el == null)
+ return;
+ if (el instanceof FieldString && value instanceof String) {
+ if (property.equals("field")) {
+ ((FieldString) el).setText(value.toString());
+ }
+ fieldsViewer.refresh(el);
+ }
+ }
+
+ public Object getValue(Object element, String property) {
+ // Object el = null;
+ // if(element instanceof Item){
+ // el = ((Item)element).getData();
+ // }
+ // if(el == null) return null;
+ if (element instanceof FieldString) {
+ if (property.equals("field")) {
+ return ((FieldString) element).getText();
+ }
+ }
+
+ return null;
+ }
+
+ public boolean canModify(Object element, String property) {
+ // Object el = null;
+ // if(element instanceof Item){
+ // el = ((Item)element).getData();
+ // }
+ // if(el == null) return false;
+ if (element instanceof FieldString) {
+ if (property.equals("field")) {
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+
+ fieldsViewer.setInput(fieldsList);
+
+ Composite buttonComposite = new Composite(fieldsComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_VERTICAL);
+ buttonComposite.setLayoutData(gd);
+
+ GridLayout bgl = new GridLayout();
+ buttonComposite.setLayout(bgl);
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+
+ addButton = new Button(buttonComposite, SWT.NONE);
+ addButton.setLayoutData(gd);
+ addButton.setText("Add");
+
+ removeButton = new Button(buttonComposite, SWT.NONE);
+ removeButton.setLayoutData(gd);
+ removeButton.setText("Remove");
+
+ createCSVReaderButton = new Button(configComposite, SWT.CHECK);
+ createCSVReaderButton.setText("Create a CSV Reader");
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ createCSVReaderButton.setLayoutData(gd);
+ createCSVReaderButton.setSelection(createCSVReader);
+
+ if (hasReader) {
+ useAvailableReaderConfigButton.setSelection(true);
+ newReaderConfigButton.setSelection(false);
+ createCSVReaderButton.setEnabled(false);
+ setConfigCompositeStates(false);
+ }
+
+ changePageStatus();
+ hookControls();
+
+ this.setControl(mainComposite);
+ }
+
+ private void hookControls() {
+ newReaderConfigButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ if (newReaderConfigButton.getSelection()) {
+ setConfigCompositeStates(true);
+ useAvailabelReader = false;
+ changePageStatus();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ useAvailableReaderConfigButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ if (useAvailableReaderConfigButton.getSelection()) {
+ setConfigCompositeStates(false);
+ useAvailabelReader = true;
+ changePageStatus();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ this.separatorText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ speartor = separatorText.getText();
+ changePageStatus();
+ }
+ });
+
+ this.quoteCharText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ quoteChar = quoteCharText.getText();
+ changePageStatus();
+ }
+ });
+
+ this.skipLinesText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ skipLines = skipLinesText.getText();
+ changePageStatus();
+ }
+ });
+
+ this.encodingText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ encoding = encodingText.getText();
+ changePageStatus();
+ }
+ });
+
+ this.addButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ FieldString field = new FieldString("field");
+ fieldsList.add(field);
+ fieldsViewer.refresh();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ this.removeButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection s = (IStructuredSelection)fieldsViewer.getSelection();
+ fieldsList.removeAll(s.toList());
+ fieldsViewer.refresh();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+ }
+
+ private void changePageStatus() {
+ if (useAvailabelReader) {
+ return;
+ }
+ String error = null;
+
+ if (speartor == null || speartor.length() == 0) {
+ error = "Sperator can't be null";
+ }
+
+ if (quoteChar == null || quoteChar.length() == 0) {
+ error = "Quote char can't be null";
+ }
+
+ if (encoding == null || encoding.length() == 0) {
+ error = "Encoding can't be null";
+ }
+
+ if (skipLines == null || skipLines.length() == 0) {
+ error = "Skip lines can't be null";
+ } else {
+ try {
+ Integer.parseInt(skipLines);
+ } catch (Throwable t) {
+ error = "Skip lines text must be the number";
+ }
+ }
+
+ setErrorMessage(error);
+ setPageComplete(error == null);
+ }
+
+ private void setConfigCompositeStates(boolean enabled) {
+ configComposite.setEnabled(enabled);
+ Control[] controls = configComposite.getChildren();
+ for (int i = 0; i < controls.length; i++) {
+ Control c = controls[i];
+ if (c == createCSVReaderButton) {
+ if (hasReader) {
+ c.setEnabled(false);
+ continue;
+ }
+ }
+ if (c == fieldsComposite) {
+ Control[] cs = ((Composite) c).getChildren();
+ for (int j = 0; j < cs.length; j++) {
+ Control cc = cs[j];
+ cc.setEnabled(enabled);
+ }
+ }
+ c.setEnabled(enabled);
+ }
+ }
+
+ private void initValue() {
+ useAvailabelReader = false;
+
+ hasReader = false;
+
+ if (SmooksUIUtils.hasReaderAlready(CsvReader.class, smooksResourceList)
+ || SmooksUIUtils.hasReaderAlready(CsvReaderImpl.class, smooksResourceList)) {
+ hasReader = true;
+ }
+
+ createCSVReader = true;
+
+ encoding = "UTF-8";
+
+ speartor = null;
+
+ skipLines = null;
+
+ quoteChar = null;
+
+ fieldsList.clear();
+
+ if (hasReader) {
+ createCSVReader = false;
+ useAvailabelReader = true;
+ }
+ }
+
+ public SmooksResourceListType getSmooksResourceList() {
+ return smooksResourceList;
+ }
+
+ public void setSmooksResourceList(SmooksResourceListType smooksResourceList) {
+ this.smooksResourceList = smooksResourceList;
+ }
+
+ private class FieldString {
+ private String text = null;
+
+ public FieldString(String text) {
+ this.setText(text);
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+ }
+
+ private class FieldsLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if(element instanceof FieldString){
+ return ((FieldString)element).getText();
+ }
+ return getText(element);
+ }
+
+ }
+
+ private class FieldsContentProvider implements IStructuredContentProvider {
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof List<?>) {
+ return ((List<?>) inputElement).toArray();
+ }
+ return new Object[] {};
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataConfigurationWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataPathWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataPathWizardPage.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataPathWizardPage.java 2009-07-02 09:18:17 UTC (rev 16333)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.editors.csv;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.jboss.tools.smooks.configuration.editors.xml.AbstractFileSelectionWizardPage;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class CSVDataPathWizardPage extends AbstractFileSelectionWizardPage {
+
+ public CSVDataPathWizardPage(String pageName, boolean multiSelect, Object[] initSelections,
+ List<ViewerFilter> filters) {
+ super(pageName, multiSelect, initSelections, filters);
+ }
+
+ public CSVDataPathWizardPage(String pageName, String[] fileExtensionNames) {
+ super(pageName, fileExtensionNames);
+ this.setTitle("CSV file selection");
+ this.setDescription("Select a CSV data file");
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.xml.AbstractFileSelectionWizardPage#loadedTheObject(java.lang.String)
+ */
+ @Override
+ protected Object loadedTheObject(String path) throws Exception {
+ return null;
+ }
+
+ @Override
+ protected void changeWizardPageStatus() {
+ super.changeWizardPageStatus();
+ }
+
+ @Override
+ public boolean canFlipToNextPage() {
+ return super.canFlipToNextPage();
+// String filePath = this.getFilePath();
+// try {
+// filePath = SmooksUIUtils.parseFilePath(filePath);
+// if(filePath == null) return false;
+// return new File(filePath).exists();
+// } catch (InvocationTargetException e) {
+// return false;
+// }
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataPathWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVInputDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVInputDataWizard.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVInputDataWizard.java 2009-07-02 09:18:17 UTC (rev 16333)
@@ -0,0 +1,131 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.configuration.editors.csv;
+
+import java.util.Properties;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard;
+import org.jboss.tools.smooks.model.smooks.DocumentRoot;
+import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
+
+/**
+ * @author Dart
+ *
+ */
+public class CSVInputDataWizard extends Wizard implements IStructuredDataSelectionWizard, INewWizard {
+
+ private SmooksResourceListType resourceList ;
+
+ private EditingDomain editingDomain;
+
+ private CSVDataConfigurationWizardPage configPage;
+
+ private CSVDataPathWizardPage pathPage;
+
+
+ public CSVInputDataWizard() {
+ super();
+ this.setWindowTitle("CSV Input Data Wizard");
+ }
+
+
+
+ @Override
+ public void addPages() {
+ if(pathPage == null){
+ pathPage = new CSVDataPathWizardPage("CSV Path Page", new String[]{});
+ }
+ if(configPage == null){
+ configPage = new CSVDataConfigurationWizardPage("CSV Configurations Page");
+ configPage.setSmooksResourceList(resourceList);
+ }
+ this.addPage(pathPage);
+ this.addPage(configPage);
+ super.addPages();
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ if(configPage != null){
+
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard#complate(org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ public void complate(SmooksMultiFormEditor formEditor) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard#getInputDataTypeID()
+ */
+ public String getInputDataTypeID() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard#getProperties()
+ */
+ public Properties getProperties() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard#getReturnData()
+ */
+ public Object getReturnData() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard#getStructuredDataSourcePath()
+ */
+ public String getStructuredDataSourcePath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+ */
+ public void init(IEditorSite site, IEditorInput input) {
+ IEditorPart editorPart = site.getWorkbenchWindow().getActivePage().findEditor(input);
+ if (editorPart != null && editorPart instanceof SmooksMultiFormEditor) {
+ SmooksMultiFormEditor formEditor = (SmooksMultiFormEditor) editorPart;
+ Object smooksModel = formEditor.getSmooksModel();
+ if (smooksModel instanceof DocumentRoot) {
+ resourceList = ((DocumentRoot) smooksModel).getSmooksResourceList();
+ }
+ editingDomain = formEditor.getEditingDomain();
+ }
+ if(configPage != null){
+ configPage.setSmooksResourceList(resourceList);
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVInputDataWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2009-07-02 08:31:50 UTC (rev 16332)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2009-07-02 09:18:17 UTC (rev 16333)
@@ -17,6 +17,7 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
+import org.jboss.tools.smooks.configuration.editors.csv.CSVInputDataWizard;
import org.jboss.tools.smooks.configuration.editors.javabean.JavabeanContentProvider;
import org.jboss.tools.smooks.configuration.editors.javabean.JavabeanStrucutredDataWizard;
import org.jboss.tools.smooks.configuration.editors.javabean.JavabeanlabelProvider;
@@ -54,17 +55,17 @@
IViewerInitor initor = this.getInitorMap().get(typeID);
if (initor == null)
return null;
- IStructuredDataSelectionWizard wizard = initor.getStructuredDataLoadWizard();
- return wizard;
-// if(wizard != null){
-// try {
-// return wizard.getClass().newInstance();
-// } catch (Throwable t){
-// t.printStackTrace();
-// return wizard;
-// }
-// }
-// return null;
+ IStructuredDataSelectionWizard wizard = initor.getStructuredDataLoadWizard();
+ return wizard;
+ // if(wizard != null){
+ // try {
+ // return wizard.getClass().newInstance();
+ // } catch (Throwable t){
+ // t.printStackTrace();
+ // return wizard;
+ // }
+ // }
+ // return null;
}
public ILabelProvider getLabelProvider(String typeID) {
@@ -136,7 +137,7 @@
protected HashMap<String, IViewerInitor> createNewInitorMap() {
HashMap<String, IViewerInitor> map = new HashMap<String, IViewerInitor>();
-
+
// for json
BaseViewerInitor jsonViewerInitor = new BaseViewerInitor();
String name = "Json";
@@ -151,13 +152,12 @@
jsonViewerInitor.setLabelProvider(new XMLStructuredDataLabelProvider());
jsonViewerInitor.setTreeContentProvider(new XMLStructuredDataContentProvider());
jsonViewerInitor.setStructuredDataLoadWizard(new JsonDataWizard());
-// jsonViewerInitor.setWizardIconPath(GraphicsConstants.IMAGE_JAVA_FILE);
+ // jsonViewerInitor.setWizardIconPath(GraphicsConstants.IMAGE_JAVA_FILE);
map.put(typeID, jsonViewerInitor);
-
// for java
BaseViewerInitor javabeanViewerInitor = new BaseViewerInitor();
- name = "Java";
+ name = "Java";
description = "Select a Java type(class,interface) as the input data.";
iconPath = null;
typeID = SmooksModelUtils.INPUT_TYPE_JAVA;
@@ -208,7 +208,23 @@
xsdViewerInitor.setWizardIconPath(GraphicsConstants.IMAGE_XSD_FILE);
map.put(typeID, xsdViewerInitor);
-
+ // for Csv
+ BaseViewerInitor csvViewerInitor = new BaseViewerInitor();
+ name = "CSV";
+ description = "Select CSV data file as the input data.";
+ iconPath = null;
+ typeID = SmooksModelUtils.INPUT_TYPE_CSV;
+
+ csvViewerInitor.setName(name);
+ csvViewerInitor.setDescription(description);
+ csvViewerInitor.setWizardIconPath(iconPath);
+ csvViewerInitor.setTypeID(typeID);
+ csvViewerInitor.setLabelProvider(new XMLStructuredDataLabelProvider());
+ csvViewerInitor.setTreeContentProvider(new XMLStructuredDataContentProvider());
+ csvViewerInitor.setStructuredDataLoadWizard(new CSVInputDataWizard());
+ // jsonViewerInitor.setWizardIconPath(GraphicsConstants.IMAGE_JAVA_FILE);
+ map.put(typeID, csvViewerInitor);
+
return map;
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java 2009-07-02 08:31:50 UTC (rev 16332)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java 2009-07-02 09:18:17 UTC (rev 16333)
@@ -66,7 +66,7 @@
public AbstractFileSelectionWizardPage(String pageName, String[] fileExtensionNames) {
this(pageName, false, null, Collections.EMPTY_LIST);
this.fileExtensionNames = fileExtensionNames;
- if (this.fileExtensionNames != null && fileExtensionNames.length != 0) {
+ if (this.fileExtensionNames != null && this.fileExtensionNames.length != 0) {
ViewerFilter extensionNameFilter = new ViewerFilter() {
/*
* (non-Javadoc)
13 years, 8 months
JBoss Tools SVN: r16332 - in trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui: commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-07-02 04:31:50 -0400 (Thu, 02 Jul 2009)
New Revision: 16332
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
Log:
JBIDE-4532: when delete the partnerlink, a exception occured:java.lang.ClassCastException: org.eclipse.wst.wsdl.util.WSDLResourceImpl
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java 2009-07-02 06:40:38 UTC (rev 16331)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/DeleteChildCommand.java 2009-07-02 08:31:50 UTC (rev 16332)
@@ -182,25 +182,28 @@
HashSet deletingSet = new HashSet();
ModelHelper.addSubtreeToCollection(fChild, deletingSet);
- // We should ask the user if delete the partner link type
- if (MessageDialog.openQuestion(PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getShell(),
- Messages.DeletePartnerLinkTypeWarningDialogTitle,
- Messages.DeletePartnerLinkTypeWarningMessage)) {
- // If we are deleting any PartnerLinks which reference PLTs in the
- // Artifacts WSDL
- // file, also delete the referenced PLTs.
- Set<PartnerLinkType> partnerLinkTypes = null;
- Definition artifactsDefinition = bpelEditor
- .getArtifactsDefinition();
+ // If we are deleting any PartnerLinks which reference PLTs in the
+ // Artifacts WSDL
+ // file, also delete the referenced PLTs.
+ Set<PartnerLinkType> partnerLinkTypes = null;
+ Definition artifactsDefinition = bpelEditor.getArtifactsDefinition();
- for (Iterator it = deletingSet.iterator(); it.hasNext();) {
- Object object = it.next();
- if (object instanceof PartnerLink) {
- PartnerLinkType plt = ((PartnerLink) object)
- .getPartnerLinkType();
- if ((plt != null)
- && (plt.getEnclosingDefinition() == artifactsDefinition)) {
+ for (Iterator it = deletingSet.iterator(); it.hasNext();) {
+ Object object = it.next();
+ if (object instanceof PartnerLink) {
+ PartnerLinkType plt = ((PartnerLink) object)
+ .getPartnerLinkType();
+ if ((plt != null)
+ && (plt.getEnclosingDefinition() == artifactsDefinition)) {
+ // We should ask the user if delete the partner link type
+ if (MessageDialog
+ .openQuestion(
+ PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow()
+ .getShell(),
+ Messages.DeletePartnerLinkTypeWarningDialogTitle,
+ NLS.bind(Messages.DeletePartnerLinkTypeWarningMessage,
+ (new Object[] {((PartnerLink) object).getName(), plt.getName() })))) {
if (partnerLinkTypes == null)
partnerLinkTypes = new HashSet<PartnerLinkType>();
if (partnerLinkTypes.add(plt)) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-07-02 06:40:38 UTC (rev 16331)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-07-02 08:31:50 UTC (rev 16332)
@@ -136,13 +136,7 @@
BPELPreferencePage_WSIL_EnterLocation = <enter location>
#
# This has \n for a reason. The wrapping in the widget works, but not as expected.
-BPELPreferencePage_WSIL_Description = \
-
-The document above contains links to other WSIL documents shown below.\n\
-
-You can add or remove WSIL links to/from the above document.\n\
-
-The result will be shown in the WSIL browser of the editor.
+BPELPreferencePage_WSIL_Description =
#
BPELUIRegistry_Expression_language_editors_must_provide_expressionLanguage_and_class__8=Expression language editors must provide expressionLanguage and class.
BPELUtil__unknown_URI__54=<unknown URI>
@@ -700,4 +694,4 @@
SaveImageAction_3=Error
SaveImageAction_4=Can't save image to the file {0}
DeletePartnerLinkTypeWarningDialogTitle=Warning
-DeletePartnerLinkTypeWarningMessage=When you delete the partnerlink, you may delete the reference PartnerLinkType too, do you want to delete the PartnerLinkType?
+DeletePartnerLinkTypeWarningMessage=When you delete the PartnerLink -- ''{0}'', you may delete its reference PartnerLinkType -- ''{1}'' too, do you want to delete the PartnerLinkType?
13 years, 8 months
JBoss Tools SVN: r16331 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration: editors/json and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-02 02:40:38 -0400 (Thu, 02 Jul 2009)
New Revision: 16331
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/AddSmooksResourceAction.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.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/configuration/editors/wizard/IStructuredDataSelectionWizard.java
Log:
JBIDE-4540
Control the number of JSON reader in smooks config file.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/AddSmooksResourceAction.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/AddSmooksResourceAction.java 2009-07-02 06:38:51 UTC (rev 16330)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/AddSmooksResourceAction.java 2009-07-02 06:40:38 UTC (rev 16331)
@@ -10,18 +10,25 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.actions;
+import java.util.Collection;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.command.CreateChildCommand;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.ui.action.CreateChildAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.model.smooks.AbstractReader;
+import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
/**
* @author Dart (dpeng(a)redhat.com)
- *
+ *
*/
public class AddSmooksResourceAction extends CreateChildAction {
@@ -47,20 +54,48 @@
public void setDescriptor(Object descriptor) {
this.descriptor = descriptor;
}
-
- protected void resetActionText(){
- if(descriptor instanceof CommandParameter){
- CommandParameter parameter = (CommandParameter)descriptor;
- if(parameter.getValue() != null){
+
+ protected boolean canCreateReaderCommand(AbstractReader value, SmooksResourceListType resourceList) {
+ return !SmooksUIUtils.hasReaderAlready(value.getClass(), resourceList);
+ }
+
+ @Override
+ protected Command createActionCommand(EditingDomain editingDomain, Collection<?> collection) {
+ if (collection.size() == 1) {
+ Object obj = collection.iterator().next();
+ SmooksResourceListType listType = null;
+ if (obj instanceof EObject) {
+ listType = SmooksUIUtils.getSmooks11ResourceListType((EObject) obj);
+ }
+ if (descriptor != null && descriptor instanceof CommandParameter) {
+ CommandParameter parameter = (CommandParameter) descriptor;
+ if (parameter.getValue() != null) {
+ Object value = AdapterFactoryEditingDomain.unwrap(parameter.getValue());
+ if (value instanceof AbstractReader) {
+ if (!canCreateReaderCommand((AbstractReader) value, listType)) {
+ return CreateChildCommand.create(editingDomain, null,
+ descriptor, collection);
+ }
+ }
+ }
+ }
+ }
+ return super.createActionCommand(editingDomain, collection);
+ }
+
+ protected void resetActionText() {
+ if (descriptor instanceof CommandParameter) {
+ CommandParameter parameter = (CommandParameter) descriptor;
+ if (parameter.getValue() != null) {
Object value = AdapterFactoryEditingDomain.unwrap(parameter.getValue());
- if(value instanceof AbstractReader){
-// if(value instanceof JsonReader){
-// setText("JSON Reader");
-// }
-//
-// if(value instanceof ReaderType){
-// setText("Custome Reader");
-// }
+ if (value instanceof AbstractReader) {
+ // if(value instanceof JsonReader){
+ // setText("JSON Reader");
+ // }
+ //
+ // if(value instanceof ReaderType){
+ // setText("Custome Reader");
+ // }
}
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java 2009-07-02 06:38:51 UTC (rev 16330)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java 2009-07-02 06:40:38 UTC (rev 16331)
@@ -35,10 +35,15 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.model.json.JsonReader;
+import org.jboss.tools.smooks.model.json.impl.JsonReaderImpl;
+import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
/**
* @author Dart (dpeng(a)redhat.com)
@@ -86,7 +91,31 @@
protected boolean createJsonReader = true;
+ private Button newReaderConfigButton;
+
+ private Button useAvailableReaderConfigButton;
+
+ private SmooksResourceListType resourceList;
+
+ private boolean hasReader = false;
+
+ private boolean useAvailabelReader = false;
+
+ private Composite configComposite;
+
+ private Composite keyMapComposite;
+
+
+
private void initValue() {
+ hasReader = false;
+ if (SmooksUIUtils.hasReaderAlready(JsonReaderImpl.class, resourceList)
+ || SmooksUIUtils.hasReaderAlready(JsonReader.class, resourceList)) {
+ hasReader = true;
+ }
+
+ useAvailabelReader= false;
+
rootName = null;
createJsonReader = true;
@@ -106,6 +135,11 @@
keyValueList = new ArrayList<KeyValueModel>();
}
+ if (hasReader) {
+ useAvailabelReader = true;
+ createJsonReader = false;
+ }
+
}
/*
@@ -126,53 +160,85 @@
gd.grabExcessVerticalSpace = true;
mainComposite.setLayoutData(gd);
+ Composite radioButtonComposite = new Composite(mainComposite, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
- Label rootnameLabel = new Label(mainComposite, SWT.NONE);
+ gd.horizontalSpan = 2;
+ radioButtonComposite.setLayoutData(gd);
+
+ GridLayout rgl = new GridLayout();
+ rgl.numColumns = 2;
+ rgl.marginHeight = 0;
+ rgl.marginWidth = 0;
+ radioButtonComposite.setLayout(rgl);
+
+ Composite spaceComposite = new Composite(mainComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ gd.heightHint = 20;
+ spaceComposite.setLayoutData(gd);
+
+ newReaderConfigButton = new Button(radioButtonComposite, SWT.RADIO);
+ newReaderConfigButton.setText("Create new JSON reader configurations");
+ newReaderConfigButton.setSelection(true);
+
+ useAvailableReaderConfigButton = new Button(radioButtonComposite, SWT.RADIO);
+ useAvailableReaderConfigButton.setText("Use available JSON reader configurations");
+
+ configComposite = new Composite(mainComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ configComposite.setLayoutData(gd);
+
+ GridLayout cgl = new GridLayout();
+ cgl.marginHeight = 0;
+ cgl.marginWidth = 0;
+ cgl.numColumns = 2;
+ configComposite.setLayout(cgl);
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ Label rootnameLabel = new Label(configComposite, SWT.NONE);
rootnameLabel.setText("Root Element Name");
- rootNameText = new Text(mainComposite, SWT.BORDER);
+ rootNameText = new Text(configComposite, SWT.BORDER);
rootNameText.setLayoutData(gd);
- Label arrayElementNameLabel = new Label(mainComposite, SWT.NONE);
+ Label arrayElementNameLabel = new Label(configComposite, SWT.NONE);
arrayElementNameLabel.setText("Array Element Name");
- arrayElementNameText = new Text(mainComposite, SWT.BORDER);
+ arrayElementNameText = new Text(configComposite, SWT.BORDER);
arrayElementNameText.setLayoutData(gd);
arrayElementNameText.setText(arrayElementName);
- Label keyWhitspaceReplacementLabel = new Label(mainComposite, SWT.NONE);
+ Label keyWhitspaceReplacementLabel = new Label(configComposite, SWT.NONE);
keyWhitspaceReplacementLabel.setText("Space Replacement");
- keyWhitspaceReplacementText = new Text(mainComposite, SWT.BORDER);
+ keyWhitspaceReplacementText = new Text(configComposite, SWT.BORDER);
keyWhitspaceReplacementText.setLayoutData(gd);
if (keyWhitspaceReplacement == null) {
keyWhitspaceReplacement = "";
}
keyWhitspaceReplacementText.setText(keyWhitspaceReplacement);
- Label keyPrefixOnNumeric = new Label(mainComposite, SWT.NONE);
+ Label keyPrefixOnNumeric = new Label(configComposite, SWT.NONE);
keyPrefixOnNumeric.setText("Prefix On Numeric");
- keyPrefixOnNumericText = new Text(mainComposite, SWT.BORDER);
+ keyPrefixOnNumericText = new Text(configComposite, SWT.BORDER);
keyPrefixOnNumericText.setLayoutData(gd);
- Label illegalElementNameCharReplacementLabel = new Label(mainComposite,
- SWT.NONE);
- illegalElementNameCharReplacementLabel
- .setText("IllegalChar Replacement");
- illegalElementNameCharReplacementText = new Text(mainComposite,
- SWT.BORDER);
+ Label illegalElementNameCharReplacementLabel = new Label(configComposite, SWT.NONE);
+ illegalElementNameCharReplacementLabel.setText("IllegalChar Replacement");
+ illegalElementNameCharReplacementText = new Text(configComposite, SWT.BORDER);
illegalElementNameCharReplacementText.setLayoutData(gd);
- Label nullValueReplacementlabel = new Label(mainComposite, SWT.NONE);
+ Label nullValueReplacementlabel = new Label(configComposite, SWT.NONE);
nullValueReplacementlabel.setText("NullValue Replacement");
- nullValueReplacementText = new Text(mainComposite, SWT.BORDER);
+ nullValueReplacementText = new Text(configComposite, SWT.BORDER);
nullValueReplacementText.setLayoutData(gd);
nullValueReplacementText.setText(nullValueReplacement);
- Label encodingLabel = new Label(mainComposite, SWT.NONE);
+ Label encodingLabel = new Label(configComposite, SWT.NONE);
encodingLabel.setText("Encoding");
- encodingText = new Text(mainComposite, SWT.BORDER);
+ encodingText = new Text(configComposite, SWT.BORDER);
encodingText.setLayoutData(gd);
encodingText.setText(encoding);
- Label keyMapLabel = new Label(mainComposite, SWT.NONE);
+ Label keyMapLabel = new Label(configComposite, SWT.NONE);
keyMapLabel.setText("Key Map:");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
@@ -181,7 +247,7 @@
gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
- Composite keyMapComposite = new Composite(mainComposite, SWT.NONE);
+ keyMapComposite = new Composite(configComposite, SWT.NONE);
keyMapComposite.setLayoutData(gd);
GridLayout kgl = new GridLayout();
@@ -197,14 +263,11 @@
keyMapViewer.setContentProvider(new KeyMapContentProvider());
keyMapViewer.setLabelProvider(new KeyMapLabelProvider());
- CellEditor keyCellEditor = new TextCellEditor(keyMapViewer.getTable(),
- SWT.BORDER);
+ CellEditor keyCellEditor = new TextCellEditor(keyMapViewer.getTable(), SWT.BORDER);
- CellEditor valueCellEditor = new TextCellEditor(
- keyMapViewer.getTable(), SWT.BORDER);
+ CellEditor valueCellEditor = new TextCellEditor(keyMapViewer.getTable(), SWT.BORDER);
- keyMapViewer.setCellEditors(new CellEditor[] { keyCellEditor,
- valueCellEditor });
+ keyMapViewer.setCellEditors(new CellEditor[] { keyCellEditor, valueCellEditor });
keyMapViewer.setColumnProperties(new String[] { "key", "value" });
@@ -261,13 +324,11 @@
}
});
- TableColumn keyColumn = new TableColumn(keyMapViewer.getTable(),
- SWT.BORDER);
+ TableColumn keyColumn = new TableColumn(keyMapViewer.getTable(), SWT.BORDER);
keyColumn.setWidth(150);
keyColumn.setText("Key");
- TableColumn replaceColumn = new TableColumn(keyMapViewer.getTable(),
- SWT.BORDER);
+ TableColumn replaceColumn = new TableColumn(keyMapViewer.getTable(), SWT.BORDER);
replaceColumn.setWidth(150);
replaceColumn.setText("Replace");
@@ -290,20 +351,81 @@
removeButton.setLayoutData(gd);
removeButton.setText("Remove");
- createJsonReaderButton = new Button(mainComposite, SWT.CHECK);
+ createJsonReaderButton = new Button(configComposite, SWT.CHECK);
createJsonReaderButton.setText("Create a JSON Reader");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
createJsonReaderButton.setLayoutData(gd);
- createJsonReaderButton.setSelection(true);
+ createJsonReaderButton.setSelection(createJsonReader);
+
+ if (hasReader) {
+ createJsonReaderButton.setEnabled(false);
+ newReaderConfigButton.setSelection(false);
+ useAvailableReaderConfigButton.setSelection(true);
+ setConfigCompositeStates(false);
+// configComposite.setEnabled(false);
+ }
hookControls();
changePageStatus();
this.setControl(mainComposite);
}
+
+ private void setConfigCompositeStates(boolean enabled){
+ configComposite.setEnabled(enabled);
+ Control[] controls = configComposite.getChildren();
+ for (int i = 0; i < controls.length; i++) {
+ Control c = controls[i];
+ if(c == createJsonReaderButton){
+ if(hasReader){
+ c.setEnabled(false);
+ continue;
+ }
+ }
+ if(c == keyMapComposite){
+ Control[] cs = ((Composite)c).getChildren();
+ for (int j = 0; j < cs.length; j++) {
+ Control cc = cs[j];
+ cc.setEnabled(enabled);
+ }
+ }
+ c.setEnabled(enabled);
+ }
+ }
private void hookControls() {
+ newReaderConfigButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (newReaderConfigButton.getSelection()) {
+ useAvailabelReader = false;
+ changePageStatus();
+ setConfigCompositeStates(true);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ useAvailableReaderConfigButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (useAvailableReaderConfigButton.getSelection()) {
+ useAvailabelReader = true;
+ changePageStatus();
+ setConfigCompositeStates(false);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+
addButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
@@ -318,11 +440,9 @@
removeButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) keyMapViewer
- .getSelection();
+ IStructuredSelection selection = (IStructuredSelection) keyMapViewer.getSelection();
List<?> selections = selection.toList();
- for (Iterator<?> iterator = selections.iterator(); iterator
- .hasNext();) {
+ for (Iterator<?> iterator = selections.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
keyValueList.remove(object);
}
@@ -362,15 +482,13 @@
}
});
- illegalElementNameCharReplacementText
- .addModifyListener(new ModifyListener() {
+ illegalElementNameCharReplacementText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- illegalElementNameCharReplacement = illegalElementNameCharReplacementText
- .getText();
- changePageStatus();
- }
- });
+ public void modifyText(ModifyEvent e) {
+ illegalElementNameCharReplacement = illegalElementNameCharReplacementText.getText();
+ changePageStatus();
+ }
+ });
keyPrefixOnNumericText.addModifyListener(new ModifyListener() {
@@ -407,6 +525,11 @@
private void changePageStatus() {
String error = null;
+ if (useAvailabelReader) {
+ setErrorMessage(null);
+ setPageComplete(true);
+ return;
+ }
rootName = rootNameText.getText();
if (rootName == null || rootName.length() == 0) {
error = "Root Name can't be null";
@@ -431,14 +554,14 @@
setPageComplete(error == null);
}
- public JsonDataConfiguraitonWizardPage(String pageName, String title,
- ImageDescriptor titleImage) {
+ public JsonDataConfiguraitonWizardPage(String pageName, String title, ImageDescriptor titleImage) {
super(pageName, title, titleImage);
- // TODO Auto-generated constructor stub
}
public JsonDataConfiguraitonWizardPage(String pageName) {
super(pageName);
+ this.setTitle("JSON Reader configurations");
+ this.setDescription("Set the configurations for parsing JSON file.");
}
public String getRootName() {
@@ -477,8 +600,7 @@
return illegalElementNameCharReplacement;
}
- public void setIllegalElementNameCharReplacement(
- String illegalElementNameCharReplacement) {
+ public void setIllegalElementNameCharReplacement(String illegalElementNameCharReplacement) {
this.illegalElementNameCharReplacement = illegalElementNameCharReplacement;
}
@@ -490,18 +612,37 @@
this.nullValueReplacement = nullValueReplacement;
}
-// public Map<String, String> getKeyMap() {
-// return keyMap;
-// }
-//
-// public void setKeyMap(Map<String, String> keyMap) {
-// this.keyMap = keyMap;
-// }
+ // public Map<String, String> getKeyMap() {
+ // return keyMap;
+ // }
+ //
+ // public void setKeyMap(Map<String, String> keyMap) {
+ // this.keyMap = keyMap;
+ // }
+
+
public String getEncoding() {
return encoding;
}
+
+
+ public boolean isUseAvailabelReader() {
+ return useAvailabelReader;
+ }
+ public void setUseAvailabelReader(boolean useAvailabelReader) {
+ this.useAvailabelReader = useAvailabelReader;
+ }
+
+ public SmooksResourceListType getSmooksResourceList() {
+ return resourceList;
+ }
+
+ public void setSmooksResourceList(SmooksResourceListType resourceList) {
+ this.resourceList = resourceList;
+ }
+
public void setEncoding(String encoding) {
this.encoding = encoding;
}
@@ -522,11 +663,8 @@
this.createJsonReader = createJsonReader;
}
+ private class KeyMapLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- private class KeyMapLabelProvider extends LabelProvider implements
- ITableLabelProvider {
-
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java 2009-07-02 06:38:51 UTC (rev 16330)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java 2009-07-02 06:40:38 UTC (rev 16331)
@@ -28,6 +28,8 @@
public JsonDataPathWizardPage(String pageName, String[] fileExtensionNames) {
super(pageName, fileExtensionNames);
+ this.setTitle("JSON file selection");
+ this.setDescription("Select a JSON data file");
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java 2009-07-02 06:38:51 UTC (rev 16330)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java 2009-07-02 06:40:38 UTC (rev 16331)
@@ -16,9 +16,11 @@
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -39,15 +41,19 @@
* @author Dart (dpeng(a)redhat.com)
*
*/
-public class JsonDataWizard extends Wizard implements
- IStructuredDataSelectionWizard, INewWizard {
+public class JsonDataWizard extends Wizard implements IStructuredDataSelectionWizard, INewWizard {
private JsonDataPathWizardPage pathPage = null;
private JsonDataConfiguraitonWizardPage configPage = null;
+ private SmooksResourceListType resourceList;
+
+ private EditingDomain editingDomain;
+
public JsonDataWizard() {
super();
+ this.setWindowTitle("JSON Input Data Wizard");
}
public boolean canFinish() {
@@ -67,13 +73,12 @@
public void addPages() {
super.addPages();
if (pathPage == null) {
- pathPage = new JsonDataPathWizardPage("Json Input Data Selection ",
- new String[] {});
+ pathPage = new JsonDataPathWizardPage("Json Input Data Selection ", new String[] {});
}
if (configPage == null) {
- configPage = new JsonDataConfiguraitonWizardPage(
- "Json data configuration page");
+ configPage = new JsonDataConfiguraitonWizardPage("Json data configuration page");
+ configPage.setSmooksResourceList(resourceList);
}
this.addPage(pathPage);
this.addPage(configPage);
@@ -86,7 +91,65 @@
*/
@Override
public boolean performFinish() {
- // TODO Auto-generated method stub
+ if(editingDomain == null || resourceList == null){
+ return true;
+ }
+ if (configPage != null && configPage.isCreateJsonReader()) {
+ List<KeyValueModel> keyMapList = configPage.getKeyValueList();
+
+ JsonReader reader = JsonFactory.eINSTANCE.createJsonReader();
+ if (keyMapList != null && !keyMapList.isEmpty()) {
+ KeyMap map = JsonFactory.eINSTANCE.createKeyMap();
+ for (Iterator<?> iterator = keyMapList.iterator(); iterator.hasNext();) {
+ KeyValueModel keyValueModel = (KeyValueModel) iterator.next();
+ String key = keyValueModel.getKey();
+ String value = keyValueModel.getValue();
+ Key k = JsonFactory.eINSTANCE.createKey();
+ k.setFrom(key);
+ k.setTo(value);
+ map.getKey().add(k);
+ }
+ reader.setKeyMap(map);
+ }
+
+ String aen = configPage.getArrayElementName();
+ if (aen != null && aen.length() != 0) {
+ reader.setArrayElementName(aen);
+ }
+
+ String rn = configPage.getRootName();
+ if (rn != null && rn.length() != 0) {
+ reader.setRootName(rn);
+ }
+
+ String encoding = configPage.getEncoding();
+ if (encoding != null && encoding.length() != 0) {
+ reader.setEncoding(encoding);
+ }
+
+ String sr = configPage.getKeyWhitspaceReplacement();
+ if (sr != null && sr.length() != 0) {
+ reader.setKeyWhitspaceReplacement(sr);
+ }
+
+ String pon = configPage.getKeyPrefixOnNumeric();
+ if (pon != null && pon.length() != 0) {
+ reader.setKeyPrefixOnNumeric(pon);
+ }
+
+ String nvr = configPage.getNullValueReplacement();
+ if (nvr != null && nvr.length() != 0) {
+ reader.setNullValueReplacement(nvr);
+ }
+
+ String ier = configPage.getIllegalElementNameCharReplacement();
+ if (ier != null && ier.length() != 0) {
+ reader.setIllegalElementNameCharReplacement(ier);
+ }
+ Command command = AddCommand.create(editingDomain, resourceList, SmooksPackage.eINSTANCE
+ .getSmooksResourceListType_AbstractReader(), reader);
+ editingDomain.getCommandStack().execute(command);
+ }
return true;
}
@@ -128,15 +191,14 @@
if (configPage != null) {
boolean createJsonReader = configPage.isCreateJsonReader();
-
- if (createJsonReader) {
+ boolean useJsonReader = configPage.isUseAvailabelReader();
+ if (createJsonReader || useJsonReader) {
p.setProperty(JsonInputDataParser.LINK_JSON_READER, "true");
return;
}
List<KeyValueModel> keyMapList = configPage.getKeyValueList();
- for (Iterator<?> iterator = keyMapList.iterator(); iterator
- .hasNext();) {
+ for (Iterator<?> iterator = keyMapList.iterator(); iterator.hasNext();) {
KeyValueModel keyValueModel = (KeyValueModel) iterator.next();
String key = keyValueModel.getKey();
String value = keyValueModel.getValue();
@@ -212,79 +274,21 @@
* org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput input) {
-
- }
-
- public void complate(SmooksMultiFormEditor formEditor) {
- if (configPage != null && configPage.isCreateJsonReader()) {
- List<KeyValueModel> keyMapList = configPage.getKeyValueList();
-
- JsonReader reader = JsonFactory.eINSTANCE.createJsonReader();
- if (keyMapList != null && !keyMapList.isEmpty()) {
- KeyMap map = JsonFactory.eINSTANCE.createKeyMap();
- for (Iterator<?> iterator = keyMapList.iterator(); iterator
- .hasNext();) {
- KeyValueModel keyValueModel = (KeyValueModel) iterator
- .next();
- String key = keyValueModel.getKey();
- String value = keyValueModel.getValue();
- Key k = JsonFactory.eINSTANCE.createKey();
- k.setFrom(key);
- k.setTo(value);
- map.getKey().add(k);
- }
- reader.setKeyMap(map);
- }
-
- String aen = configPage.getArrayElementName();
- if (aen != null && aen.length() != 0) {
- reader.setArrayElementName(aen);
- }
-
- String rn = configPage.getRootName();
- if (rn != null && rn.length() != 0) {
- reader.setRootName(rn);
- }
-
- String encoding = configPage.getEncoding();
- if (encoding != null && encoding.length() != 0) {
- reader.setEncoding(encoding);
- }
-
- String sr = configPage.getKeyWhitspaceReplacement();
- if (sr != null && sr.length() != 0) {
- reader.setKeyWhitspaceReplacement(sr);
- }
-
- String pon = configPage.getKeyPrefixOnNumeric();
- if (pon != null && pon.length() != 0) {
- reader.setKeyPrefixOnNumeric(pon);
- }
-
- String nvr = configPage.getNullValueReplacement();
- if (nvr != null && nvr.length() != 0) {
- reader.setNullValueReplacement(nvr);
- }
-
- String ier = configPage.getIllegalElementNameCharReplacement();
- if (ier != null && ier.length() != 0) {
- reader.setIllegalElementNameCharReplacement(ier);
- }
-
- SmooksResourceListType resourceList = null;
+ IEditorPart editorPart = site.getWorkbenchWindow().getActivePage().findEditor(input);
+ if (editorPart != null && editorPart instanceof SmooksMultiFormEditor) {
+ SmooksMultiFormEditor formEditor = (SmooksMultiFormEditor) editorPart;
Object smooksModel = formEditor.getSmooksModel();
if (smooksModel instanceof DocumentRoot) {
- resourceList = ((DocumentRoot) smooksModel)
- .getSmooksResourceList();
+ resourceList = ((DocumentRoot) smooksModel).getSmooksResourceList();
}
- Command command = AddCommand
- .create(
- formEditor.getEditingDomain(),
- resourceList,
- SmooksPackage.eINSTANCE
- .getSmooksResourceListType_AbstractReader(),
- reader);
- formEditor.getEditingDomain().getCommandStack().execute(command);
+ editingDomain = formEditor.getEditingDomain();
}
+ if(configPage != null){
+ configPage.setSmooksResourceList(resourceList);
+ }
}
+
+ public void complate(SmooksMultiFormEditor formEditor) {
+
+ }
}
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 2009-07-02 06:38:51 UTC (rev 16330)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-07-02 06:40:38 UTC (rev 16331)
@@ -123,6 +123,7 @@
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
import org.jboss.tools.smooks.model.graphics.ext.util.SmooksGraphicsExtResourceFactoryImpl;
import org.jboss.tools.smooks.model.javabean.BindingsType;
+import org.jboss.tools.smooks.model.smooks.AbstractReader;
import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
import org.jboss.tools.smooks.model.smooks.ConditionType;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
@@ -2067,4 +2068,16 @@
}
return null;
}
+
+ public static boolean hasReaderAlready(Class<?> readerClass,SmooksResourceListType resourceList){
+ if(resourceList == null || readerClass == null) return false;
+ List<AbstractReader> readerList = resourceList.getAbstractReader();
+ for (Iterator<?> iterator = readerList.iterator(); iterator.hasNext();) {
+ AbstractReader abstractReader = (AbstractReader) iterator.next();
+ if (abstractReader.getClass() == readerClass) {
+ return true;
+ }
+ }
+ return false;
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/IStructuredDataSelectionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/IStructuredDataSelectionWizard.java 2009-07-02 06:38:51 UTC (rev 16330)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/IStructuredDataSelectionWizard.java 2009-07-02 06:40:38 UTC (rev 16331)
@@ -33,6 +33,10 @@
public String getStructuredDataSourcePath();
+ /**
+ * @deprecated
+ * @param formEditor
+ */
public void complate(SmooksMultiFormEditor formEditor);
}
13 years, 8 months
JBoss Tools SVN: r16330 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: wizard and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-02 02:38:51 -0400 (Thu, 02 Jul 2009)
New Revision: 16330
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanStrucutredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/StructuredDataSelectionWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLStructuredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDStructuredDataWizard.java
Log:
JBIDE-4389
Add wizard title
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanStrucutredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanStrucutredDataWizard.java 2009-07-02 05:35:19 UTC (rev 16329)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanStrucutredDataWizard.java 2009-07-02 06:38:51 UTC (rev 16330)
@@ -40,6 +40,13 @@
IStructuredDataSelectionWizard, INewWizard {
JavaBeanConfigWizardPage page = null;
IJavaProject project = null;
+
+
+ public JavabeanStrucutredDataWizard() {
+ super();
+ this.setWindowTitle("JavaBean Model Wizard");
+ }
+
public IJavaProject getProject() {
return project;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/StructuredDataSelectionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/StructuredDataSelectionWizard.java 2009-07-02 05:35:19 UTC (rev 16329)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/StructuredDataSelectionWizard.java 2009-07-02 06:38:51 UTC (rev 16330)
@@ -27,6 +27,14 @@
IEditorSite site;
IEditorInput input;
+
+
+
+ public StructuredDataSelectionWizard() {
+ super();
+ setWindowTitle("Smooks Input Data Selection Wizard");
+ }
+
/**
* @return the site
*/
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLStructuredDataWizard.java 2009-07-02 05:35:19 UTC (rev 16329)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLStructuredDataWizard.java 2009-07-02 06:38:51 UTC (rev 16330)
@@ -26,7 +26,14 @@
String filePath = null;
public static final String XML_FILE = "xmlFile";
+
+
+ public XMLStructuredDataWizard() {
+ super();
+ setWindowTitle("XML File Input Data Wizard");
+ }
+
@Override
protected AbstractFileSelectionWizardPage createAbstractFileSelectionWizardPage() {
return new XMLStructuredDataWizardPage("XML");
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDStructuredDataWizard.java 2009-07-02 05:35:19 UTC (rev 16329)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDStructuredDataWizard.java 2009-07-02 06:38:51 UTC (rev 16330)
@@ -20,8 +20,13 @@
*
*/
public class XSDStructuredDataWizard extends AbstractStructuredDdataWizard {
+
+
+ public XSDStructuredDataWizard() {
+ super();
+ setWindowTitle("XSD/WSDL Input Data Wizard");
+ }
-
/* (non-Javadoc)
* @see org.jboss.tools.smooks.configuration.editors.xml.AbstractStructuredDdataWizard#createAbstractFileSelectionWizardPage()
*/
13 years, 8 months
JBoss Tools SVN: r16329 - in trunk: as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-07-02 01:35:19 -0400 (Thu, 02 Jul 2009)
New Revision: 16329
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
Log:
Eliminating a few of Eclipse's NLS warnings. https://jira.jboss.org/jira/browse/JBIDE-4044
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java 2009-07-01 23:10:55 UTC (rev 16328)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java 2009-07-02 05:35:19 UTC (rev 16329)
@@ -13,10 +13,7 @@
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
-
- static {
- initializeMessages("org.jboss.ide.eclipse.archives.webtools.Messages", Messages.class); //$NON-NLS-1$
- }
+ private static final String BUNDLE_NAME = "org.jboss.ide.eclipse.archives.webtools.Messages"; //$NON-NLS-1$
public static String ExceptionCannotScanDirectory;
public static String ExceptionUnexpectedException;
@@ -62,4 +59,10 @@
public static String EjbJarPreview;
public static String EjbJarDescription;
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-07-01 23:10:55 UTC (rev 16328)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-07-02 05:35:19 UTC (rev 16329)
@@ -12,7 +12,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages {
+public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.ide.eclipse.as.core.Messages"; //$NON-NLS-1$
/* Standard and re-usable */
@@ -84,4 +84,6 @@
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
+ private Messages() {
+ }
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-01 23:10:55 UTC (rev 16328)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-07-02 05:35:19 UTC (rev 16329)
@@ -14,7 +14,7 @@
public final class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.bpel.ui.messages";//$NON-NLS-1
+ private static final String BUNDLE_NAME = "org.eclipse.bpel.ui.messages"; //$NON-NLS-1$
private Messages() {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-07-01 23:10:55 UTC (rev 16328)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-07-02 05:35:19 UTC (rev 16329)
@@ -252,7 +252,7 @@
ISeamProject seamProject = (ISeamProject)context;
ISeamComponent component = seamProject.getComponent(name);
if(component != null)
- return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, SeamUIMessages.bind(SeamUIMessages.VALIDATOR_FACTORY_COMPONENT_ALREADY_EXISTS, name)));
+ return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_COMPONENT_ALREADY_EXISTS, name)));
}
String[] segs = name.split("\\.");
13 years, 8 months