JBoss Tools SVN: r14814 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-17 18:00:33 -0400 (Fri, 17 Apr 2009)
New Revision: 14814
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/events_multiple.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlanes_multiple.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timers_multiple.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
Log:
details view for process definitions
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/events_multiple.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/events_multiple.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlanes_multiple.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlanes_multiple.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timers_multiple.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timers_multiple.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2009-04-17 20:36:07 UTC (rev 14813)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -24,7 +24,7 @@
public static String ID = "org.jboss.tools.flow.jpdl4.editor";
- protected SelectionSynchronizer selectionSynchronizer;
+// protected SelectionSynchronizer selectionSynchronizer;
private DetailsPage detailsPage;
protected PaletteRoot createPalette() {
@@ -56,13 +56,13 @@
setModel(empty ? createModel() : new JpdlDeserializer().deserialize(is));
}
- public SelectionSynchronizer getSelectionSynchronizer() {
- if (selectionSynchronizer == null) {
- selectionSynchronizer = new JpdlSelectionSynchronizer();
- selectionSynchronizer.addViewer(getGraphicalViewer());
- }
- return selectionSynchronizer;
- }
+// public SelectionSynchronizer getSelectionSynchronizer() {
+// if (selectionSynchronizer == null) {
+// selectionSynchronizer = new JpdlSelectionSynchronizer();
+// selectionSynchronizer.addViewer(getGraphicalViewer());
+// }
+// return selectionSynchronizer;
+// }
public String getContributorId() {
return getSite().getId();
@@ -87,9 +87,8 @@
TreeViewer treeViewer = new TreeViewer();
treeViewer.setEditPartFactory(new JpdlTreeEditPartFactory());
getEditDomain().addViewer(treeViewer);
- getSelectionSynchronizer().addViewer(treeViewer);
+// getSelectionSynchronizer().addViewer(treeViewer);
detailsPage = new DetailsPage(treeViewer) ;
- treeViewer.setContents(((Wrapper)getModel()).getElement());
getSite().getSelectionProvider().addSelectionChangedListener(detailsPage);
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java 2009-04-17 20:36:07 UTC (rev 14813)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -5,25 +5,37 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.gef.ui.parts.SelectionSynchronizer;
+import org.eclipse.gef.ui.parts.TreeViewer;
import org.jboss.tools.flow.common.wrapper.Wrapper;
public class JpdlSelectionSynchronizer extends SelectionSynchronizer {
+ protected EditPart convert(EditPartViewer viewer, EditPart part) {
+ if (viewer instanceof GraphicalViewer) {
+ return convertToGraphicalViewerPart((GraphicalViewer)viewer, part);
+ } else if (viewer instanceof TreeViewer) {
+ return convertToTreeViewerPart((TreeViewer)viewer, part);
+ }
+ return null;
+ }
+
@SuppressWarnings("unchecked")
- protected EditPart convert(EditPartViewer viewer, EditPart part) {
- if (!(viewer instanceof GraphicalViewer)) return null;
- if (!(part instanceof AbstractTreeEditPart)) return null;
+ protected EditPart convertToGraphicalViewerPart(GraphicalViewer viewer, EditPart part) {
Iterator<EditPart> iterator = viewer.getEditPartRegistry().values().iterator();
while (iterator.hasNext()) {
EditPart editPart = iterator.next();
- Wrapper wrapper = (Wrapper)editPart.getModel();
- if (part.getModel() == wrapper.getElement()) {
- return editPart;
+ if (editPart.getModel() instanceof Wrapper) {
+ if (part.getModel() == ((Wrapper)editPart.getModel()).getElement()) {
+ return editPart;
+ }
}
}
return null;
}
+ protected EditPart convertToTreeViewerPart(TreeViewer viewer, EditPart part) {
+ return null;
+ }
+
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class EventListenerContainerListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart {
+
+ public EventListenerContainerListTreeEditPart(Process process) {
+ super(process);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/events_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Event Listeners";
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-17 20:36:07 UTC (rev 14813)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -9,6 +9,9 @@
public EditPart createEditPart(EditPart context, Object model) {
if (model instanceof Process && context == null) return new ProcessTreeRootEditPart((Process)model);
if (model instanceof ProcessNodeListTreeEditPart) return (EditPart)model;
+ if (model instanceof SwimlaneListTreeEditPart) return (EditPart)model;
+ if (model instanceof EventListenerContainerListTreeEditPart) return (EditPart)model;
+ if (model instanceof TimerListTreeEditPart) return (EditPart)model;
return null;
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+public interface ListTreeEditPart {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-17 20:36:07 UTC (rev 14813)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -7,6 +7,8 @@
public class ProcessTreeRootEditPart extends JpdlTreeEditPart {
+ List<Object> modelChildren;
+
public ProcessTreeRootEditPart(Process process) {
super(process);
}
@@ -14,10 +16,20 @@
protected void createEditPolicies() {
}
- protected List<Object> getModelChildren() {
+ private List<Object> initModelChildren() {
List<Object> result = new ArrayList<Object>();
+ result.add(new SwimlaneListTreeEditPart((Process)getModel()));
+ result.add(new EventListenerContainerListTreeEditPart((Process)getModel()));
+ result.add(new TimerListTreeEditPart((Process)getModel()));
result.add(new ProcessNodeListTreeEditPart((Process)getModel()));
return result;
}
+ protected List<Object> getModelChildren() {
+ if (modelChildren == null) {
+ modelChildren = initModelChildren();
+ }
+ return modelChildren;
+ }
+
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class SwimlaneListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart {
+
+ public SwimlaneListTreeEditPart(Process process) {
+ super(process);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/swimlanes_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Swimlanes";
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class TimerListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart {
+
+ public TimerListTreeEditPart(Process process) {
+ super(process);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/timers_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Timers";
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,27 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DefaultEventListenerContainer {
+
+ private String eventName;
+ private List<EventListener> eventListeners = new ArrayList<EventListener>();
+
+ public String getEventName() {
+ return eventName;
+ }
+
+ public void setEventName(String eventName) {
+ this.eventName = eventName;
+ }
+
+ public void addEventListener(EventListener eventListener) {
+ eventListeners.add(eventListener);
+ }
+
+ public void removeEventListener(EventListener eventListener) {
+ eventListeners.remove(eventListener);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+public class EventListener {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java 2009-04-17 22:00:33 UTC (rev 14814)
@@ -0,0 +1,7 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.jboss.tools.flow.common.model.DefaultContainer;
+
+public class Swimlane extends DefaultContainer {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 8 months
JBoss Tools SVN: r14813 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-04-17 16:36:07 -0400 (Fri, 17 Apr 2009)
New Revision: 14813
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java
Log:
JBIDE-4196 org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java depends on org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.class
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java 2009-04-17 17:58:03 UTC (rev 14812)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java 2009-04-17 20:36:07 UTC (rev 14813)
@@ -13,6 +13,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ecf.core.ContainerCreateException;
@@ -39,16 +40,16 @@
import org.eclipse.ecf.filetransfer.identity.FileIDFactory;
import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransferFactory;
import org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer;
-import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI;
import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo;
-import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository;
import org.eclipse.equinox.security.storage.ISecurePreferences;
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -65,6 +66,25 @@
private static final ProtocolException ERROR_401 = new ProtocolException();
private static final String SERVER_REDIRECT = Messages.ECFExamplesTransport_Server_redirected_too_many_times;
+ /**
+ * The node identifier for repository secure preference store.
+ */
+ public static final String PREFERENCE_NODE = "org.jboss.tools.project.examples"; //$NON-NLS-1$
+
+ /**
+ * The key for a string property providing the user name to an authenticated
+ * URL. This key is used in the secure preference store for repository data.
+ * @see #PREFERENCE_NODE
+ */
+ public static final String PROP_USERNAME = "username"; //$NON-NLS-1$
+
+ /**
+ * The key for a string property providing the password to an authenticated
+ * URL. This key is used in the secure preference store for repository data.
+ * @see #PREFERENCE_NODE
+ */
+ public static final String PROP_PASSWORD = "password"; //$NON-NLS-1$
+
private static ECFExamplesTransport INSTANCE;
private ServiceTracker retrievalFactoryTracker;
@@ -179,7 +199,18 @@
IConnectContext context = getConnectionContext(url, false);
for (int i = 0; i < LOGIN_RETRIES; i++) {
try {
- return performDownload(name,url, destination, context, monitor);
+ IStatus status = performDownload(name,url, destination, context, monitor);
+ if (status.isOK()) {
+ return status;
+ } else {
+ Throwable exception = status.getException();
+ if (exception instanceof IncomingFileTransferException) {
+ int code = ((IncomingFileTransferException)exception).getErrorCode();
+ if (code == 401) {
+ context = getConnectionContext(url, true);
+ }
+ }
+ }
} catch (ProtocolException e) {
if (e == ERROR_401)
context = getConnectionContext(url, true);
@@ -363,7 +394,7 @@
//fall back to default platform encoding
nodeKey = URLEncoder.encode(hostLocation.toString());
}
- String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
+ String nodeName = PREFERENCE_NODE + '/' + nodeKey;
ISecurePreferences prefNode = null;
if (securePreferences.nodeExists(nodeName))
prefNode = securePreferences.node(nodeName);
@@ -371,8 +402,8 @@
if (prefNode == null)
return null;
try {
- String username = prefNode.get(IRepository.PROP_USERNAME, null);
- String password = prefNode.get(IRepository.PROP_PASSWORD, null);
+ String username = prefNode.get(PROP_USERNAME, null);
+ String password = prefNode.get(PROP_PASSWORD, null);
//if we don't have stored connection data just return a null connection context
if (username == null || password == null)
return null;
@@ -383,6 +414,15 @@
}
}
//need to prompt user for user name and password
+ // check if adminUIService has been started
+ Bundle bundle = Platform.getBundle("org.eclipse.equinox.p2.ui.sdk");
+ if (bundle != null && bundle.getState() != Bundle.ACTIVE) {
+ try {
+ bundle.start();
+ } catch (BundleException e) {
+ // ignore
+ }
+ }
ServiceTracker adminUITracker = new ServiceTracker(ProjectExamplesActivator.getBundleContext(), IServiceUI.class.getName(), null);
adminUITracker.open();
IServiceUI adminUIService = (IServiceUI) adminUITracker.getService();
@@ -397,8 +437,8 @@
if (prefNode == null)
prefNode = securePreferences.node(nodeName);
try {
- prefNode.put(IRepository.PROP_USERNAME, loginDetails.getUserName(), true);
- prefNode.put(IRepository.PROP_PASSWORD, loginDetails.getPassword(), true);
+ prefNode.put(PROP_USERNAME, loginDetails.getUserName(), true);
+ prefNode.put(PROP_PASSWORD, loginDetails.getPassword(), true);
prefNode.flush();
} catch (StorageException e1) {
String msg = Messages.ECFExamplesTransport_Internal_Error;
@@ -431,7 +471,7 @@
wait.join();
} catch (InterruptedException e) {
if (!logged)
- LogHelper.log(new Status(IStatus.WARNING, ProjectExamplesActivator.PLUGIN_ID, Messages.ECFExamplesTransport_Unexpected_interrupt_while_waiting_on_ECF_transfer, e));
+ ProjectExamplesActivator.log(e);
}
}
}
15 years, 8 months
JBoss Tools SVN: r14812 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/JBIDE/3416.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-04-17 13:58:03 -0400 (Fri, 17 Apr 2009)
New Revision: 14812
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/JBIDE/3416/jbide3416.xhtml.xml
Log:
RESOLVED - issue JBIDE-3690: Incorrect styleClass is applying for the tags, which use <span> wrapping
https://jira.jboss.org/jira/browse/JBIDE-3690
- The test for the issue JBIDE-3416 has been updated.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/JBIDE/3416/jbide3416.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/JBIDE/3416/jbide3416.xhtml.xml 2009-04-17 17:54:50 UTC (rev 14811)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/JBIDE/3416/jbide3416.xhtml.xml 2009-04-17 17:58:03 UTC (rev 14812)
@@ -25,9 +25,11 @@
</TR>
</THEAD>
</TABLE>
- <SPAN STYLE="color: red; font-weight: bold; -moz-user-modify: read-only;">
- Error Messages
- </SPAN>
+ <UL STYLE="color: red; font-weight: bold; -moz-user-modify: read-only;">
+ <LI>
+ Error Messages
+ </LI>
+ </UL>
</DIV>
</DIV>
</DIV>
15 years, 8 months
JBoss Tools SVN: r14811 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-17 13:54:50 -0400 (Fri, 17 Apr 2009)
New Revision: 14811
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
Log:
JBIDE-3842 - @Column.length - setup non default string length functionality - update for getters
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-04-17 17:51:37 UTC (rev 14810)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-04-17 17:54:50 UTC (rev 14811)
@@ -422,12 +422,12 @@
if ("java.lang.String".equals(typeName) || "String".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
String fieldId = returnIdentifier;
RefColumnInfo rci = entityInfo.getRefColumnInfo(fieldId);
- if (rci == null) {
+ if (rci == null || !rci.isExist()) {
// if there is no @Column annotation - create new @Column annotation
// with user defined default value length
NormalAnnotation natd = rewriter.getAST().newNormalAnnotation();
natd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_COLUMN));
- ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ ListRewrite lrw = rewriter.getListRewrite(node, MethodDeclaration.MODIFIERS2_PROPERTY);
lrw.insertFirst(natd, null);
MemberValuePair mvp = rewriter.getAST().newMemberValuePair();
mvp.setName(rewriter.getAST().newSimpleName("length")); //$NON-NLS-1$
15 years, 8 months
JBoss Tools SVN: r14810 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-04-17 13:51:37 -0400 (Fri, 17 Apr 2009)
New Revision: 14810
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFStatusTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractTreeTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandLink.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/htmlCommandLink.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/portlet.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/status.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeVisualLinkCreator.java
Log:
RESOLVED - issue JBIDE-3690: Incorrect styleClass is applying for the tags, which use <span> wrapping
https://jira.jboss.org/jira/browse/JBIDE-3690
- style class "vpe-text" has been added to the tags with the incorrect behavior.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFStatusTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFStatusTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFStatusTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -17,6 +17,7 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -146,7 +147,7 @@
Attr stopTextAttribute = sourceElement.getAttributeNode(ATTR_STOP_TEXT);
if (stopTextAttribute != null) {
- visualElement = visualDocument.createElement(HTML.TAG_SPAN);
+ visualElement = VisualDomUtil.createBorderlessContainer(visualDocument);
nsIDOMText textNode = visualDocument.createTextNode(
stopTextAttribute.getNodeValue());
visualElement.appendChild(textNode);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -271,7 +271,7 @@
<vpe:tag name="a4j:portlet" case-sensitive="yes">
<vpe:template children="yes" modify="no">
- <span>
+ <span class="vpe-text">
</span>
</vpe:template>
</vpe:tag>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -14,6 +14,7 @@
import java.util.Map;
import java.util.Set;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMElement;
@@ -25,7 +26,7 @@
*
* @author Sergey Dzmitrovich
*/
-public abstract class AbstractEditableJsfTemplate extends VpeAbstractTemplate {
+public abstract class AbstractEditableJsfTemplate extends VpeAbstractTemplate {
/**
* Gets the output attribute node.
@@ -43,11 +44,11 @@
* Contains JSF attributes and appropriate HTML attributes
* content of that does not have to be modified in templates.
*/
- static final private Map<String, String> attributes = new HashMap<String, String>();
-
+ static final private Map<String, String> attributes
+ = new HashMap<String, String>();
static {
- attributes.put("style", HTML.ATTR_STYLE); //$NON-NLS-1$
- attributes.put("styleClass", HTML.ATTR_CLASS); //$NON-NLS-1$
+ attributes.put(JSF.ATTR_STYLE, HTML.ATTR_STYLE);
+ attributes.put(JSF.ATTR_STYLE_CLASS, HTML.ATTR_CLASS);
}
/**
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -10,13 +10,13 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -27,6 +27,16 @@
*
*/
public class JsfOutputTextTemplate extends AbstractOutputJsfTemplate {
+ /**
+ * If at least one of these attributes is present,
+ * {@code sourceNode} should be rendered in {@code SPAN}
+ * visual node.
+ *
+ * @see #isSpanNeeding(Element)
+ */
+ private static final String[] spanMarkers = {
+ JSF.ATTR_STYLE, JSF.ATTR_STYLE_CLASS, JSF.ATTR_ID,
+ JSF.ATTR_DIR, JSF.ATTR_TITLE, JSF.ATTR_LANG};
/*
* (non-Javadoc)
@@ -39,28 +49,46 @@
Element element = (Element) sourceNode;
- // create span element
- nsIDOMElement span = VisualDomUtil.createBorderlessContainer(visualDocument);
+ // create container
+ final nsIDOMElement container;
+ if (isSpanNeeding(element)) {
+ container = visualDocument.createElement(HTML.TAG_SPAN);
+ } else {
+ container = VisualDomUtil.createBorderlessContainer(visualDocument);
+ }
// creation data
- VpeCreationData creationData = new VpeCreationData(span);
+ VpeCreationData creationData = new VpeCreationData(container);
// copy attributes
- copyOutputJsfAttributes(span, element);
+ copyOutputJsfAttributes(container, element);
- processOutputAttribute(pageContext, visualDocument, element, span,
+ processOutputAttribute(pageContext, visualDocument, element, container,
creationData);
return creationData;
}
+ /**
+ * Returns {@code true} if given {@code element} should be
+ * rendered in {@code SPAN} tag, otherwise returns {@code false}.
+ *
+ * @see #spanMarkers
+ */
+ private boolean isSpanNeeding(Element element) {
+ for (String spanMarker : spanMarkers) {
+ if (element.hasAttribute(spanMarker)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
public boolean recreateAtAttrChange(VpePageContext pageContext,
Element sourceElement, nsIDOMDocument visualDocument,
nsIDOMElement visualNode, Object data, String name, String value) {
-
return true;
}
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -19,6 +19,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -34,10 +35,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
- * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
- * org.mozilla.interfaces.nsIDOMDocument)
+ * @see org.jboss.tools.vpe.editor.template.VpeTemplate
+ * #create(VpePageContext, Node, nsIDOMDocument)
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
@@ -45,13 +44,14 @@
Element element = (Element) sourceNode;
// create span
- nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ nsIDOMElement mainContainer = VisualDomUtil
+ .createBorderlessContainer(visualDocument);
// get children
NodeList list = element.getChildNodes();
// creation data
- VpeCreationData creationData = new VpeCreationData(span);
+ VpeCreationData creationData = new VpeCreationData(mainContainer);
// for each child
for (int i = 0; i < list.getLength(); i++) {
@@ -59,25 +59,25 @@
Node child = list.item(i);
// create span for child
- nsIDOMElement childSpan = visualDocument
- .createElement(HTML.TAG_SPAN);
- span.appendChild(childSpan);
+ nsIDOMElement childContainer = VisualDomUtil
+ .createBorderlessContainer(visualDocument);
+ mainContainer.appendChild(childContainer);
// if child is text or not html tag
- if ((child.getNodeType() == Node.ELEMENT_NODE && child.getPrefix() != null)
- || (child.getNodeType() == Node.TEXT_NODE)) {
+ if ((child.getNodeType() == Node.ELEMENT_NODE
+ && child.getPrefix() != null)
+ || child.getNodeType() == Node.TEXT_NODE) {
// create children info and add to creationData
- VpeChildrenInfo childSpanInfo = new VpeChildrenInfo(childSpan);
+ VpeChildrenInfo childSpanInfo = new VpeChildrenInfo(childContainer);
childSpanInfo.addSourceChild(child);
creationData.addChildrenInfo(childSpanInfo);
-
} else {
// get text by positions and add to span
String text = NodesManagingUtil.getSourceText(pageContext,
((IDOMNode) child).getStartOffset(), ((IDOMNode) child)
.getEndOffset() - 1);
- span.appendChild(visualDocument.createTextNode(text));
+ mainContainer.appendChild(visualDocument.createTextNode(text));
}
}
@@ -97,16 +97,13 @@
/*
* (non-Javadoc)
*
- * @seeorg.jboss.tools.vpe.editor.template.VpeAbstractTemplate#
- * isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument,
- * org.mozilla.interfaces.nsIDOMElement, java.lang.Object, java.lang.String,
- * java.lang.String)
+ * @see VpeAbstractTemplate#isRecreateAtAttrChange(
+ * VpePageContext, Element, nsIDOMDocument,
+ * nsIDOMElement, Object, String, String)
*/
public boolean recreateAtAttrChange(VpePageContext pageContext,
Element sourceElement, nsIDOMDocument visualDocument,
nsIDOMElement visualNode, Object data, String name, String value) {
return true;
}
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -57,6 +57,10 @@
public static final String ATTR_ITEM_DISABLED = "itemDisabled"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT = "layout";//$NON-NLS-1$
+ public static final String ATTR_LAYOUT = "layout"; //$NON-NLS-1$
+ public static final String ATTR_TITLE = "title"; //$NON-NLS-1$
+
+ public static final String ATTR_LANG = "lang"; //$NON-NLS-1$
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -22,7 +22,7 @@
</vpe:template>
</vpe:if>
<vpe:template children="yes" modify="yes">
- <span title="{tagstring()}" />
+ <span title="{tagstring()}" class="vpe-text"/>
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes" />
@@ -609,10 +609,17 @@
<vpe:breaker type="ignore" />
</vpe:template>
</vpe:if>
+ <vpe:if test="attrpresent('style')|attrpresent('styleClass')|attrpresent('id')">
+ <vpe:template children="yes" modify="yes">
+ <span style="{@style}" class="{@styleClass}"
+ title="{tagstring()}" />
+ <vpe:breaker type="ignore" />
+ </vpe:template>
+ </vpe:if>
<vpe:template children="yes" modify="yes">
- <span style="{@style}" class="{@styleClass}"
- title="{tagstring()}" />
- <vpe:breaker type="ignore" />
+ <span class="vpe-text"
+ title="{tagstring()}" />
+ <vpe:breaker type="ignore" />
</vpe:template>
</vpe:tag>
@@ -819,9 +826,9 @@
<vpe:tag name="h:message">
<vpe:template children="no" modify="no">
- <span class="{@styleClass}" style="{@style}">
- Error Message
- </span>
+ <ul class="{@styleClass}" style="{@style}">
+ <li>Error Message</li>
+ </ul>
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
@@ -833,9 +840,9 @@
<vpe:tag name="h:messages">
<vpe:template children="no" modify="no">
- <span class="{@styleClass}" style="{@style}">
- Error Messages
- </span>
+ <ul class="{@styleClass}" style="{@style}">
+ <li>Error Messages</li>
+ </ul>
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractTreeTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractTreeTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractTreeTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -20,6 +20,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -406,11 +407,12 @@
Element sourceElement = (Element) sourceNode;
String nodes = sourceElement
.getAttribute(RichFacesRecursiveTreeNodesAdaptorTemplate.NODES_NAME);
- nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ nsIDOMElement textContainer = VisualDomUtil
+ .createBorderlessContainer(visualDocument);
nsIDOMText text = visualDocument
.createTextNode((nodes == null) ? Constants.EMPTY : nodes);
- span.appendChild(text);
- nodeTitle.appendChild(span);
+ textContainer.appendChild(text);
+ nodeTitle.appendChild(textContainer);
} else {
VpeChildrenInfo tdInfo = new VpeChildrenInfo(nodeTitle);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -47,7 +47,7 @@
ArrayList<Element> columns = getColumns(sourceElement);
int columnsLength = getColumnsCount(sourceElement, columns);
nsIDOMElement colgroup = visualDocument.createElement(HTML.TAG_COLGROUP);
- colgroup.setAttribute(HTML.TAG_SPAN, String.valueOf(columnsLength));
+ colgroup.setAttribute(HTML.ATTR_SPAN, String.valueOf(columnsLength));
table.appendChild(colgroup);
String columnsWidth = sourceElement.getAttribute(RichFaces.ATTR_COLUMNS_WIDTH);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -26,183 +26,200 @@
public class RichFacesMessagesTemplate extends RichFacesMessageTemplate {
- private static final String LAYOUT = "layout"; //$NON-NLS-1$
- private static final String LIST = "list"; //$NON-NLS-1$
- private static final String TABLE = "table"; //$NON-NLS-1$
- private static final String ITERATOR = "iterator"; //$NON-NLS-1$
-
- private static final String CSS_RICH_MESSAGES = "rich-messages"; //$NON-NLS-1$
- private static final String CSS_RICH_MESSAGES_MARKER = "rich-messages-marker"; //$NON-NLS-1$
- private static final String CSS_RICH_MESSAGES_LABEL = "rich-messages-label"; //$NON-NLS-1$
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ private static final String LAYOUT = "layout"; //$NON-NLS-1$
+ private static final String TABLE = "table"; //$NON-NLS-1$
+ private static final String CSS_RICH_MESSAGES
+ = "rich-messages"; //$NON-NLS-1$
+ private static final String CSS_RICH_MESSAGES_MARKER
+ = "rich-messages-marker"; //$NON-NLS-1$
+ private static final String CSS_RICH_MESSAGES_LABEL
+ = "rich-messages-label"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- VpeCreationData creationData = null;
- Element sourceElement = (Element) sourceNode;
- final Attributes attrs = new Attributes(sourceElement);
- String styleClass = CSS_RICH_MESSAGES;
- String layout = ((Element) sourceNode).getAttribute(LAYOUT);
- nsIDOMElement container = null;
- if (TABLE.equalsIgnoreCase(layout)) {
- container = visualDocument.createElement(HTML.TAG_TABLE);
- container.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
- container.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
- } else {
- /*
- * If layout is either list or iterator or not specified
- * use list layout by default.
- */
- container = visualDocument.createElement(HTML.TAG_DL);
- }
+ VpeCreationData creationData = null;
+ final Element sourceElement = (Element) sourceNode;
+ final Attributes attrs = new Attributes(sourceElement);
+ String styleClass = CSS_RICH_MESSAGES;
+ final String layout = ((Element) sourceNode).getAttribute(LAYOUT);
- if (ComponentUtil.isNotBlank(attrs.getStyleValue())) {
- container.setAttribute(HTML.ATTR_STYLE, attrs.getStyleValue());
- }
- if (ComponentUtil.isNotBlank(attrs.getStyleClassValue())) {
- styleClass += Constants.WHITE_SPACE + attrs.getStyleClassValue();
- }
- container.setAttribute(HTML.ATTR_CLASS, styleClass);
+ final nsIDOMElement container;
+ if (TABLE.equalsIgnoreCase(layout)) {
+ container = visualDocument.createElement(HTML.TAG_TABLE);
+ container.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ container.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ } else {
+ /*
+ * If layout is either list or iterator or not specified
+ * use list layout by default.
+ */
+ container = visualDocument.createElement(HTML.TAG_DL);
+ }
- creationData = new VpeCreationData(container);
-
- HashMap<String, Node> facets = getFacelets((Element) sourceNode);
-
- for (int i = 0; i < markers.length; i++) {
- if (facets.containsKey(markers[i])) {
- container.appendChild(createVisualMessage(creationData,
- visualDocument, layout, i, (Element) facets.get(markers[i]), attrs));
- } else {
- container.appendChild(createVisualMessage(creationData,
- visualDocument, layout, i, null, attrs));
- }
- }
- return creationData;
+ if (ComponentUtil.isNotBlank(attrs.getStyleValue())) {
+ container.setAttribute(HTML.ATTR_STYLE, attrs.getStyleValue());
+ }
+ if (ComponentUtil.isNotBlank(attrs.getStyleClassValue())) {
+ styleClass += Constants.WHITE_SPACE + attrs.getStyleClassValue();
+ }
+ container.setAttribute(HTML.ATTR_CLASS, styleClass);
+
+ creationData = new VpeCreationData(container);
+
+ final HashMap<String, Node> facets = getFacelets((Element) sourceNode);
+
+ for (int i = 0; i < markers.length; i++) {
+ if (facets.containsKey(markers[i])) {
+ container.appendChild(createVisualMessage(creationData,
+ visualDocument, layout, i,
+ (Element) facets.get(markers[i]), attrs));
+ } else {
+ container.appendChild(createVisualMessage(creationData,
+ visualDocument, layout, i, null, attrs));
+ }
+ }
+ return creationData;
}
/**
* Method for creating rich:message template if rich:message has facets
- *
+ *
* @param visualDocument
* @param sourceElement
* @param facets
* @return
*/
private nsIDOMElement createVisualMessage(VpeCreationData creationData,
- nsIDOMDocument visualDocument, String layout, int markerNum,
- Element facet, Attributes attrs) {
+ nsIDOMDocument visualDocument, String layout, int markerNum,
+ Element facet, Attributes attrs) {
- String containerClass = Constants.EMPTY;
- String markerClass = CSS_RICH_MESSAGES_MARKER;
- String labelClass = CSS_RICH_MESSAGES_LABEL;
+ String containerClass = Constants.EMPTY;
+ String markerClass = CSS_RICH_MESSAGES_MARKER;
+ String labelClass = CSS_RICH_MESSAGES_LABEL;
- String labelMessage = Constants.EMPTY;
- nsIDOMElement topContainer = null;
- nsIDOMElement container = null;
- nsIDOMElement marker = null;
- nsIDOMElement label = null;
-
- if (TABLE.equalsIgnoreCase(layout)) {
- nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
- container = visualDocument.createElement(HTML.TAG_TD);
- marker = visualDocument.createElement(HTML.TAG_SPAN);
- label = visualDocument.createElement(HTML.TAG_SPAN);
- tr.appendChild(container);
- container.appendChild(marker);
- container.appendChild(label);
- topContainer = tr;
- } else {
- /*
- * If layout is either list or iterator or not specified use list
- * layout by default.
- */
- container = visualDocument.createElement(HTML.TAG_DT);
- marker = visualDocument.createElement(HTML.TAG_SPAN);
- label = visualDocument.createElement(HTML.TAG_SPAN);
- container.appendChild(marker);
- container.appendChild(label);
- topContainer = container;
- }
-
- if (facet != null) {
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(marker);
- creationData.addChildrenInfo(childrenInfo);
- childrenInfo.addSourceChild(facet);
- }
- /*
- * apply styles and classes
- */
- switch (markerNum) {
- case 0: // passed
- labelMessage = (attrs.getPassedLabelValue()== null) ? Constants.EMPTY : attrs.getPassedLabelValue();
- if (ComponentUtil.isNotBlank(attrs.getMarkerClassValue())) {
- markerClass += Constants.WHITE_SPACE + attrs.getMarkerClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getLabelClassValue())) {
- labelClass += Constants.WHITE_SPACE + attrs.getLabelClassValue();
- }
- break;
- case 1: // error
- labelMessage = ERROR_MESSAGE;
- if (ComponentUtil.isNotBlank(attrs.getErrorClassValue())) {
- containerClass += Constants.WHITE_SPACE + attrs.getErrorClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getErrorMarkerClassValue())) {
- markerClass += Constants.WHITE_SPACE + attrs.getErrorMarkerClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getErrorLabelClassValue())) {
- labelClass += Constants.WHITE_SPACE + attrs.getErrorLabelClassValue();
- }
- break;
- case 2: // fatal
- labelMessage = FATAL_MESSAGE;
- if (ComponentUtil.isNotBlank(attrs.getFatalClassValue())) {
- containerClass += Constants.WHITE_SPACE + attrs.getFatalClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getFatalMarkerClassValue())) {
- markerClass += Constants.WHITE_SPACE + attrs.getFatalMarkerClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getFatalLabelClassValue())) {
- labelClass += Constants.WHITE_SPACE + attrs.getFatalLabelClassValue();
- }
- break;
- case 3: // info
- labelMessage = INFO_MESSAGE;
- if (ComponentUtil.isNotBlank(attrs.getInfoClassValue())) {
- containerClass += Constants.WHITE_SPACE + attrs.getInfoClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getInfoMarkerClassValue())) {
- markerClass += Constants.WHITE_SPACE + attrs.getInfoMarkerClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getInfoLabelClassValue())) {
- labelClass += Constants.WHITE_SPACE + attrs.getInfoLabelClassValue();
- }
- break;
- case 4: // warn
- labelMessage = WARNING_MESSAGE;
- if (ComponentUtil.isNotBlank(attrs.getWarnClassValue())) {
- containerClass += Constants.WHITE_SPACE + attrs.getWarnClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getWarnMarkerClassValue())) {
- markerClass += Constants.WHITE_SPACE + attrs.getWarnMarkerClassValue();
- }
- if (ComponentUtil.isNotBlank(attrs.getWarnLabelClassValue())) {
- labelClass += Constants.WHITE_SPACE + attrs.getWarnLabelClassValue();
- }
- break;
- default:
- break;
- }
-
- if (ComponentUtil.isNotBlank(containerClass)) {
- container.setAttribute(HTML.ATTR_CLASS, containerClass);
- }
- marker.setAttribute(HTML.ATTR_CLASS, markerClass);
- label.setAttribute(HTML.ATTR_CLASS, labelClass);
-
- nsIDOMText text = visualDocument.createTextNode(labelMessage);
- label.appendChild(text);
- return topContainer;
+ final String labelMessage;
+ final nsIDOMElement topContainer;
+ final nsIDOMElement container;
+ final nsIDOMElement marker = visualDocument
+ .createElement(HTML.TAG_SPAN);
+ final nsIDOMElement label = visualDocument
+ .createElement(HTML.TAG_SPAN);
+
+ if (TABLE.equalsIgnoreCase(layout)) {
+ final nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ container = visualDocument.createElement(HTML.TAG_TD);
+ tr.appendChild(container);
+ container.appendChild(marker);
+ container.appendChild(label);
+ topContainer = tr;
+ } else {
+ /*
+ * If layout is either list or iterator or not specified use list
+ * layout by default.
+ */
+ container = visualDocument.createElement(HTML.TAG_DT);
+ container.appendChild(marker);
+ container.appendChild(label);
+ topContainer = container;
+ }
+
+ if (facet != null) {
+ final VpeChildrenInfo childrenInfo = new VpeChildrenInfo(marker);
+ creationData.addChildrenInfo(childrenInfo);
+ childrenInfo.addSourceChild(facet);
+ }
+ /*
+ * apply styles and classes
+ */
+ switch (markerNum) {
+ case 0: // passed
+ labelMessage = (attrs.getPassedLabelValue() == null)
+ ? Constants.EMPTY
+ : attrs.getPassedLabelValue();
+ if (ComponentUtil.isNotBlank(attrs.getMarkerClassValue())) {
+ markerClass += Constants.WHITE_SPACE
+ + attrs.getMarkerClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getLabelClassValue())) {
+ labelClass += Constants.WHITE_SPACE
+ + attrs.getLabelClassValue();
+ }
+ break;
+ case 1: // error
+ labelMessage = ERROR_MESSAGE;
+ if (ComponentUtil.isNotBlank(attrs.getErrorClassValue())) {
+ containerClass += Constants.WHITE_SPACE
+ + attrs.getErrorClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getErrorMarkerClassValue())) {
+ markerClass += Constants.WHITE_SPACE
+ + attrs.getErrorMarkerClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getErrorLabelClassValue())) {
+ labelClass += Constants.WHITE_SPACE
+ + attrs.getErrorLabelClassValue();
+ }
+ break;
+ case 2: // fatal
+ labelMessage = FATAL_MESSAGE;
+ if (ComponentUtil.isNotBlank(attrs.getFatalClassValue())) {
+ containerClass += Constants.WHITE_SPACE
+ + attrs.getFatalClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getFatalMarkerClassValue())) {
+ markerClass += Constants.WHITE_SPACE
+ + attrs.getFatalMarkerClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getFatalLabelClassValue())) {
+ labelClass += Constants.WHITE_SPACE
+ + attrs.getFatalLabelClassValue();
+ }
+ break;
+ case 3: // info
+ labelMessage = INFO_MESSAGE;
+ if (ComponentUtil.isNotBlank(attrs.getInfoClassValue())) {
+ containerClass += Constants.WHITE_SPACE
+ + attrs.getInfoClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getInfoMarkerClassValue())) {
+ markerClass += Constants.WHITE_SPACE
+ + attrs.getInfoMarkerClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getInfoLabelClassValue())) {
+ labelClass += Constants.WHITE_SPACE
+ + attrs.getInfoLabelClassValue();
+ }
+ break;
+ case 4: // warn
+ labelMessage = WARNING_MESSAGE;
+ if (ComponentUtil.isNotBlank(attrs.getWarnClassValue())) {
+ containerClass += Constants.WHITE_SPACE
+ + attrs.getWarnClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getWarnMarkerClassValue())) {
+ markerClass += Constants.WHITE_SPACE
+ + attrs.getWarnMarkerClassValue();
+ }
+ if (ComponentUtil.isNotBlank(attrs.getWarnLabelClassValue())) {
+ labelClass += Constants.WHITE_SPACE
+ + attrs.getWarnLabelClassValue();
+ }
+ break;
+ default:
+ labelMessage = Constants.EMPTY;
+ break;
+ }
+
+ if (ComponentUtil.isNotBlank(containerClass)) {
+ container.setAttribute(HTML.ATTR_CLASS, containerClass);
+ }
+ marker.setAttribute(HTML.ATTR_CLASS, markerClass);
+ label.setAttribute(HTML.ATTR_CLASS, labelClass);
+
+ final nsIDOMText text = visualDocument.createTextNode(labelMessage);
+ label.appendChild(text);
+ return topContainer;
}
-
-}
\ No newline at end of file
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -126,8 +126,8 @@
int columnsLength = getColumnsCount(sourceElement, columns);
nsIDOMElement colgroup = visualDocument
.createElement(HTML.TAG_COLGROUP);
- colgroup.setAttribute(HTML.TAG_SPAN, String
- .valueOf(columnsLength));
+ colgroup.setAttribute(HTML.ATTR_SPAN,
+ String.valueOf(columnsLength));
mainTable.appendChild(colgroup);
// Encode Caption
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandLink.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandLink.xhtml.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandLink.xhtml.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,12 +1,8 @@
<tests>
<test id="commandLink1">
- <A DIR="" STYLE="-moz-user-modify: read-write;">
- <SPAN>Say Hello</SPAN>
- </A>
+ <A><SPAN CLASS="vpe-text">Say Hello</SPAN></A>
</test>
<test id="commandLink2">
- <A DIR="" STYLE="-moz-user-modify: read-write;">
- <SPAN>Link</SPAN>
- </A>
+ <A><SPAN CLASS="vpe-text">Link</SPAN></A>
</test>
-</tests>
\ No newline at end of file
+</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/htmlCommandLink.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/htmlCommandLink.xhtml.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/htmlCommandLink.xhtml.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,7 +1,5 @@
<tests>
<test id="htmlCommandLink">
- <A DIR="" STYLE="-moz-user-modify: read-write;">
- <SPAN>value</SPAN>
- </A>
+ <A><SPAN CLASS="vpe-text">value</SPAN></A>
</test>
-</tests>
\ No newline at end of file
+</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/portlet.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/portlet.xhtml.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/portlet.xhtml.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,7 +1,7 @@
<tests>
<test id="portlet">
- <SPAN STYLE="-moz-user-modify: read-only;">
- <SPAN> ....</SPAN>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text"> ....</SPAN>
</SPAN>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/status.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/status.xhtml.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/status.xhtml.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,14 +1,14 @@
<tests>
<test id="status1">
- <SPAN CLASS="" STYLE="">
- <SPAN>
+ <SPAN>
+ <SPAN CLASS="vpe-text">
Complete
</SPAN>
</SPAN>
</test>
<test id="status2">
<SPAN CLASS="StyleClass StopStyleClass" STYLE="border: 3px solid red;">
- <SPAN>
+ <SPAN CLASS="vpe-text">
FACET STOP OUTPUT TEXT
</SPAN>
</SPAN>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,29 +1,30 @@
<tests>
<test id="test_el">
-<FORM
- STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
- <SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
- Error Messages
-</SPAN>
- <DIV CLASS="dr-pnl rich-panel" STYLE="">
- <DIV CLASS="dr-pnl-b rich-panel-body">
- <SPAN>
- 123456789 Test El expression Test El expression Test El expression
-</SPAN>
- <DIV
- STYLE="width: 109px; height: 106px; background-color: green; -moz-user-modify: read-write;">
- <BR VPE:PSEUDO-ELEMENT="yes"
- STYLE="font-style: italic; color: green; -moz-user-modify: read-only;">
- </BR>
+ <FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+ <UL CLASS="message" STYLE="-moz-user-modify: read-only;">
+ <LI>
+ Error Messages
+ </LI>
+ </UL>
+ <DIV CLASS="dr-pnl rich-panel" STYLE="">
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <SPAN CLASS="vpe-text">
+ 123456789 Test El expression Test El expression Test El expression
+ </SPAN>
+ <DIV
+ STYLE="width: 109px; height: 106px; background-color: green; -moz-user-modify: read-write;">
+ <BR VPE:PSEUDO-ELEMENT="yes"
+ STYLE="font-style: italic; color: green; -moz-user-modify: read-only;" />
+
+ </DIV>
+ <SPAN CLASS="vpe-text">
+ Hello
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ Name: Test El expression
+ </SPAN>
+ </DIV>
</DIV>
- <SPAN>
- Hello
-</SPAN>
- <SPAN>
- Name: Test El expression
-</SPAN>
- </DIV>
- </DIV>
-</FORM>
-</test>
+ </FORM>
+ </test>
</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,16 +1,16 @@
<tests>
<test id="commandLink1">
- <span>commandLink1</span>
+ <span CLASS="vpe-text">commandLink1</span>
</test>
<test id="commandLink2">
<a>commandLink2</a>
</test>
<test id="commandLink3">
- <SPAN >
- <SPAN>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
commandLink3
</SPAN>
- <SPAN>
+ <SPAN CLASS="vpe-text">
: This link is disabled as it is not nested within a JSF form.
</SPAN>
</SPAN>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,5 +1,9 @@
<tests>
<test id="message">
- <span> Error Message</span>
+ <UL>
+ <LI>
+ Error Message
+ </LI>
+ </UL>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,5 +1,9 @@
<tests>
<test id="messages">
- <span> Error Messages </span>
+ <UL>
+ <LI>
+ Error Messages
+ </LI>
+ </UL>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp 2009-04-17 17:51:37 UTC (rev 14810)
@@ -3,16 +3,30 @@
<html>
<head>
+<style type="text/css">
+ span {
+ color: yellow;
+ background-color: green;
+ }
+</style>
</head>
<body>
<f:view>
- <h1><h:outputText value="outputText" /></h1>
-
+ <div id="outputText0">
+ <h:outputText value="outputText0"/>
+ </div>
<h:outputText value="outputText1" id="outputText1" />
<h:outputText value="outputText2" id="outputText2" escape="true" />
<h:outputText value="outputText3" id="outputText3" escape="false" />
-
+ <div id="outputTextGroup">
+ <h:outputText value="outputText4 " id="outputText"/>
+ <h:outputText value="outputText5 " dir="LTR"/>
+ <h:outputText value="outputText6 " lang="java"/>
+ <h:outputText value="outputText7 " style="style"/>
+ <h:outputText value="outputText8 " styleClass="styleClass"/>
+ <h:outputText value="outputText9 " title="title"/>
+ </div>
</f:view>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,13 +1,48 @@
<tests>
+ <test id="outputText0">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ outputText0
+ </SPAN>
+ </DIV>
+ </test>
<test id="outputText1">
- <SPAN> outputText1</SPAN>
+ <SPAN>
+ outputText1
+ </SPAN>
</test>
<test id="outputText2">
- <SPAN> outputText2</SPAN>
+ <SPAN>
+ outputText2
+ </SPAN>
</test>
<test id="outputText3">
<SPAN>
- <SPAN> outputText3</SPAN>
+ <SPAN CLASS="vpe-text">
+ outputText3
+ </SPAN>
</SPAN>
</test>
-</tests>
\ No newline at end of file
+ <test id="outputTextGroup">
+ <DIV>
+ <SPAN>
+ outputText4
+ </SPAN>
+ <SPAN>
+ outputText5
+ </SPAN>
+ <SPAN>
+ outputText6
+ </SPAN>
+ <SPAN STYLE="">
+ outputText7
+ </SPAN>
+ <SPAN CLASS="styleClass">
+ outputText8
+ </SPAN>
+ <SPAN>
+ outputText9
+ </SPAN>
+ </DIV>
+ </test>
+</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp 2009-04-17 17:51:37 UTC (rev 14810)
@@ -3,6 +3,12 @@
<html>
<head>
+<style type="text/css">
+ span {
+ color: yellow;
+ background-color: green;
+ }
+</style>
</head>
<body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,14 +1,22 @@
<tests>
<test id="panelGroup1">
<SPAN>
- <SPAN> 1</SPAN>
- <SPAN> 2</SPAN>
+ <SPAN CLASS="vpe-text">
+ 1
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ 2
+ </SPAN>
</SPAN>
</test>
<test id="panelGroup2">
<DIV>
- <SPAN> 3</SPAN>
- <SPAN> 4</SPAN>
+ <SPAN CLASS="vpe-text">
+ 3
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ 4
+ </SPAN>
</DIV>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -1,18 +1,25 @@
<tests>
<test id="verbatim1">
- <SPAN>
- <INPUT TYPE="button" VALUE="button" />
+ <SPAN CLASS="vpe-text">
+ <INPUT TYPE="button" VALUE="button"/>
</SPAN>
</test>
<test id="verbatim2">
- <SPAN>
- <SPAN></SPAN>
- <SPAN></SPAN>
- <input type="button" value="button" />
- <SPAN></SPAN>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <input type="button" value="button" />
+ <SPAN CLASS="vpe-text">
+ </SPAN>
</SPAN>
</test>
<test id="verbatim3">
- <SPAN><SPAN></SPAN><input type="button" value="button" /></SPAN>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <input type="button" value="button" />
+ </SPAN>
</test>
</tests>
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeVisualLinkCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeVisualLinkCreator.java 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeVisualLinkCreator.java 2009-04-17 17:51:37 UTC (rev 14810)
@@ -20,6 +20,7 @@
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionInfo;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -138,10 +139,11 @@
if (valueExpr != null) {
String value = valueExpr.exec(pageContext, sourceNode).stringValue();
if (value != null && value.length() > 0) {
- nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
- a.appendChild(span);
+ nsIDOMElement textContainer = VisualDomUtil
+ .createBorderlessContainer(visualDocument);
+ a.appendChild(textContainer);
nsIDOMText text = visualDocument.createTextNode(value);
- span.appendChild(text);
+ textContainer.appendChild(text);
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml 2009-04-17 17:43:55 UTC (rev 14809)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml 2009-04-17 17:51:37 UTC (rev 14810)
@@ -141,7 +141,7 @@
<vpe:tag name="jsp:text" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <span/>
+ <span class="vpe-text"/>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="no"/>
15 years, 8 months
JBoss Tools SVN: r14809 - trunk/ws/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-04-17 13:43:55 -0400 (Fri, 17 Apr 2009)
New Revision: 14809
Modified:
trunk/ws/docs/reference/en/modules/client.xml
trunk/ws/docs/reference/en/modules/preference.xml
trunk/ws/docs/reference/en/modules/topdown.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-398 - the whole document is verified on misprints; answer to user from JBoss forum is reflected in the guide.
Modified: trunk/ws/docs/reference/en/modules/client.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/client.xml 2009-04-17 17:01:20 UTC (rev 14808)
+++ trunk/ws/docs/reference/en/modules/client.xml 2009-04-17 17:43:55 UTC (rev 14809)
@@ -11,7 +11,7 @@
<para>Switch to the Java EE perspective <emphasis><property>Window > Open Perspective > Java EE</property></emphasis>.</para>
</listitem>
<listitem>
- <para>Click <emphasis><property>File > New > Other</property></emphasis>.Select Web Services in order to display the various Web service wizards. Select the Web Service Client wizard. Click <property>Next</property> button.</para>
+ <para>Click <emphasis><property>File > New > Other</property></emphasis>. Select Web Services in order to display the various Web service wizards. Select the Web Service Client wizard. Click on the <property>Next</property> button.</para>
<figure>
<title>New Web Service Client</title>
<mediaobject>
@@ -22,7 +22,7 @@
</figure>
</listitem>
<listitem>
- <para>The first and second Web Service Client wizard page are same to <link linkend="topdownwebservice">Web Service from a WSDL document</link>.</para>
+ <para>The first and the second Web Service Client wizard pages are the same as for <link linkend="topdownwebservice">Web Service from a WSDL document</link>.</para>
<figure>
<title>Set Web Service Common values</title>
<mediaobject>
@@ -32,20 +32,20 @@
</mediaobject>
</figure>
<figure>
- <title>Set Web Service values about WSDL file</title>
+ <title>Set Web Service values related to WSDL file</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/client/jbossws_client_2.png"></imagedata>
</imageobject>
</mediaobject>
</figure>
- <para>The differences are:</para>
+ <para>The only difference is:</para>
<itemizedlist>
<listitem>
- <para><property>Client Type:</property> Now only support Java Proxy.</para>
+ <para><property>Client Type:</property> Support of Java Proxy only.</para>
</listitem>
</itemizedlist>
- <para>Click <property>Finish</property> button.</para>
+ <para>Click on the <property>Finish</property> button.</para>
</listitem>
</itemizedlist>
<para>After the Web Service Client has been created, the following may occur depending on the options you selected:</para>
Modified: trunk/ws/docs/reference/en/modules/preference.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/preference.xml 2009-04-17 17:01:20 UTC (rev 14808)
+++ trunk/ws/docs/reference/en/modules/preference.xml 2009-04-17 17:43:55 UTC (rev 14809)
@@ -81,8 +81,7 @@
<section id="serverruntime">
<title>Default Server and Runtime</title>
<para>Open <emphasis>
- <property>Window > Preferences > Web Services > Server and Runtime</property>
- </emphasis>. On this page, you can specify a default server and runtime.</para>
+ <property>Window > Preferences > Web Services > Server and Runtime</property></emphasis>. On this page, you can specify a default server and runtime.</para>
<para>For ease of use, the better way is to set runtime to JBoss WS.</para>
<para>After server and runtime are specified, click on the <property>Apply</property> button
to save the values.</para>
Modified: trunk/ws/docs/reference/en/modules/topdown.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/topdown.xml 2009-04-17 17:01:20 UTC (rev 14808)
+++ trunk/ws/docs/reference/en/modules/topdown.xml 2009-04-17 17:43:55 UTC (rev 14809)
@@ -26,8 +26,7 @@
</mediaobject>
</figure>
<para>Create a Web project by selecting <emphasis>
- <property>New > Project... > Dynamic Web project</property>
- </emphasis>. Enter the following information: </para>
+ <property>New > Project... > Dynamic Web project</property></emphasis>. Enter the following information: </para>
<itemizedlist>
<listitem>
<para>Project Name: enter a project name</para>
@@ -37,8 +36,7 @@
click New and browse to the location where it is installed to. You may set <emphasis>
<property>Target Runtime</property>
</emphasis> to <emphasis>
- <property>None</property>
- </emphasis>, in this case, you should add <link linkend="addfacet">JBoss Web Service
+ <property>None</property></emphasis>, in this case, you should add <link linkend="addfacet">JBoss Web Service
facet to the project</link>.</para>
<figure>
<title>Dynamic Web Project Wizard</title>
@@ -67,7 +65,7 @@
<section id="addfacet">
<title>Configure JBoss Web Service facet settings</title>
<para>If you have already created a new Dynamic Web project, the next step is to add JBoss Web
- Service facet to the project:</para>
+ Service facet to the project. Right-click on the project, select its <emphasis><property>Properties</property></emphasis> and then find <emphasis>Project Facets</emphasis> in the tree-view on the left-side of the project properties dialog. Tick on the check box for JBossWS facet and open additional configuration for it:</para>
<figure id="figure_addfacet">
<title>Configure JBoss Web Service Facet</title>
<mediaobject>
@@ -208,8 +206,7 @@
<itemizedlist>
<listitem>
<para>Switch to the Java EE perspective <emphasis>
- <property>Window > Open Perspective > Java EE</property>
- </emphasis>.</para>
+ <property>Window > Open Perspective > Java EE</property></emphasis>.</para>
</listitem>
<listitem>
<para>In the Project Explorer view, select the bean that you created or imported into
@@ -225,8 +222,7 @@
</listitem>
<listitem>
<para>Click <emphasis>
- <property>File > New > Other</property>
- </emphasis>. Select Web Services in order to display various Web service wizards.
+ <property>File > New > Other</property></emphasis>. Select Web Services in order to display various Web service wizards.
Select the Web Service wizard. Click on the <property>Next</property> button.</para>
<figure>
<title>New Web Service</title>
15 years, 8 months
JBoss Tools SVN: r14808 - in trunk/hibernatetools: plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-17 13:01:20 -0400 (Fri, 17 Apr 2009)
New Revision: 14808
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefColumnInfo.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/IHibernateJPAWizardParams.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/DocumentBase.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapMockTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
Log:
JBIDE-3842 - @Column.length - setup non default string length functionality
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -7,6 +7,8 @@
public static String AllEntitiesProcessor_header;
public static String AllEntitiesProcessor_message;
public static String AllEntitiesProcessor_setup_annotation_generation_preference;
+ public static String AllEntitiesProcessor_enable_optimistic_locking;
+ public static String AllEntitiesProcessor_default_string_length;
public static String AllEntitiesProcessor_annotate_fields;
public static String AllEntitiesProcessor_annotate_getters;
public static String AllEntitiesProcessor_auto_select_from_class_preference;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2009-04-17 17:01:20 UTC (rev 14808)
@@ -11,6 +11,8 @@
AllEntitiesProcessor_header=Hibernate: add JPA annotations
AllEntitiesProcessor_message=Add JPA annotations to the related set of entities. The following classes will be changed:
AllEntitiesProcessor_setup_annotation_generation_preference=Setup annotation generation preference:
+AllEntitiesProcessor_enable_optimistic_locking=Enable optimistic locking:
+AllEntitiesProcessor_default_string_length=Default string length (255 by default):
AllEntitiesProcessor_annotate_fields=Annotate fields
AllEntitiesProcessor_annotate_getters=Annotate getters
AllEntitiesProcessor_auto_select_from_class_preference=Auto select from class preference
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -90,11 +90,11 @@
protected AllEntitiesProcessor processor = new AllEntitiesProcessor();
protected JPAMapToolActor() {
- initAnnotationStylePreference();
+ initPreferences();
}
- public void initAnnotationStylePreference() {
- processor.initAnnotationStylePreference();
+ public void initPreferences() {
+ processor.initPreferences();
}
public static JPAMapToolActor getInstance() {
@@ -183,7 +183,7 @@
JdtUiMessages.JPAMapToolActor_message);
}
}
- processor.saveAnnotationStylePreference();
+ processor.savePreferences();
}
private IWorkbenchWindow getActiveWorkbenchWindow() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -187,9 +187,46 @@
entityInfo.setAddVersionFlag(false);
}
}
+ else if (JPAConst.isAnnotationColumn(fullyQualifiedName) && node instanceof NormalAnnotation) {
+ updateAnnotationColumn((NormalAnnotation)node, mappedBy, fullyQualifiedName);
+ }
return true;
}
+ public void updateAnnotationColumn(NormalAnnotation node, String mappedBy, String fullyQualifiedName) {
+ ITypeBinding tb = node.resolveTypeBinding();
+ CompilationUnit cu = null;
+ ASTNode astNode = node.getParent();
+ if (astNode instanceof FieldDeclaration) {
+ FieldDeclaration fd = (FieldDeclaration)astNode;
+ Iterator itVarNames = fd.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.updateAnnotationColumn(name, node, true);
+ }
+ cu = getCUFromTypeDeclaration(node);
+ }
+ else if (astNode instanceof MethodDeclaration) {
+ MethodDeclaration md = (MethodDeclaration)astNode;
+ if (md.getName().getIdentifier().startsWith("get")) { //$NON-NLS-1$
+ // the getter - process it
+ String name = getReturnIdentifier(md);
+ // process it like FieldDeclaration
+ entityInfo.updateAnnotationColumn(name, node, true);
+ cu = getCUFromFieldMethod(node);
+ }
+ else {
+ // ignore others
+ }
+ }
+ if (cu != null) {
+ if (tb == null) {
+ entityInfo.addRequiredImport(JPAConst.IMPORT_COLUMN);
+ }
+ }
+ }
+
public void updateAnnotationRelInfo(Annotation node, String mappedBy, String fullyQualifiedName,
RefType type, String annNameShort, String annNameFull) {
ITypeBinding tb = node.resolveTypeBinding();
@@ -445,6 +482,13 @@
}
}
}
+ if ("java.lang.String".equals(tb.getBinaryName())) { //$NON-NLS-1$
+ Iterator itVarNames = list.iterator();
+ while (itVarNames.hasNext()) {
+ String name = (String)itVarNames.next();
+ entityInfo.updateAnnotationColumn(name, null, false);
+ }
+ }
}
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -10,14 +10,16 @@
******************************************************************************/
package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.MemberValuePair;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+
/**
* Service place to collect information about entity class.
* Then this info has been transformed according annotations
@@ -102,6 +104,11 @@
*/
protected Map<String, RefEntityInfo> references = new TreeMap<String, RefEntityInfo>();
/*
+ * store declared column information for particular field
+ * field id -> RefColumnInfo
+ */
+ protected Map<String, RefColumnInfo> columns = new TreeMap<String, RefColumnInfo>();
+ /*
* fully qualified entity name -> Set<RefFieldInfo>
* this is generated from references map for easy information get
*/
@@ -211,6 +218,7 @@
else {
removeRequiredImport(JPAConst.IMPORT_VERSION);
}
+ updateColumnAnnotationImport(false);
Iterator<Map.Entry<String, RefEntityInfo>> referencesIt =
getReferences().entrySet().iterator();
while (referencesIt.hasNext()) {
@@ -254,6 +262,15 @@
primaryIdName = ""; //$NON-NLS-1$
}
}
+
+ public void updateColumnAnnotationImport(boolean nonDefault) {
+ if (isNonColumnAnnotatedStringField() && nonDefault) {
+ addRequiredImport(JPAConst.IMPORT_COLUMN);
+ }
+ else {
+ removeRequiredImport(JPAConst.IMPORT_COLUMN);
+ }
+ }
public String getName() {
String[] arr = fullyQualifiedName.split("\\."); //$NON-NLS-1$
@@ -404,6 +421,52 @@
}
}
+ public void updateAnnotationColumn(String fieldId, NormalAnnotation node, boolean exist) {
+ if (columns == null || fieldId == null) {
+ return;
+ }
+ RefColumnInfo rci = columns.get(fieldId);
+ if (rci == null) {
+ rci = new RefColumnInfo(fieldId);
+ }
+ if (!rci.isExist()) {
+ rci.setExist(exist);
+ }
+ if (node != null) {
+ Map<String, Expression> rciValues = rci.getValues();
+ Iterator it = node.values().iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof MemberValuePair) {
+ MemberValuePair mvp = (MemberValuePair)obj;
+ rciValues.put(mvp.getName().getIdentifier(), mvp.getValue());
+ }
+ }
+ }
+ columns.put(fieldId, rci);
+ }
+
+ public RefColumnInfo getRefColumnInfo(String fieldId) {
+ return columns.get(fieldId);
+ }
+
+ /**
+ * returns true in case of there is String field which is not
+ * annotated with @Column
+ */
+ public boolean isNonColumnAnnotatedStringField() {
+ boolean res = false;
+ Iterator<Map.Entry<String, RefColumnInfo>> it = columns.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, RefColumnInfo> entry = it.next();
+ if (!entry.getValue().isExist()) {
+ res = true;
+ break;
+ }
+ }
+ return res;
+ }
+
public Set<RefFieldInfo> getRefFieldInfoSet(String fullyQualifiedName) {
if (mapRefFieldInfo == null) {
return null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -21,6 +21,7 @@
public static final String IMPORT_MANY2MANY = "javax.persistence.ManyToMany"; //$NON-NLS-1$
public static final String IMPORT_MAPPEDSUPERCLASS = "javax.persistence.MappedSuperclass"; //$NON-NLS-1$
public static final String IMPORT_VERSION = "javax.persistence.Version"; //$NON-NLS-1$
+ public static final String IMPORT_COLUMN = "javax.persistence.Column"; //$NON-NLS-1$
public static final String ANNOTATION_SERIALIZABLE = "Serializable"; //$NON-NLS-1$
public static final String ANNOTATION_ENTITY = "Entity"; //$NON-NLS-1$
@@ -33,6 +34,7 @@
public static final String ANNOTATION_MANY2MANY = "ManyToMany"; //$NON-NLS-1$
public static final String ANNOTATION_MAPPEDSUPERCLASS = "MappedSuperclass"; //$NON-NLS-1$
public static final String ANNOTATION_VERSION = "Version"; //$NON-NLS-1$
+ public static final String ANNOTATION_COLUMN = "Column"; //$NON-NLS-1$
public static final Vector<String> ALL_IMPORTS = new Vector<String>();
@@ -48,6 +50,7 @@
ALL_IMPORTS.add(IMPORT_MANY2MANY);
ALL_IMPORTS.add(IMPORT_MAPPEDSUPERCLASS);
ALL_IMPORTS.add(IMPORT_VERSION);
+ ALL_IMPORTS.add(IMPORT_COLUMN);
}
static public String getRefType(RefType refType) {
@@ -137,4 +140,12 @@
}
return false;
}
+
+ static public boolean isAnnotationColumn(String fullyQualifiedName) {
+ if (ANNOTATION_COLUMN.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_COLUMN.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefColumnInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefColumnInfo.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefColumnInfo.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jdt.core.dom.Expression;
+
+/**
+ * Information about @Column annotation for particular field
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class RefColumnInfo implements Comparable<RefFieldInfo> {
+ /*
+ * field id
+ */
+ protected String fieldId;
+ /*
+ * is column annotation exist for the field
+ */
+ protected boolean exist = false;
+ /*
+ * column attributes
+ */
+ protected Map<String, Expression> values = new HashMap<String, Expression>();
+ //
+ public RefColumnInfo(String fieldId) {
+ this.fieldId = fieldId;
+ }
+
+ public int compareTo(RefFieldInfo rfi) {
+ return fieldId.compareTo(rfi.fieldId);
+ }
+
+ public boolean equals(Object obj) {
+ if (super.equals(obj)) {
+ return true;
+ }
+ if (obj == null || !(obj instanceof RefFieldInfo)) {
+ return false;
+ }
+ RefFieldInfo rfi = (RefFieldInfo)obj;
+ return fieldId.equals(rfi.fieldId);
+ }
+
+ public int hashCode() {
+ return fieldId.hashCode();
+ }
+
+ public String getFieldId() {
+ return fieldId;
+ }
+
+ public void setFieldId(String fieldId) {
+ this.fieldId = fieldId;
+ }
+
+ public Map<String, Expression> getValues() {
+ return values;
+ }
+
+ public void setValues(Map<String, Expression> values) {
+ this.values = values;
+ }
+
+ public boolean isExist() {
+ return exist;
+ }
+
+ public void setExist(boolean exist) {
+ this.exist = exist;
+ }
+}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -59,10 +59,32 @@
*/
protected AnnotStyle annotationStylePreference = AnnotStyle.FIELDS;
/**
- * annotation style preference of majority
+ * annotation style preference store name
*/
public final static String storePropertyName =
"hibernate.jpa.generation.AnnotationStyle.preference"; //$NON-NLS-1$
+ /**
+ * @Column length - default value
+ */
+ public final static int columnLength = 255;
+ /**
+ * default length for column which corresponds to String field
+ */
+ protected int defaultStrLength = columnLength;
+ /**
+ * default length for column preference store name
+ */
+ public final static String storeDefaultStrLength =
+ "hibernate.jpa.generation.DefaultStrLength.preference"; //$NON-NLS-1$
+ /**
+ * flag to enable optimistic locking
+ */
+ protected boolean enableOptLock = false;
+ /**
+ * flag to enable optimistic locking preference store name
+ */
+ public final static String storeEnableOptLock =
+ "hibernate.jpa.generation.EnableOptLock.preference"; //$NON-NLS-1$
/**
* change info storage
@@ -83,16 +105,25 @@
this.preferenceStore = preferenceStore;
}
- public void initAnnotationStylePreference() {
+ public void initPreferences() {
IPreferenceStore preferenceStore = getPreferenceStore();
+ //
int value = preferenceStore.getInt(storePropertyName);
if (value >= AnnotStyle.values().length) {
value = 0;
}
annotationStyle = AnnotStyle.values()[value];
+ //
+ value = preferenceStore.getInt(storeDefaultStrLength);
+ if (value <= 0) {
+ value = columnLength;
+ }
+ defaultStrLength = value;
+ //
+ enableOptLock = preferenceStore.getBoolean(storeEnableOptLock);
}
- public void saveAnnotationStylePreference() {
+ public void savePreferences() {
IPreferenceStore preferenceStore = getPreferenceStore();
int value = 0;
while (value < AnnotStyle.values().length) {
@@ -105,6 +136,10 @@
value = 0;
}
preferenceStore.setValue(storePropertyName, value);
+ //
+ preferenceStore.setValue(storeDefaultStrLength, defaultStrLength);
+ //
+ preferenceStore.setValue(storeEnableOptLock, enableOptLock);
}
/**
@@ -244,6 +279,9 @@
public void collectModification(ITextFileBufferManager bufferManager, String fullyQualifiedName,
EntityInfo entityInfo, Map<String, EntityInfo> entities) throws CoreException {
+ //
+ entityInfo.updateColumnAnnotationImport(defaultStrLength != columnLength);
+ //
ChangeStructure cs = new ChangeStructure();
cs.fullyQualifiedName = fullyQualifiedName;
ICompilationUnit icu = Utils.findCompilationUnit(javaProject, fullyQualifiedName);
@@ -259,6 +297,8 @@
// ... rewrite
ProcessEntityInfo processor = new ProcessEntityInfo();
processor.setAnnotationStyle(annotationStyle);
+ processor.setDefaultStrLength(defaultStrLength);
+ processor.setEnableOptLock(enableOptLock);
processor.setEntityInfo(entityInfo);
processor.setEntities(entities);
processor.setASTRewrite(rewriter);
@@ -315,4 +355,20 @@
public void setAnnotationStylePreference(AnnotStyle annotationStylePreference) {
this.annotationStylePreference = annotationStylePreference;
}
+
+ public int getDefaultStrLength() {
+ return defaultStrLength;
+ }
+
+ public void setDefaultStrLength(int defaultStrLength) {
+ this.defaultStrLength = defaultStrLength;
+ }
+
+ public boolean getEnableOptLock() {
+ return enableOptLock;
+ }
+
+ public void setEnableOptLock(boolean enableOptLock) {
+ this.enableOptLock = enableOptLock;
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -28,6 +28,7 @@
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.NumberLiteral;
import org.eclipse.jdt.core.dom.QualifiedName;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.SimpleType;
@@ -41,6 +42,7 @@
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.JPAConst;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.OwnerType;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefColumnInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefEntityInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefFieldInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefType;
@@ -69,6 +71,14 @@
* annotation style
*/
protected AnnotStyle annotationStyle = AnnotStyle.FIELDS;
+ /**
+ * default length for column which corresponds to String field
+ */
+ protected int defaultStrLength = AllEntitiesProcessor.columnLength;
+ /**
+ * flag to enable optimistic locking
+ */
+ protected boolean enableOptLock = false;
public void setEntityInfo(EntityInfo entityInfo) {
this.entityInfo = entityInfo;
@@ -263,6 +273,35 @@
}
}
}
+ if (type.isSimpleType() && (AllEntitiesProcessor.columnLength != defaultStrLength)) {
+ SimpleType simpleType = (SimpleType)type;
+ String typeName = simpleType.getName().getFullyQualifiedName();
+ if ("java.lang.String".equals(typeName) || "String".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
+ String fieldId = null;
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ fieldId = var.getName().getIdentifier();
+ if (fieldId != null) {
+ break;
+ }
+ }
+ RefColumnInfo rci = entityInfo.getRefColumnInfo(fieldId);
+ if (rci == null || !rci.isExist()) {
+ // if there is no @Column annotation - create new @Column annotation
+ // with user defined default value length
+ NormalAnnotation natd = rewriter.getAST().newNormalAnnotation();
+ natd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_COLUMN));
+ ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(natd, null);
+ MemberValuePair mvp = rewriter.getAST().newMemberValuePair();
+ mvp.setName(rewriter.getAST().newSimpleName("length")); //$NON-NLS-1$
+ NumberLiteral nl = rewriter.getAST().newNumberLiteral(String.valueOf(defaultStrLength));
+ mvp.setValue(nl);
+ natd.values().add(mvp);
+ }
+ }
+ }
if (type.isSimpleType() || type.isParameterizedType() || type.isArrayType()) {
Iterator itVarNames = node.fragments().iterator();
String fieldId = ""; //$NON-NLS-1$
@@ -377,6 +416,27 @@
}
}
}
+ if (type.isSimpleType() && (AllEntitiesProcessor.columnLength != defaultStrLength)) {
+ SimpleType simpleType = (SimpleType)type;
+ String typeName = simpleType.getName().getFullyQualifiedName();
+ if ("java.lang.String".equals(typeName) || "String".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
+ String fieldId = returnIdentifier;
+ RefColumnInfo rci = entityInfo.getRefColumnInfo(fieldId);
+ if (rci == null) {
+ // if there is no @Column annotation - create new @Column annotation
+ // with user defined default value length
+ NormalAnnotation natd = rewriter.getAST().newNormalAnnotation();
+ natd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_COLUMN));
+ ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(natd, null);
+ MemberValuePair mvp = rewriter.getAST().newMemberValuePair();
+ mvp.setName(rewriter.getAST().newSimpleName("length")); //$NON-NLS-1$
+ NumberLiteral nl = rewriter.getAST().newNumberLiteral(String.valueOf(defaultStrLength));
+ mvp.setValue(nl);
+ natd.values().add(mvp);
+ }
+ }
+ }
if (type.isSimpleType() || type.isParameterizedType() || type.isArrayType()) {
String fieldId = ""; //$NON-NLS-1$
RefType refType = RefType.UNDEF;
@@ -521,4 +581,20 @@
public void setAnnotationStyle(AnnotStyle annotationStyle) {
this.annotationStyle = annotationStyle;
}
+
+ public int getDefaultStrLength() {
+ return defaultStrLength;
+ }
+
+ public void setDefaultStrLength(int defaultStrLength) {
+ this.defaultStrLength = defaultStrLength;
+ }
+
+ public boolean getEnableOptLock() {
+ return enableOptLock;
+ }
+
+ public void setEnableOptLock(boolean enableOptLock) {
+ this.enableOptLock = enableOptLock;
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/EntitiesList.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -24,10 +24,14 @@
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.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.process.AnnotStyle;
@@ -135,7 +139,7 @@
idx = 2;
}
generateChoice.select(idx);
- final ModifyListener ml = new ModifyListener() {
+ final ModifyListener mlGenerateChoice = new ModifyListener() {
public void modifyText(ModifyEvent e) {
int idx = ((Combo)e.getSource()).getSelectionIndex();
@@ -155,7 +159,55 @@
}
};
- generateChoice.addModifyListener(ml);
+ generateChoice.addModifyListener(mlGenerateChoice);
+
+ /** /
+ // TODO: implement enable optimistic locking functionality
+ Label labelOptLock = new Label(combolabel, SWT.NULL);
+ labelOptLock.setText(JdtUiMessages.AllEntitiesProcessor_enable_optimistic_locking);
+ Button checkboxOptLock = new Button(combolabel, SWT.CHECK);
+ checkboxOptLock.setSelection(params.getEnableOptLock());
+ final Listener mlOptLock = new Listener() {
+
+ public void handleEvent(Event e) {
+ params.setEnableOptLock(((Button)e.widget).getSelection());
+ params.reCollectModification(data.getBufferManager(), data.getEntities());
+ }
+
+ };
+ checkboxOptLock.addListener(SWT.Selection, mlOptLock);
+ /**/
+
+ Label labelDefaultStrLength = new Label(combolabel, SWT.NULL);
+ labelDefaultStrLength.setText(JdtUiMessages.AllEntitiesProcessor_default_string_length);
+ Text textDefaultStrLength = new Text(combolabel, SWT.SINGLE | SWT.BORDER | SWT.TRAIL);
+ textDefaultStrLength.setText(String.valueOf(params.getDefaultStrLength()));
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
+ .grab(true, true).applyTo(textDefaultStrLength);
+ textDefaultStrLength.addListener(SWT.Verify, new Listener() {
+ public void handleEvent(Event e) {
+ for (int i = 0; i < e.text.length(); i++) {
+ char val = e.text.charAt(i);
+ if (!('0' <= val && val <= '9')) {
+ e.doit = false;
+ return;
+ }
+ }
+ }
+ });
+ final ModifyListener mlDefaultStrLength = new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ if (e == null || !(e.getSource() instanceof Text)) {
+ return;
+ }
+ params.setDefaultStrLength(Integer.valueOf(((Text)e.getSource()).getText()));
+ params.reCollectModification(data.getBufferManager(), data.getEntities());
+ }
+
+ };
+ textDefaultStrLength.addModifyListener(mlDefaultStrLength);
+
setControl(container);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/IHibernateJPAWizardParams.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/IHibernateJPAWizardParams.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/IHibernateJPAWizardParams.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -27,6 +27,14 @@
public void setAnnotationStyle(AnnotStyle annotationStyle);
+ public boolean getEnableOptLock();
+
+ public void setEnableOptLock(boolean enableOptLock);
+
+ public int getDefaultStrLength();
+
+ public void setDefaultStrLength(int defaultStrLength);
+
public AnnotStyle getAnnotationStylePreference();
public void reCollectModification(ITextFileBufferManager bufferManager,
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -10,12 +10,14 @@
******************************************************************************/
package test.annotated.fields;
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
@Entity
public class Country {
+ @Column(length=200)
private String name;
@ManyToOne
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/DocumentBase.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/DocumentBase.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/DocumentBase.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -10,12 +10,14 @@
******************************************************************************/
package test.annotated.fields;
+import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
@MappedSuperclass
public abstract class DocumentBase {
+ @Column(length=200)
protected String globalDocumentIdentificator;
@Version
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapMockTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapMockTests.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapMockTests.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -51,15 +51,19 @@
context.checking(new Expectations() {{
oneOf(preferenceStore).setValue(AllEntitiesProcessor.storePropertyName, 2);
+ oneOf(preferenceStore).setValue(AllEntitiesProcessor.storeDefaultStrLength, 255);
+ oneOf(preferenceStore).setValue(AllEntitiesProcessor.storeEnableOptLock, false);
}});
- allEntitiesProcessor.saveAnnotationStylePreference();
+ allEntitiesProcessor.savePreferences();
context.assertIsSatisfied();
allEntitiesProcessor.setAnnotationStyle(null);
context.checking(new Expectations() {{
oneOf(preferenceStore).setValue(AllEntitiesProcessor.storePropertyName, 0);
+ oneOf(preferenceStore).setValue(AllEntitiesProcessor.storeDefaultStrLength, 255);
+ oneOf(preferenceStore).setValue(AllEntitiesProcessor.storeEnableOptLock, false);
}});
- allEntitiesProcessor.saveAnnotationStylePreference();
+ allEntitiesProcessor.savePreferences();
context.assertIsSatisfied();
}
@@ -125,7 +129,7 @@
allowing(allEntitiesProcessor).modify(javaProject, null, true);
inSequence(sequence);
- allowing(allEntitiesProcessor).saveAnnotationStylePreference();
+ allowing(allEntitiesProcessor).savePreferences();
inSequence(sequence);
}});
jpaMapToolActor.updateSelected();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2009-04-17 16:31:01 UTC (rev 14807)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2009-04-17 17:01:20 UTC (rev 14808)
@@ -79,6 +79,7 @@
public void testTransformerFields() {
testSelection = TEST_FIELDS;
+ processor.setDefaultStrLength(200);
processor.setAnnotationStyle(AnnotStyle.FIELDS);
startTestTransformer();
}
15 years, 8 months
JBoss Tools SVN: r14807 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-17 12:31:01 -0400 (Fri, 17 Apr 2009)
New Revision: 14807
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
GPD-310: remove empty transition names
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-04-17 15:28:10 UTC (rev 14806)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-04-17 16:31:01 UTC (rev 14807)
@@ -205,7 +205,7 @@
protected void appendName(StringBuffer buffer, SequenceFlow sequenceFlow) {
if (sequenceFlow.getName() == null) return;
String value = sequenceFlow.getName();
- if (value == null || "".equals(sequenceFlow)) return;
+ if (value == null || "".equals(sequenceFlow.getName())) return;
buffer.append(" name=\"" + value + "\"");
}
protected void appendTo(StringBuffer buffer, SequenceFlow sequenceFlow) {
15 years, 8 months
JBoss Tools SVN: r14806 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-04-17 11:28:10 -0400 (Fri, 17 Apr 2009)
New Revision: 14806
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-04-17 15:15:45 UTC (rev 14805)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-04-17 15:28:10 UTC (rev 14806)
@@ -12,6 +12,7 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
@@ -23,12 +24,17 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IAnnotatable;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IParent;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.text.BadLocationException;
@@ -77,19 +83,22 @@
*/
public class RenameComponentProcessor extends RenameProcessor {
private static final String ANNOTATION_NAME = "org.jboss.seam.annotations.Name";
+ private static final String ANNOTATION_IN = "org.jboss.seam.annotations.In";
+ private static final String ANNOTATION_FACTORY = "org.jboss.seam.annotations.Factory";
+
private static final String JAVA_EXT = "java";
private static final String XML_EXT = "xml";
private static final String XHTML_EXT = "xhtml";
private static final String JSP_EXT = "jsp";
private static final String PROPERTIES_EXT = "properties";
+
private static final String COMPONENTS_FILE = "components.xml";
private static final String COMPONENT_NODE = "component";
private static final String FACTORY_NODE = "factory";
private static final String NAME_ATTRIBUTE = "name";
- private IFile file;
+ private IFile file=null;
private ISeamComponent component;
- private IAnnotation annotation;
private String newName;
/**
@@ -118,14 +127,10 @@
}
public void setNewComponentName(String componentName){
- if(file == null) return;
-
this.newName = componentName;
-
- annotation = getAnnotation(file);
}
- private IAnnotation getAnnotation(IFile file){
+ private IAnnotation getNameAnnotation(IFile file){
try{
ICompilationUnit unit = getCompilationUnit(file);
for(IType type : unit.getAllTypes()){
@@ -140,6 +145,57 @@
return null;
}
+ private List<IAnnotation> getAnnotations(IFile file, String annotationName){
+ ArrayList<IAnnotation> annotations = new ArrayList<IAnnotation>();
+ try{
+ ICompilationUnit unit = getCompilationUnit(file);
+ for(IType type : unit.getAllTypes()){
+ for(IAnnotation annotation : type.getAnnotations()){
+ if(EclipseJavaUtil.resolveType(type, annotation.getElementName()).equals(ANNOTATION_NAME))
+ annotations.add(annotation);
+ }
+ }
+ for(IJavaElement element : unit.getChildren()){
+ List<IAnnotation> list = getAnnotations(element, annotationName);
+ annotations.addAll(list);
+
+ }
+ }catch(CoreException ex){
+ SeamCorePlugin.getDefault().logError(ex);
+ }
+ return annotations;
+ }
+
+ private List<IAnnotation> getAnnotations(IJavaElement element, String annotationName){
+ IType type = (IType)element.getAncestor(IJavaElement.TYPE);
+ ArrayList<IAnnotation> annotations = new ArrayList<IAnnotation>();
+ if(element instanceof IAnnotatable){
+ try{
+ for(IAnnotation annotation : ((IAnnotatable)element).getAnnotations()){
+ if(EclipseJavaUtil.resolveType(type, annotation.getElementName()).equals(annotationName)){
+ annotations.add(annotation);
+ }
+ }
+ }catch(JavaModelException ex){
+ SeamCorePlugin.getDefault().logError(ex);
+ }
+ }
+ if(element instanceof IParent){
+ try{
+ for(IJavaElement child : ((IParent)element).getChildren()){
+ List<IAnnotation> list = getAnnotations(child, annotationName);
+ annotations.addAll(list);
+
+ }
+ }catch(JavaModelException ex){
+ SeamCorePlugin.getDefault().logError(ex);
+ }
+ }
+
+ return annotations;
+ }
+
+
private ICompilationUnit getCompilationUnit(IFile file) throws CoreException {
IProject project = file.getProject();
IJavaProject javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
@@ -200,15 +256,81 @@
SeamCorePlugin.getPluginLog().logError(e);
return;
}
- if(ext.equalsIgnoreCase(JAVA_EXT))
+ if(ext.equalsIgnoreCase(JAVA_EXT)){
scanJava(file, content);
- else if(ext.equalsIgnoreCase(XML_EXT) || ext.equalsIgnoreCase(XHTML_EXT) || ext.equalsIgnoreCase(JSP_EXT))
+ lookingForAnnotations(file);
+ } else if(ext.equalsIgnoreCase(XML_EXT) || ext.equalsIgnoreCase(XHTML_EXT) || ext.equalsIgnoreCase(JSP_EXT))
scanDOM(file, content);
else if(ext.equalsIgnoreCase(PROPERTIES_EXT))
scanProperties(file, content);
}
+ private void lookingForAnnotations(IFile file){
+ List<IAnnotation> annotations = getAnnotations(file, ANNOTATION_IN);
+ for(IAnnotation annotation : annotations){
+ if(annotation.getParent().getElementType() == IJavaElement.FIELD){
+ //System.out.println("@In for field - "+annotation.getElementName());
+ IField field = (IField)annotation.getParent();
+ if(annotation.getElementName().indexOf("\"") < 0 && field.getElementName().equals(component.getName())){
+
+// RenameFieldProcessor fieldProcessor = new RenameFieldProcessor(field);
+// fieldProcessor.setUpdateReferences(true);
+// fieldProcessor.setNewElementName(newName);
+// try{
+// System.out.println("Rename Field");
+// DynamicValidationRefactoringChange change = (DynamicValidationRefactoringChange)fieldProcessor.createChange(new NullProgressMonitor());
+// rootChange.add(change);
+// }catch(CoreException ex){
+// SeamCorePlugin.getDefault().logError(ex);
+// }
+ try{
+ String annotationText = "@In(\""+newName+"\")";
+
+ TextEdit edit = new ReplaceEdit(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), annotationText);
+ TextFileChange change = getChange(file);
+ change.addEdit(edit);
+ }catch(JavaModelException ex){
+ SeamCorePlugin.getDefault().logError(ex);
+ }
+ }
+ }else if(annotation.getParent().getElementType() == IJavaElement.METHOD){
+ //System.out.println("@In for method - "+annotation.getElementName());
+ IMethod method = (IMethod)annotation.getParent();
+ if(annotation.getElementName().indexOf("\"") < 0 && method.getElementName().equals(component.getName())){
+// TextChangeManager man = new TextChangeManager();
+// RenameNonVirtualMethodProcessor methodProcessor = new RenameNonVirtualMethodProcessor(method);
+// methodProcessor.setUpdateReferences(true);
+// methodProcessor.setNewElementName(newName);
+// try{
+// System.out.println("Rename Method");
+// DynamicValidationRefactoringChange change = (DynamicValidationRefactoringChange)methodProcessor.createChange(new NullProgressMonitor());
+// rootChange.add(change);
+// }catch(CoreException ex){
+// SeamCorePlugin.getDefault().logError(ex);
+// }
+ try{
+ String annotationText = "@In(\""+newName+"\")";
+
+ TextEdit edit = new ReplaceEdit(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), annotationText);
+ TextFileChange change = getChange(file);
+ change.addEdit(edit);
+ }catch(JavaModelException ex){
+ SeamCorePlugin.getDefault().logError(ex);
+ }
+ }
+ }
+ }
+ annotations = getAnnotations(file, ANNOTATION_FACTORY);
+ for(IAnnotation annotation : annotations){
+ if(annotation.getParent().getElementType() == IJavaElement.FIELD){
+ //System.out.println("@Factory for field - "+annotation.getElementName());
+ }else if(annotation.getParent().getElementType() == IJavaElement.METHOD){
+ //System.out.println("@Factory for method - "+annotation.getElementName());
+ }
+ }
+ }
+
private void scanJava(IFile file, String content){
try {
FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
@@ -275,10 +397,11 @@
if(nameNode != null){
if(nameNode.getNodeValue().equals(component.getName())){
IStructuredDocumentRegion region = ((IDOMNode)node).getFirstStructuredDocumentRegion();
- checkLastChange(file);
+ TextFileChange change = getChange(file);
+
TextEdit edit = new ReplaceEdit(region.getStartOffset(), region.getLength(), region.getFullText().replace(component.getName(), newName));
- lastChange.addEdit(edit);
+ change.addEdit(edit);
}
}
@@ -311,17 +434,30 @@
}
}
- TextFileChange lastChange = null;
+ private CompositeChange rootChange;
+ private TextFileChange lastChange;
- private void checkLastChange(IFile file){
- if(lastChange == null || lastChange.getFile() != file){
- lastChange = new TextFileChange(file.getName(), file);
- MultiTextEdit root = new MultiTextEdit();
- lastChange.setEdit(root);
- changes.add(lastChange);
+ // lets collect all changes for the same files in one MultiTextEdit
+ private TextFileChange getChange(IFile file){
+ if(lastChange != null && lastChange.getFile().equals(file))
+ return lastChange;
+
+ for(int i=0; i < rootChange.getChildren().length; i++){
+ TextFileChange change = (TextFileChange)rootChange.getChildren()[i];
+ if(change.getFile().equals(file)){
+ lastChange = change;
+ return lastChange;
+ }
}
+ lastChange = new TextFileChange(file.getName(), file);
+ MultiTextEdit root = new MultiTextEdit();
+ lastChange.setEdit(root);
+ rootChange.add(lastChange);
+
+ return lastChange;
}
+ // looking for component references in EL
private void scanString(IFile file, String string, int offset) {
int startEl = string.indexOf("#{"); //$NON-NLS-1$
if(startEl>-1) {
@@ -331,9 +467,9 @@
for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
ELPropertyInvocation pi = findComponentReference(ie);
if(pi != null){
- checkLastChange(file);
+ TextFileChange change = getChange(file);
TextEdit edit = new ReplaceEdit(offset+pi.getStartPosition(), pi.getName().getStart()+pi.getName().getLength()-pi.getStartPosition(), newName);
- lastChange.addEdit(edit);
+ change.addEdit(edit);
}
}
}
@@ -358,7 +494,7 @@
private void scanProperties(IFile file, String content){
scanString(file, content, 0);
- StringTokenizer tokenizer = new StringTokenizer(content, "= \t\r\n\f", true);
+ StringTokenizer tokenizer = new StringTokenizer(content, ".#= \t\r\n\f", true);
String lastToken = "\n";
int offset = 0;
@@ -366,7 +502,7 @@
boolean key = true;
while(tokenizer.hasMoreTokens()){
- String token = tokenizer.nextToken(".#= \t\r\n\f");//$NON-NLS-1$
+ String token = tokenizer.nextToken(".#= \t\r\n\f"); //$NON-NLS-1$
if(token.equals("\r"))
token = "\n";
@@ -382,9 +518,9 @@
key = false;
if(key && token.equals(component.getName())){
- checkLastChange(file);
+ TextFileChange change = getChange(file);
TextEdit edit = new ReplaceEdit(offset, token.length(), newName);
- lastChange.addEdit(edit);
+ change.addEdit(edit);
}
}
@@ -418,8 +554,6 @@
return result;
}
- private ArrayList<Change> changes = new ArrayList<Change>();
-
/*
* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
@@ -427,22 +561,23 @@
@Override
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
- if(annotation == null)
- return null;
+ rootChange = new CompositeChange("Rename Seam Component");
- changes.clear();
+ if(file != null){
+ IAnnotation annotation = getNameAnnotation(file);
+ if(annotation != null){
+ TextFileChange change = getChange(file);
+
+ String annotationText = annotation.getSource().replace(component.getName(), newName);
+
+ TextEdit edit = new ReplaceEdit(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), annotationText);
+ change.addEdit(edit);
+ }
+ }
+
findReferences();
- CompositeChange root = new CompositeChange("Rename Seam Component");
- TextFileChange change = new TextFileChange(file.getName(), file);
-
- String annotationText = annotation.getSource().replace(component.getName(), newName);
-
- TextEdit edit = new ReplaceEdit(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), annotationText);
- change.setEdit(edit);
- root.add(change);
- root.addAll(changes.toArray(new Change[0]));
- return root;
+ return rootChange;
}
/*
15 years, 8 months
JBoss Tools SVN: r14805 - trunk/jbpm/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-04-17 11:15:45 -0400 (Fri, 17 Apr 2009)
New Revision: 14805
Modified:
trunk/jbpm/docs/reference/en/modules/jboss_jbpm_runtime_installation.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-684 - updating the jbpm jpdl version;
Modified: trunk/jbpm/docs/reference/en/modules/jboss_jbpm_runtime_installation.xml
===================================================================
--- trunk/jbpm/docs/reference/en/modules/jboss_jbpm_runtime_installation.xml 2009-04-17 15:14:43 UTC (rev 14804)
+++ trunk/jbpm/docs/reference/en/modules/jboss_jbpm_runtime_installation.xml 2009-04-17 15:15:45 UTC (rev 14805)
@@ -15,8 +15,8 @@
jBPM</property> (business process management).</para>
<para>The jBPM plugin (jBPM Designer) is already included in the <property>JBoss Tools</property>.
To make it work, you should only download the jBPM runtime (<ulink
- url="http://sourceforge.net/project/showfiles.php?group_id=70542&package_i..."
- >jbpm-jpdl-3.2.2</ulink> currently) and specify the directory where you extracted the runtime
+ url="http://sourceforge.net/project/showfiles.php?group_id=70542&package_i..."
+ >jbpm-jpdl-3.2.3</ulink> currently) and specify the directory where you extracted the runtime
either when you create a jBPM project or by using the jBPM preference pages.</para>
<note>
15 years, 8 months