JBoss Tools SVN: r10903 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:17:33 -0400 (Thu, 16 Oct 2008)
New Revision: 10903
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
Log:
cleanup
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2008-10-16 18:16:26 UTC (rev 10902)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2008-10-16 18:17:33 UTC (rev 10903)
@@ -38,8 +38,6 @@
*/
public class ConnectionEditPolicy extends org.eclipse.gef.editpolicies.ConnectionEditPolicy {
-// private ConnectionFactory elementConnectionFactory;
-
private CreationFactory elementConnectionFactory;
public void setElementConnectionFactory(CreationFactory elementConnectionFactory) {
16 years, 3 months
JBoss Tools SVN: r10902 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: registry and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:16:26 -0400 (Thu, 16 Oct 2008)
New Revision: 10902
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
Log:
creation factory based on the element
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-10-16 18:06:45 UTC (rev 10901)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-10-16 18:16:26 UTC (rev 10902)
@@ -30,9 +30,9 @@
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.gef.requests.SimpleFactory;
import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
@@ -58,7 +58,7 @@
}
protected CreationFactory getElementConnectionFactory() {
- return new SimpleFactory(getElementConnectionType());
+ return ElementRegistry.getCreationFactory(getElementConnection().getElement());
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16 18:06:45 UTC (rev 10901)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16 18:16:26 UTC (rev 10902)
@@ -339,5 +339,15 @@
}
};
}
+
+ public static CreationFactory getCreationFactory(Element element) {
+ String id = null;
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement != null) {
+ id = configurationElement.getAttribute("id");
+ }
+ return id == null ? null : getCreationFactory(id);
+ }
}
16 years, 3 months
JBoss Tools SVN: r10901 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:06:45 -0400 (Thu, 16 Oct 2008)
New Revision: 10901
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
basic jpdl serialization
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-10-16 18:06:11 UTC (rev 10900)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-10-16 18:06:45 UTC (rev 10901)
@@ -32,7 +32,7 @@
acceptsElementStrategy="org.jboss.tools.flow.jpdl4.strategy.ProcessAcceptsElementStrategy"></flow>
</element>
<element
- class="org.jboss.tools.flow.common.model.DefaultContainer"
+ class="org.jboss.tools.flow.jpdl4.model.SuperState"
figure="icons/super.gif"
id="org.jboss.tools.flow.jpdl4.superState"
language="org.jboss.tools.flow.jpdl4"
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 2008-10-16 18:06:11 UTC (rev 10900)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2008-10-16 18:06:45 UTC (rev 10901)
@@ -38,18 +38,21 @@
private static void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
- buffer.append("\n");
- appendPadding(buffer, level);
if (element instanceof Transition) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("<transition");
Transition transition = (Transition)element;
if (transition.getTo() != null) {
+ buffer.append(" ");
String value = transition.getTo().getName();
value = value == null ? "" : value;
buffer.append("to=\"" + value + "\"");
}
buffer.append(">");
} else if (element instanceof EndState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<end-state");
EndState endState = (EndState)element;
if (endState.getName() != null) {
@@ -59,6 +62,8 @@
}
buffer.append(">");
} else if (element instanceof StartState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<start-state");
StartState startState = (StartState)element;
if (startState.getName() != null) {
@@ -68,6 +73,8 @@
}
buffer.append(">");
} else if (element instanceof SuperState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<super-state");
SuperState superState = (SuperState)element;
if (superState.getName() != null) {
@@ -77,6 +84,8 @@
}
buffer.append(">");
} else if (element instanceof State) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<state");
State state = (State)element;
if (state.getName() != null) {
@@ -112,19 +121,29 @@
private static void appendClosing(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
- buffer.append("\n");
- appendPadding(buffer, level);
if (element instanceof Transition) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</transition>");
} else if (element instanceof EndState) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</end-state>");
} else if (element instanceof StartState) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</start-state>");
} else if (element instanceof SuperState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("</super-state>");
} else if (element instanceof State) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</state>");
} else if (element instanceof Process) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("</process>");
}
}
@@ -134,14 +153,14 @@
ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
List<NodeWrapper> children = containerWrapper.getElements();
for (NodeWrapper nodeWrapper : children) {
- appendToBuffer(buffer, nodeWrapper, ++level);
+ appendToBuffer(buffer, nodeWrapper, level+1);
}
}
if (wrapper instanceof NodeWrapper) {
NodeWrapper nodeWrapper = (NodeWrapper)wrapper;
List<ConnectionWrapper> children = nodeWrapper.getOutgoingConnections();
for (ConnectionWrapper connectionWrapper : children) {
- appendToBuffer(buffer, connectionWrapper, ++level);
+ appendToBuffer(buffer, connectionWrapper, level+1);
}
}
}
16 years, 3 months
JBoss Tools SVN: r10900 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:06:11 -0400 (Thu, 16 Oct 2008)
New Revision: 10900
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
Log:
container wrapper is properties provider
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java 2008-10-16 18:06:11 UTC (rev 10900)
@@ -0,0 +1,50 @@
+package org.jboss.tools.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+
+public class DefaultContainerPropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultContainer.name";
+
+ private DefaultContainerWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultContainerPropertySource(DefaultContainerWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java 2008-10-16 18:06:11 UTC (rev 10900)
@@ -0,0 +1,50 @@
+package org.jboss.tools.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+
+public class DefaultNodePropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultNode.name";
+
+ private DefaultNodeWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultNodePropertySource(DefaultNodeWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
16 years, 3 months
JBoss Tools SVN: r10899 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:05:49 -0400 (Thu, 16 Oct 2008)
New Revision: 10899
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
Log:
container wrapper is properties provider
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2008-10-16 17:20:52 UTC (rev 10898)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2008-10-16 18:05:49 UTC (rev 10899)
@@ -29,7 +29,8 @@
*/
public abstract class AbstractFlowWrapper extends AbstractWrapper implements FlowWrapper {
- private Map<String, NodeWrapper> elements = new HashMap<String, NodeWrapper>();
+ private Map<String, NodeWrapper> elementMap = new HashMap<String, NodeWrapper>();
+ private List<NodeWrapper> elementList = new ArrayList<NodeWrapper>();
private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
public abstract Integer getRouterLayout();
@@ -44,11 +45,11 @@
public List<NodeWrapper> getElements() {
return Collections.unmodifiableList(
- new ArrayList<NodeWrapper>(elements.values()));
+ new ArrayList<NodeWrapper>(elementList));
}
public NodeWrapper getElement(String id) {
- return (NodeWrapper) elements.get(id);
+ return (NodeWrapper) elementMap.get(id);
}
public void addElement(NodeWrapper element) {
@@ -59,7 +60,8 @@
}
public void localAddElement(NodeWrapper element) {
- elements.put(element.getId(), element);
+ elementMap.put(element.getId(), element);
+ elementList.add(element);
}
public boolean acceptsElement(NodeWrapper element) {
@@ -68,10 +70,15 @@
protected abstract void internalAddElement(NodeWrapper element);
+ public void localRemoveElement(NodeWrapper element) {
+ elementMap.remove(element.getId());
+ elementList.remove(element);
+ }
+
public void removeElement(NodeWrapper element) {
- elements.remove(element.getId());
+ localRemoveElement(element);
+ internalRemoveElement(element);
notifyListeners(CHANGE_ELEMENTS);
- internalRemoveElement(element);
}
protected abstract void internalRemoveElement(NodeWrapper element);
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2008-10-16 17:20:52 UTC (rev 10898)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2008-10-16 18:05:49 UTC (rev 10899)
@@ -3,6 +3,8 @@
import java.util.List;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.common.properties.DefaultContainerPropertySource;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.Container;
import org.jboss.tools.flow.common.model.Flow;
@@ -16,7 +18,12 @@
private AcceptsElementStrategy acceptsElementStrategy;
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
+ private DefaultContainerPropertySource propertySource;
+ protected void internalSetName(String name) {
+ getNode().setName(name);
+ }
+
protected void internalAddElement(NodeWrapper element) {
Node node = (Node)element.getElement();
List<Node> nodes = ((Flow)getFlowWrapper().getElement()).getNodes();
@@ -117,4 +124,19 @@
}
}
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultContainerPropertySource(this);
+ }
+ return propertySource;
+ }
+
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-10-16 17:20:52 UTC (rev 10898)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-10-16 18:05:49 UTC (rev 10899)
@@ -1,6 +1,8 @@
package org.jboss.tools.flow.common.wrapper;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.common.properties.DefaultNodePropertySource;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.Node;
import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
@@ -10,6 +12,7 @@
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
+ private DefaultNodePropertySource propertySource;
public void setNode(Node node) {
setElement(node);
@@ -104,4 +107,19 @@
((DefaultConnectionWrapper) connection).getConnection());
}
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultNodePropertySource(this);
+ }
+ return propertySource;
+ }
+
}
16 years, 3 months
JBoss Tools SVN: r10898 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-16 13:20:52 -0400 (Thu, 16 Oct 2008)
New Revision: 10898
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-10-16 17:20:52 UTC (rev 10898)
@@ -51,6 +51,10 @@
<constraint>
<or>
<requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
facet="jst.ejb"
version="[3.0">
</requires>
@@ -77,6 +81,10 @@
<constraint>
<or>
<requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
facet="jst.ejb"
version="[3.0">
</requires>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 17:20:52 UTC (rev 10898)
@@ -80,16 +80,6 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEar(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEar(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEjb(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 17:20:52 UTC (rev 10898)
@@ -444,9 +444,63 @@
* @param monitor
* @throws CoreException
*/
- protected abstract void doExecuteForEar(IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException;
+ protected void doExecuteForEar(IProject project, IProjectFacetVersion fv,
+ IDataModel model, IProgressMonitor monitor) throws CoreException {
+/*
+ if(seamHomePath==null) {
+ return;
+ }
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, project.getName());
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFolder rootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+ IContainer earContentsContainer = rootVirtFolder.getUnderlyingFolder();
+ File earContentsFolder = earContentsFolder.getAbsoluteFile();
+ File earProjectFolder = project.getLocation().toFile();
+
+ File ejbTemplateDir;
+ AntCopyUtils.FileSet excludeCvsSvn;
+
+ try {
+ ejbTemplateDir = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb");
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ excludeCvsSvn = new AntCopyUtils.FileSet(SeamFacetAbstractInstallDelegate.CVS_SVN).dir(ejbTemplateDir);
+
+ FilterSet earFilterSet = new FilterSet();
+ earFilterSet.addFilter("projectName", project.getName() + ".ear"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
+ new File(earContentsFolder, "META-INF"), //$NON-NLS-1$
+ new FilterSetCollection(earFilterSet), false);
+
+ // Copy configuration files from template
+ try {
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ear"), //$NON-NLS-1$
+ earProjectFolder, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(ejbFilterSet), true);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
+ // Fill ear contents
+ AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(droolsLibFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamGenResFolder)));
+
+ File resources = new File(earProjectFolder, "resources");
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(resources, seamWebProject.getName() + "-ds.xml"), //$NON-NLS-1$ //$NON-NLS-2$
+ viewFilterSetCollection, true);
+*/
+ }
+
protected IResource getSrcFolder(IProject project) throws JavaModelException {
IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-16 17:20:52 UTC (rev 10898)
@@ -105,16 +105,6 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEar(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEar(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#copyFilesToWarProject(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
16 years, 3 months
JBoss Tools SVN: r10897 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-16 13:02:09 -0400 (Thu, 16 Oct 2008)
New Revision: 10897
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
Log:
JBIDE-2674, reporting about org.jboss.tools.vpe not founded error was added to JSPMultiPageEditor.java
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 16:58:29 UTC (rev 10896)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 17:02:09 UTC (rev 10897)
@@ -144,6 +144,9 @@
Class cls = b
.loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory"); //$NON-NLS-1$
visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ } else {
+ JspEditorPlugin.getPluginLog().logError("Plugin org.jboss.tools.vpe not available," + //$NON-NLS-1$
+ " visual page editor will be not available"); //$NON-NLS-1$
}
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError("Error in loading visual editor factory", e); //$NON-NLS-1$
16 years, 3 months
JBoss Tools SVN: r10896 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-16 12:58:29 -0400 (Thu, 16 Oct 2008)
New Revision: 10896
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-16 16:52:15 UTC (rev 10895)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-16 16:58:29 UTC (rev 10896)
@@ -12,7 +12,7 @@
<title>BIRT Report Designer</title>
- <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. In this chapter we will describe its interface and all its features to you.</para>
+ <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. In this chapter we will describe its interface and its features to you.</para>
<section id="birt_designer_UI" xreflabel="birt_designer_UI">
<title>BIRT User Interface</title>
@@ -52,10 +52,10 @@
<title>BIRT Report Designer Features</title>
<para>Here are the main BIRT Report Designer features:</para>
<itemizedlist><listitem><para><emphasis role="bold">Palette</emphasis> - contains tables, labels, and charts. It is used in conjunction with the Layout View to design reports.</para></listitem>
- <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources (connections) and data sets (queries). The data set editor allows you to test your data set to ensure the report receives the correct data. Within this view multi dimensional cubes can be created using existing data sets. Cubes are currently used when building dynamic cross tables. This view also is used to design report parameters.</para></listitem>
- <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies a Resource Explorer view. This view list all libraries within the resource folder, in addition other shared content such as images and JavaScript files.</para></listitem>
- <listitem><para><emphasis role="bold">Property Editor</emphasis> - Presents the most commonly used properties in a convenient format that makes editing quick and easy. BIRT also integrates with the standard Eclipse property view to provide a detailed listing of all properties for an item.</para></listitem>
- <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor that provides drag and drop creation of the presentation portion of your report.</para></listitem>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources and data sets. The Data Sets editor enables testing your data set to check whether the report receives the correct data. You can also create cubes using your data sets (when building any dynamic cross tables) and design necessary report parameters.</para></listitem>
+ <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies the Resource Explorer view. This view lists all libraries within the resource folder, in addition to other shared content such as images and JavaScript files.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - Shows the most commonly used properties. BIRT also integrates with the standard Eclipse property view to display a detailed listing of all properties for an item.</para></listitem>
+ <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor. You can select any element from the Palette, drag and drop it to the report and then edit the way you like.</para></listitem>
<listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
<listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
<listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
16 years, 3 months
JBoss Tools SVN: r10895 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: outline and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-16 12:52:15 -0400 (Thu, 16 Oct 2008)
New Revision: 10895
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
Log:
JBIDE-2674, checks for null was added in case when visual editor plugin are not installed in system, editor will be work only in source mode.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 16:12:40 UTC (rev 10894)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 16:52:15 UTC (rev 10895)
@@ -88,7 +88,7 @@
IReusableEditor, ITextEditorExtension, ITextEditorExtension2,
ITextEditorExtension3, INavigationLocationProvider, IMultiPageEditor {
- public static final String EDITOR_ID = "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor";
+ public static final String EDITOR_ID = "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; //$NON-NLS-1$
private static final String VISUALSOURCE_TAB_LABEL = "JSPMultiPageEditor.TabLabel.VisualSource"; //$NON-NLS-1$
@@ -108,8 +108,6 @@
private int visualSourceIndex;
- private int visualIndex;
-
private JSPTextEditor sourceEditor;
private int sourceIndex;
@@ -141,9 +139,12 @@
static {
try {
Bundle b = Platform.getBundle("org.jboss.tools.vpe"); //$NON-NLS-1$
- Class cls = b
- .loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory"); //$NON-NLS-1$
- visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ //FIX for JBIDE-2248
+ if(b!=null) {
+ Class cls = b
+ .loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory"); //$NON-NLS-1$
+ visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ }
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError("Error in loading visual editor factory", e); //$NON-NLS-1$
}
@@ -219,22 +220,22 @@
protected void pageChange(int newPageIndex) {
selectedPageIndex = newPageIndex;
-
- if (newPageIndex == visualSourceIndex) {
- if (visualEditor.getVisualEditor() == null) {
- visualEditor.createVisualEditor();
- }
- visualEditor.setVisualMode(IVisualEditor.VISUALSOURCE_MODE);
-
- }else if (newPageIndex == sourceIndex)
- visualEditor.setVisualMode(IVisualEditor.SOURCE_MODE);
- else if (newPageIndex == previewIndex) {
- if (visualEditor.getPreviewWebBrowser() == null) {
- visualEditor.createPreviewBrowser();
- }
- visualEditor.setVisualMode(IVisualEditor.PREVIEW_MODE);
- }
+ if(visualEditor!=null) {
+ if (newPageIndex == visualSourceIndex) {
+ if (visualEditor.getVisualEditor() == null) {
+ visualEditor.createVisualEditor();
+ }
+ visualEditor.setVisualMode(IVisualEditor.VISUALSOURCE_MODE);
+ }else if (newPageIndex == sourceIndex)
+ visualEditor.setVisualMode(IVisualEditor.SOURCE_MODE);
+ else if (newPageIndex == previewIndex) {
+ if (visualEditor.getPreviewWebBrowser() == null) {
+ visualEditor.createPreviewBrowser();
+ }
+ visualEditor.setVisualMode(IVisualEditor.PREVIEW_MODE);
+ }
+ }
superPageChange(newPageIndex);
}
@@ -252,7 +253,9 @@
((AbstractTextEditor) sourceEditor)
.setInput(getEditorInput());
}
- visualEditor.setInput(getEditorInput());
+ if(visualEditor!=null) {
+ visualEditor.setInput(getEditorInput());
+ }
updateTitle();
}
updateFile();
@@ -450,14 +453,17 @@
private void createPagesForVPE() {
sourceEditor = new JSPTextEditor(this);
- visualEditor = visualEditorFactory.createVisualEditor(this,
- sourceEditor, false);
-
+ if(visualEditorFactory!=null) {
+ visualEditor = visualEditorFactory.createVisualEditor(this,
+ sourceEditor, false);
+ }
try {
- visualSourceIndex = addPage(visualEditor, getEditorInput());
- setPageText(visualSourceIndex, JSPEditorMessages
- .getString(VISUALSOURCE_TAB_LABEL));
- setPartName(visualEditor.getTitle());
+ if(visualEditor!=null) {
+ visualSourceIndex = addPage(visualEditor, getEditorInput());
+ setPageText(visualSourceIndex, JSPEditorMessages
+ .getString(VISUALSOURCE_TAB_LABEL));
+ setPartName(visualEditor.getTitle());
+ }
} catch (PartInitException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -471,20 +477,29 @@
}*/
try {
- sourceIndex = addPage(visualEditor, getEditorInput());
- setPageText(sourceIndex, JSPEditorMessages
- .getString(SOURCE_TAB_LABEL));
- setPartName(visualEditor.getTitle());
+ if(visualEditor!=null) {
+ sourceIndex = addPage(visualEditor, getEditorInput());
+ setPageText(sourceIndex, JSPEditorMessages
+ .getString(SOURCE_TAB_LABEL));
+ setPartName(visualEditor.getTitle());
+ } else {
+ sourceIndex = addPage(sourceEditor, getEditorInput());
+ setPageText(sourceIndex, JSPEditorMessages
+ .getString(SOURCE_TAB_LABEL));
+ setPartName(sourceEditor.getTitle());
+ }
} catch (PartInitException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
// Add tab contain default web-browser
try {
- previewIndex = addPage(visualEditor, getEditorInput());
- setPageText(previewIndex, JSPEditorMessages
- .getString(PREVIEW_TAB_LABEL));
- setPartName(visualEditor.getTitle());
+ if(visualEditor!=null) {
+ previewIndex = addPage(visualEditor, getEditorInput());
+ setPageText(previewIndex, JSPEditorMessages
+ .getString(PREVIEW_TAB_LABEL));
+ setPartName(visualEditor.getTitle());
+ }
} catch (PartInitException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -566,7 +581,9 @@
((MultiPageEditorActionBarContributor) contributor)
.setActivePage(null);
}
- visualEditor.dispose();
+ if(visualEditor!=null) {
+ visualEditor.dispose();
+ }
site.dispose();
outlinePage = null;
XModelObject o = getModelObject();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2008-10-16 16:12:40 UTC (rev 10894)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2008-10-16 16:52:15 UTC (rev 10895)
@@ -62,9 +62,10 @@
static {
try {
Bundle b = Platform.getBundle("org.jboss.tools.vpe");
- Class cls = b.loadClass("org.jboss.tools.vpe.editor.dnd.context.ViewerDropAdapterFactory");
- dropAdapterFactory = (IViewerDropAdapterFactory)cls.newInstance();
-
+ if(b!=null) {
+ Class cls = b.loadClass("org.jboss.tools.vpe.editor.dnd.context.ViewerDropAdapterFactory");
+ dropAdapterFactory = (IViewerDropAdapterFactory)cls.newInstance();
+ }
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -86,12 +87,13 @@
FileTransfer.getInstance(),
TextTransfer.getInstance()
};
+ if(dropAdapterFactory!=null) {
fTransferDropTargetListeners = new TransferDropTargetListener[transfers.length];
for (int i = 0; i < transfers.length; i++) {
final Transfer transfer = transfers[i];
DropContext dropContext = new DropContext();
- final ViewerDropAdapter dropAdapter = dropAdapterFactory.createDropAdapter(transfer, treeViewer, editor, transfer, dropContext);
- fTransferDropTargetListeners[i] = new TransferDropTargetListener() {
+ final ViewerDropAdapter dropAdapter = dropAdapterFactory.createDropAdapter(transfer, treeViewer, editor, transfer, dropContext);
+ fTransferDropTargetListeners[i] = new TransferDropTargetListener() {
public void dragEnter(DropTargetEvent event) {
dropAdapter.dragEnter(event);
}
@@ -124,6 +126,9 @@
return getTransfer().isSupportedType(event.currentDataType);
}
};
+ }
+ } else {
+ fTransferDropTargetListeners = new TransferDropTargetListener[0];
}
}
return fTransferDropTargetListeners;
16 years, 3 months
JBoss Tools SVN: r10894 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-16 12:12:40 -0400 (Thu, 16 Oct 2008)
New Revision: 10894
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731 2.3. is done
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 15:56:06 UTC (rev 10893)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 16:12:40 UTC (rev 10894)
@@ -104,7 +104,7 @@
super.doExecuteForEjb(project, fv, model, monitor);
IResource src = getSrcFolder(project);
- if(src!=null) {
+ if(src!=null && seamHomeFolder!=null) {
File srcFile = src.getLocation().toFile();
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"), srcFile, false); //$NON-NLS-1$
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 15:56:06 UTC (rev 10893)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 16:12:40 UTC (rev 10894)
@@ -40,7 +40,9 @@
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.model.IModelProvider;
@@ -167,6 +169,7 @@
stopListening();
}
if(errorOccurs) {
+ errorOccurs = false;
Display.getDefault().syncExec(
new Runnable() {
public void run() {
@@ -306,24 +309,6 @@
srcFolder = isWarConfiguration(model) ? new File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(), "model") : srcRootFolder.getUnderlyingFolder().getLocation().toFile(); //$NON-NLS-1$
Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
if(runtimeName!=null) {
- final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
-
- seamHomePath = selectedRuntime.getHomeDir();
-
- seamHomeFolder = new File(seamHomePath);
- seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
- seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
-
- seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
- seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
- dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
- componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
- //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
- persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
-
copyFilesToWarProject(project, fv, model, monitor);
} else {
// If seam runtime is null then just modify web.xml and add seam nature.
@@ -490,9 +475,7 @@
*/
protected void doExecuteForEjb(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
-
- IResource src = getSrcFolder(project);
- if(src==null) {
+ if(seamHomePath == null) {
return;
}
@@ -501,46 +484,49 @@
FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- if(ejbViewFilterSetCollection==null) {
- ejbViewFilterSetCollection = new FilterSetCollection();
- ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
- ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
- }
-
FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
hibernateDialectFilterSet.addFilterSet(projectFilterSet);
hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
- File srcFile = src.getLocation().toFile();
- // Copy sources to EJB project in case of EAR configuration
- AntCopyUtils.copyFileToFile(
- new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
- new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new FilterSetCollection(filtersFilterSet), false);
+ IResource src = getSrcFolder(project);
+ if(src!=null) {
+ if(ejbViewFilterSetCollection==null) {
+ ejbViewFilterSetCollection = new FilterSetCollection();
+ ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
+ }
- File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
- if(!persistentXml.exists()) {
- AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
- ejbViewFilterSetCollection, false);
- } else {
- // TODO modify persistence.xml
- }
+ File srcFile = src.getLocation().toFile();
+ // Copy sources to EJB project in case of EAR configuration
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
+ new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ new FilterSetCollection(filtersFilterSet), false);
- File componentProperties = new File(srcFile, "components.properties"); //$NON-NLS-1$
- if(!componentProperties.exists()) {
- SeamFacetAbstractInstallDelegate.createComponentsProperties(srcFile, project.getName(), false);
- }
+ File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
+ if(!persistentXml.exists()) {
+ AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
+ ejbViewFilterSetCollection, false);
+ } else {
+ // TODO modify persistence.xml
+ }
- AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), ejbViewFilterSetCollection, false);
+ File componentProperties = new File(srcFile, "components.properties"); //$NON-NLS-1$
+ if(!componentProperties.exists()) {
+ SeamFacetAbstractInstallDelegate.createComponentsProperties(srcFile, project.getName(), false);
+ }
- File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml");
- if(!ejbJarXml.exists()) {
- AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
- new File(srcFile, "META-INF"), ejbViewFilterSetCollection, false); //$NON-NLS-1$
- } else {
- // TODO modify ejb-jar.xml
+ AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), ejbViewFilterSetCollection, false);
+
+ File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml");
+ if(!ejbJarXml.exists()) {
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
+ new File(srcFile, "META-INF"), ejbViewFilterSetCollection, false); //$NON-NLS-1$
+ } else {
+ // TODO modify ejb-jar.xml
+ }
}
FilterSet ejbFilterSet = new FilterSet();
ejbFilterSet.addFilter("projectName", ejbProjectFolder.getName()); //$NON-NLS-1$
@@ -553,6 +539,14 @@
ejbProjectFolder, hibernateDialectFilterSet, false);
}
+ enum ProjectType {
+ EAR,
+ EJB,
+ WAR
+ }
+
+ protected ProjectType projectType;
+
/**
*
* @param project
@@ -563,6 +557,7 @@
*/
public void doExecute(final IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
+ ejbViewFilterSetCollection = null;
final IDataModel model = (IDataModel)config;
IFacetedProject facetedProject = ProjectFacetsManager.create(project);
IProjectFacetVersion ejbVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.EJB_FACET);
@@ -582,11 +577,37 @@
model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
}
+ Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
+ if(runtimeName!=null) {
+ final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
+
+ seamHomePath = selectedRuntime.getHomeDir();
+
+ seamHomeFolder = new File(seamHomePath);
+ seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
+ seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
+
+ seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
+ seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
+ dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
+ componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
+ persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ seamHomePath = null;
+ }
+
if(ejbVersion!=null) {
+ projectType = ProjectType.EJB;
doExecuteForEjb(project, fv, model, monitor);
} else if(webVersion!=null) {
+ projectType = ProjectType.WAR;
doExecuteForWar(project, fv, model, monitor);
} else if(earVersion!=null) {
+ projectType = ProjectType.EAR;
doExecuteForEar(project, fv, model, monitor);
}
@@ -600,14 +621,19 @@
if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)==null) {
model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, warProject?ISeamFacetDataModelProperties.DEPLOY_AS_WAR:ISeamFacetDataModelProperties.DEPLOY_AS_EAR);
}
+ Object projectNamePackage = model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ IStatus status = JavaConventions.validatePackageName(projectNamePackage.toString(), CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5);
+ if(!status.isOK()) {
+ projectNamePackage = "project";
+ }
if(model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME)==null) {
- model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".session"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.domain." + projectNamePackage + ".session"); //$NON-NLS-1$
}
if(model.getProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME)==null) {
- model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".entity"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.domain." + projectNamePackage + ".entity"); //$NON-NLS-1$
}
if(model.getProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME)==null) {
- model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".test"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.domain." + projectNamePackage + ".test"); //$NON-NLS-1$
}
if(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME)==null) {
String runtimeName = SeamFacetInstallDataModelProvider.getSeamRuntimeDefaultValue(model);
@@ -669,6 +695,9 @@
*/
protected void createSeamProjectPreferenes(final IProject project,
final IDataModel model) {
+ if(projectType == ProjectType.EAR) {
+ return;
+ }
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
@@ -690,10 +719,23 @@
IVirtualFolder rootFolder = component.getRootFolder();
IContainer webRootFolder = rootFolder.getFolder(new Path("/")).getUnderlyingFolder(); //$NON-NLS-1$
String webRootFolderPath = webRootFolder.getFullPath().toString();
- prefs.put(WEB_CONTENTS_FOLDER, webRootFolderPath);
+ IPath srcRootFolder = null;
+ if(projectType == ProjectType.WAR) {
+ srcRootFolder = rootFolder.getFolder(new Path("/WEB-INF/classes")).getUnderlyingFolder().getParent().getFullPath(); //$NON-NLS-1$
+ } else if(projectType == ProjectType.EJB) {
+ try {
+ srcRootFolder = getSrcFolder(project).getFullPath();
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ srcRootFolder = new Path("");
+ }
+ }
+ if(projectType == ProjectType.WAR) {
+ prefs.put(WEB_CONTENTS_FOLDER, webRootFolderPath);
+ } else {
+ prefs.put(WEB_CONTENTS_FOLDER, srcRootFolder.toString());
+ }
- IPath srcRootFolder = rootFolder.getFolder(new Path("/WEB-INF/classes")).getUnderlyingFolder().getParent().getFullPath(); //$NON-NLS-1$
-
if(!isWarConfiguration(model)) {
prefs.put(SEAM_EJB_PROJECT, project.getName());
prefs.put(SEAM_EAR_PROJECT, project.getName());
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java 2008-10-16 16:12:40 UTC (rev 10894)
@@ -0,0 +1,35 @@
+ /*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.Map;
+
+import org.eclipse.ltk.core.refactoring.RefactoringContribution;
+import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameComponentRefactoringContribution extends RefactoringContribution {
+
+ @Override
+ public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags) {
+// return new IntroduceIndirectionDescriptor(project, description, comment, arguments);
+ return super.createDescriptor();
+ }
+
+ @Override
+ public Map retrieveArgumentMap(RefactoringDescriptor descriptor) {
+// if (descriptor instanceof IntroduceIndirectionDescriptor)
+// return ((IntroduceIndirectionDescriptor) descriptor).getArguments();
+ return super.retrieveArgumentMap(descriptor);
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 3 months