JBoss Tools SVN: r14964 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editpart and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-29 13:04:11 -0400 (Wed, 29 Apr 2009)
New Revision: 14964
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java
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/editpart/EventListenerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.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/EventListenerContainer.java
Log:
event listener and event listener container configuration
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-29 15:22:06 UTC (rev 14963)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-29 17:04:11 UTC (rev 14964)
@@ -290,6 +290,18 @@
<input type="org.jboss.tools.flow.jpdl4.model.Timer"/>
</propertySection>
<propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.EventTypeSection"
+ id="org.jboss.tools.jpdl4.eventType"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.EventListenerContainer"/>
+ </propertySection>
+ <propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.ClassNameSection"
+ id="org.jboss.tools.jpdl4.className"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.EventListener"/>
+ </propertySection>
+ <propertySection
class="org.jboss.tools.flow.jpdl4.properties.AssignmentSection"
id="org.jboss.tools.jpdl4.assignment"
tab="org.jboss.tools.jpdl4.assignment">
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java 2009-04-29 15:22:06 UTC (rev 14963)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -9,6 +9,7 @@
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
import org.jboss.tools.flow.jpdl4.util.SharedImages;
public class EventListenerListTreeEditPart extends JpdlTreeEditPart implements ElementTreeEditPart {
@@ -31,8 +32,8 @@
protected List<Object> getModelChildren() {
List<Object> result = new ArrayList<Object>();
Wrapper wrapper = (Wrapper)getModel();
- if (wrapper.getChildren("listener") != null) {
- result.addAll(wrapper.getChildren("listener"));
+ if (wrapper.getChildren(EventListenerContainer.LISTENERS) != null) {
+ result.addAll(wrapper.getChildren(EventListenerContainer.LISTENERS));
}
return result;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java 2009-04-29 15:22:06 UTC (rev 14963)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -44,9 +44,9 @@
wrapper.setElement(new EventListener());
addChildCommand.setType("eventListener");
child.setElement(new EventListenerContainer());
- child.addChild("listener", wrapper);
+ child.addChild(EventListenerContainer.LISTENERS, wrapper);
} else {
- addChildCommand.setType("listener");
+ addChildCommand.setType(EventListenerContainer.LISTENERS);
child.setElement(new EventListener());
}
addChildCommand.setChild(child);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-04-29 15:22:06 UTC (rev 14963)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -52,7 +52,7 @@
} else if (child.getElement() instanceof Timer) {
deleteChildCommand.setType("timer");
} else if (child.getElement() instanceof EventListener) {
- deleteChildCommand.setType("listener");
+ deleteChildCommand.setType(EventListenerContainer.LISTENERS);
} else if (child.getElement() instanceof EventListenerContainer) {
deleteChildCommand.setType("eventListener");
}
Modified: 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 2009-04-29 15:22:06 UTC (rev 14963)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -1,10 +1,19 @@
package org.jboss.tools.flow.jpdl4.model;
+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.model.DefaultElement;
public class EventListener extends DefaultElement {
+ public static final String CLASS_NAME = "org.jboss.tools.flow.jpdl4.model.eventListener.className";
+
private String className;
+
+ public EventListener() {
+ setMetaData("propertySource", new PropertySource());
+ }
public String getClassName() {
return className;
@@ -14,4 +23,48 @@
this.className = className;
}
+ private class PropertySource implements IPropertySource {
+
+ private IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(CLASS_NAME, "Class") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (CLASS_NAME.equals(id)) {
+ return getClassName() != null ? getClassName() : "";
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (CLASS_NAME.equals(id)) {
+ return getClassName() != null;
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (CLASS_NAME.equals(id)) {
+ if (value instanceof String) {
+ setClassName((String)value);
+ }
+ }
+ }
+
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java 2009-04-29 15:22:06 UTC (rev 14963)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -5,10 +5,14 @@
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.model.DefaultElement;
public class EventListenerContainer extends DefaultElement {
+ public static final String LISTENERS = "org.jboss.tools.flow.jpdl4.model.eventListenerContainer.listeners";
+ public static final String EVENT_TYPE = "org.jboss.tools.flow.jpdl4.model.eventListenerContainer.eventType";
+
private String eventType;
private List<EventListener> listeners = new ArrayList<EventListener>();
@@ -34,24 +38,36 @@
private class PropertySource implements IPropertySource {
+ private IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(EVENT_TYPE, "Event Type") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+
public Object getEditableValue() {
return null;
}
public IPropertyDescriptor[] getPropertyDescriptors() {
- return new IPropertyDescriptor[0];
+ return propertyDescriptors;
}
public Object getPropertyValue(Object id) {
- if ("listener".equals(id)) {
+ if (LISTENERS.equals(id)) {
return listeners;
+ } else if (EVENT_TYPE.equals(id)) {
+ return getEventType() != null ? getEventType() : "";
}
return null;
}
public boolean isPropertySet(Object id) {
- if ("listener".equals(id)) {
+ if (LISTENERS.equals(id)) {
return true;
+ } else if (EVENT_TYPE.equals(id)) {
+ return getEventType() != null;
}
return false;
}
@@ -60,6 +76,11 @@
}
public void setPropertyValue(Object id, Object value) {
+ if (EVENT_TYPE.equals(id)) {
+ if (value instanceof String) {
+ setEventType((String)value);
+ }
+ }
}
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -0,0 +1,69 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.jpdl4.model.EventListener;
+
+public class ClassNameSection extends JpdlPropertySection {
+
+ private Text classNameText;
+ private CLabel classNameLabel;
+
+ private ModifyListener textModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent arg0) {
+ changeProperty(EventListener.CLASS_NAME, getValueNullsAllowed(classNameText.getText()));
+ }
+ };
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createEventTypeLabel(composite);
+ createEventTypeText(composite);
+ }
+
+
+ private void createEventTypeLabel(Composite parent) {
+ classNameLabel = getWidgetFactory().createCLabel(parent, "Class");
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ classNameLabel.setLayoutData(data);
+ }
+
+ private void createEventTypeText(Composite parent) {
+ classNameText = getWidgetFactory().createText(parent, "");
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(classNameLabel, 0, SWT.RIGHT);
+ data.right = new FormAttachment(100, 0);
+ classNameText.setLayoutData(data);
+ }
+
+ protected void hookListeners() {
+ classNameText.addModifyListener(textModifyListener);
+ }
+
+ protected void unhookListeners() {
+ classNameText.removeModifyListener(textModifyListener);
+ }
+
+ protected void updateValues() {
+ IPropertySource input = getInput();
+ if (input != null) {
+ classNameText.setText(getValueNotNull((String)input.getPropertyValue(EventListener.CLASS_NAME)));
+ } else {
+ classNameText.setText("");
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java 2009-04-29 17:04:11 UTC (rev 14964)
@@ -0,0 +1,69 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
+
+public class EventTypeSection extends JpdlPropertySection {
+
+ private Text eventTypeText;
+ private CLabel eventTypeLabel;
+
+ private ModifyListener textModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent arg0) {
+ changeProperty(EventListenerContainer.EVENT_TYPE, getValueNullsAllowed(eventTypeText.getText()));
+ }
+ };
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createEventTypeLabel(composite);
+ createEventTypeText(composite);
+ }
+
+
+ private void createEventTypeLabel(Composite parent) {
+ eventTypeLabel = getWidgetFactory().createCLabel(parent, "Event Type");
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ eventTypeLabel.setLayoutData(data);
+ }
+
+ private void createEventTypeText(Composite parent) {
+ eventTypeText = getWidgetFactory().createText(parent, "");
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(eventTypeLabel, 0, SWT.RIGHT);
+ data.right = new FormAttachment(100, 0);
+ eventTypeText.setLayoutData(data);
+ }
+
+ protected void hookListeners() {
+ eventTypeText.addModifyListener(textModifyListener);
+ }
+
+ protected void unhookListeners() {
+ eventTypeText.removeModifyListener(textModifyListener);
+ }
+
+ protected void updateValues() {
+ IPropertySource input = getInput();
+ if (input != null) {
+ eventTypeText.setText(getValueNotNull((String)input.getPropertyValue(EventListenerContainer.EVENT_TYPE)));
+ } else {
+ eventTypeText.setText("");
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 5 months
JBoss Tools SVN: r14963 - tags.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-04-29 11:22:06 -0400 (Wed, 29 Apr 2009)
New Revision: 14963
Added:
tags/jbosstools-3.0.1.GA/
Removed:
tags/jbosstools-3.0.x/
Log:
tag for 3.0.1.GA
Copied: tags/jbosstools-3.0.1.GA (from rev 14962, tags/jbosstools-3.0.x)
16 years, 5 months
JBoss Tools SVN: r14962 - tags.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-04-29 11:21:45 -0400 (Wed, 29 Apr 2009)
New Revision: 14962
Added:
tags/jbosstools-3.0.x/
Log:
tag for 3.0.1.GA
Copied: tags/jbosstools-3.0.x (from rev 14961, branches/jbosstools-3.0.x)
16 years, 5 months
JBoss Tools SVN: r14961 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-04-29 11:19:53 -0400 (Wed, 29 Apr 2009)
New Revision: 14961
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-04-29 15:19:53 UTC (rev 14961)
@@ -0,0 +1,120 @@
+package org.jboss.tools.seam.core.test.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+import junit.framework.TestCase;
+
+public class SeamComponentRefactoringTest extends TestCase {
+ static String warProjectName = "RenameComponentTestProject-war";
+ static String ejbProjectName = "RenameComponentTestProject-ejb";
+ static IProject warProject;
+ static IProject ejbProject;
+ static ISeamProject seamWarProject;
+ static ISeamProject seamEjbProject;
+
+ protected void setUp() throws Exception {
+ if(warProject==null) {
+ warProject = ProjectImportTestSetup.loadProject(warProjectName);
+ }
+ if(ejbProject==null) {
+ ejbProject = ProjectImportTestSetup.loadProject(ejbProjectName);;
+ }
+ if(seamWarProject==null) {
+ seamWarProject = loadSeamProject(warProject);
+ }
+ if(seamEjbProject==null) {
+ seamEjbProject = loadSeamProject(ejbProject);
+ }
+ }
+
+ private ISeamProject loadSeamProject(IProject project) throws CoreException {
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ assertNotNull("Seam project for " + project.getName() + " is null", seamProject);
+ JobUtils.waitForIdle();
+ return seamProject;
+ }
+
+ public void testSeamComponentRename() throws CoreException {
+ ISeamComponent[] components = seamWarProject.getComponents();
+ for(ISeamComponent component : components){
+ System.out.println("Seam Component - "+component.getName());
+ }
+
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+ renameComponent(seamWarProject, "abc", "tre", list);
+ }
+
+ private void renameComponent(ISeamProject seamProject, String componentName, String newName, List<TestChangeStructure> changeList) throws CoreException{
+
+ // Test before renaming
+ ISeamComponent component = seamProject.getComponent(componentName);
+ assertNotNull(component);
+ assertNull(seamProject.getComponent(newName));
+ for(TestChangeStructure changeStructure : changeList){
+ IFile file = seamProject.getProject().getFile(changeStructure.getFileName());
+ String content = null;
+ content = FileUtil.readStream(file.getContents());
+ assertNotSame(changeStructure.getText(), content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength()));
+ }
+
+ // Rename Seam Component
+ RenameComponentProcessor processor = new RenameComponentProcessor(component);
+ processor.setNewComponentName(newName);
+ Change change = processor.createChange(new NullProgressMonitor());
+ change.perform(new NullProgressMonitor());
+
+ // Test results
+ assertNull(seamProject.getComponent(componentName));
+ assertNotNull(seamProject.getComponent(newName));
+ for(TestChangeStructure changeStructure : changeList){
+ IFile file = seamProject.getProject().getFile(changeStructure.getFileName());
+ String content = null;
+ content = FileUtil.readStream(file.getContents());
+ assertEquals(changeStructure.getText(), content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength()));
+ }
+ }
+
+ class TestChangeStructure{
+ private String fileName;
+ private int offset;
+ private int length;
+ private String text;
+
+ public TestChangeStructure(String fileName, int offset, int length, String text){
+ this.fileName = fileName;
+ this.offset = offset;
+ this.length = length;
+ this.text = text;
+ }
+
+ public String getFileName(){
+ return fileName;
+ }
+
+ public int getOffset(){
+ return offset;
+ }
+
+ public int getLength(){
+ return length;
+ }
+
+ public String getText(){
+ return text;
+ }
+ }
+}
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 5 months
JBoss Tools SVN: r14960 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-29 10:43:40 -0400 (Wed, 29 Apr 2009)
New Revision: 14960
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4239 - open HQL Editor instead of Hibernate Query result view
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-04-29 14:25:19 UTC (rev 14959)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-04-29 14:43:40 UTC (rev 14960)
@@ -164,6 +164,12 @@
ConsoleConfiguration consoleConfiguration = node.getConsoleConfiguration();
if(consoleConfiguration.isSessionFactoryCreated() ) {
String hql = node.getHQL();
+ // open HQL Editor
+ HibernateConsolePlugin.getDefault().openScratchHQLEditor(
+ consoleConfiguration == null ? null : consoleConfiguration.getName(), hql);
+ /** /
+ // execute query and show results in
+ // Hibernate Query result view - commented cause old version
if(StringHelper.isNotEmpty( hql )) {
try {
if (getSite() != null && getSite().getPage() != null) {
@@ -174,6 +180,7 @@
}
consoleConfiguration.executeHQLQuery( hql );
}
+ /**/
}
} else if (selection instanceof TreeSelection){
TreePath[] paths = ((TreeSelection)selection).getPaths();
16 years, 5 months
JBoss Tools SVN: r14959 - 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-29 10:25:19 -0400 (Wed, 29 Apr 2009)
New Revision: 14959
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-29 12:04:13 UTC (rev 14958)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-04-29 14:25:19 UTC (rev 14959)
@@ -72,8 +72,12 @@
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.seam.core.BijectedAttributeType;
+import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
+import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -325,9 +329,8 @@
renameJavaDeclaration(component.getJavaDeclaration());
Set<ISeamXmlComponentDeclaration> xmlDecls = component.getXmlDeclarations();
- Iterator<ISeamXmlComponentDeclaration> iter = xmlDecls.iterator();
- while(iter.hasNext()){
- ISeamXmlComponentDeclaration xmlDecl = iter.next();
+
+ for(ISeamXmlComponentDeclaration xmlDecl : xmlDecls){
if(xmlDecl != null)
renameXMLDeclaration(xmlDecl);
}
@@ -646,22 +649,61 @@
findELReferences();
-
return rootChange;
}
-// private void findAnnotations(){
-// Set<ISeamContextVariable> variables = seamProject.getVariablesByName(component.getName());
-//
-// Iterator<ISeamContextVariable> iter = variables.iterator();
-// while(iter.hasNext()){
-// ISeamContextVariable var = iter.next();
-// System.out.println("var - "+var.getClass());
-// if(var instanceof BijectedAttribute){
-// System.out.println("Bijected...");
-// }
-// }
-// }
+ private void findAnnotations(){
+ // find @In annotations
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(declarationFile.getProject(), true);
+
+ Set<IBijectedAttribute> inSet = seamProject.getBijectedAttributesByName(component.getName(), BijectedAttributeType.IN);
+
+ for(IBijectedAttribute inAtt : inSet){
+ System.out.println("@In - "+inAtt.getValue());
+
+ String content = null;
+ try {
+ content = FileUtil.readStream(((IFile)inAtt.getResource()).getContents());
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ return;
+ }
+
+ ISeamTextSourceReference location = inAtt.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ if(location != null){
+ String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
+ System.out.println("Text - "+text);
+ TextFileChange change = getChange((IFile)inAtt.getResource());
+ TextEdit edit = new ReplaceEdit(location.getStartPosition(), location.getLength(), "\""+newName+"\"");
+ change.addEdit(edit);
+ }
+ }
+
+ // find @Factory annotations
+
+ Set<ISeamFactory> factorySet = seamProject.getFactoriesByName(component.getName());
+
+ for(ISeamFactory factory : factorySet){
+ System.out.println("@Factory - "+factory.getName());
+
+ String content = null;
+ try {
+ content = FileUtil.readStream(((IFile)factory.getResource()).getContents());
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ return;
+ }
+
+ ISeamTextSourceReference location = factory.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ if(location != null){
+ String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
+ System.out.println("Text - "+text);
+ TextFileChange change = getChange((IFile)factory.getResource());
+ TextEdit edit = new ReplaceEdit(location.getStartPosition(), location.getLength(), "\""+newName+"\"");
+ change.addEdit(edit);
+ }
+ }
+ }
/*
* (non-Javadoc)
16 years, 5 months
JBoss Tools SVN: r14958 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-29 08:04:13 -0400 (Wed, 29 Apr 2009)
New Revision: 14958
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-04-29 11:02:26 UTC (rev 14957)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-04-29 12:04:13 UTC (rev 14958)
@@ -210,6 +210,15 @@
public Set<IBijectedAttribute> getBijectedAttributesByType(BijectedAttributeType type);
/**
+ * Utility method collecting all bijections of given name and type in java declarations.
+ * Parameters name and/or type can be set to null, then bijections with any
+ * name and/or type is returned.
+ * @param name
+ * @param type
+ * @return
+ */
+ public Set<IBijectedAttribute> getBijectedAttributesByName(String name, BijectedAttributeType type);
+ /**
* @return all factories methods of project
*/
public ISeamFactory[] getFactories();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-04-29 11:02:26 UTC (rev 14957)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-04-29 12:04:13 UTC (rev 14958)
@@ -1332,6 +1332,20 @@
return result;
}
+ public Set<IBijectedAttribute> getBijectedAttributesByName(String name, BijectedAttributeType type) {
+ Set<IBijectedAttribute> result = new HashSet<IBijectedAttribute>();
+ ISeamJavaComponentDeclaration[] ds = components.getJavaDeclarationsArray();
+ for (ISeamJavaComponentDeclaration d: ds) {
+ Set<IBijectedAttribute> as = d.getBijectedAttributes();
+ for (IBijectedAttribute a: as) {
+ if(name != null && !name.equals(a.getName())) continue;
+ if(type != null && !a.isOfType(type)) continue;
+ result.add(a);
+ }
+ }
+ return result;
+ }
+
/**
*
* @param v
16 years, 5 months
JBoss Tools SVN: r14957 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-29 07:02:26 -0400 (Wed, 29 Apr 2009)
New Revision: 14957
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-04-29 10:45:26 UTC (rev 14956)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-04-29 11:02:26 UTC (rev 14957)
@@ -197,6 +197,19 @@
public Set<ISeamContextVariable> getVariablesByPath(IPath path);
/**
+ * Utility method collecting all bijected attributes in java declarations.
+ * @return set of all bijections in Seam project.
+ */
+ public Set<IBijectedAttribute> getBijectedAttributes();
+
+ /**
+ * Utility method collecting all bijections of given type in java declarations.
+ * @param type
+ * @return set of all bijections of given type in Seam project.
+ */
+ public Set<IBijectedAttribute> getBijectedAttributesByType(BijectedAttributeType type);
+
+ /**
* @return all factories methods of project
*/
public ISeamFactory[] getFactories();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-04-29 10:45:26 UTC (rev 14956)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-04-29 11:02:26 UTC (rev 14957)
@@ -38,6 +38,8 @@
import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.seam.core.BijectedAttributeType;
+import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamContextVariable;
@@ -1310,6 +1312,26 @@
return result;
}
+ public Set<IBijectedAttribute> getBijectedAttributes() {
+ Set<IBijectedAttribute> result = new HashSet<IBijectedAttribute>();
+ ISeamJavaComponentDeclaration[] ds = components.getJavaDeclarationsArray();
+ for (ISeamJavaComponentDeclaration d: ds) {
+ Set<IBijectedAttribute> as = d.getBijectedAttributes();
+ if(as != null) result.addAll(as);
+ }
+ return result;
+ }
+
+ public Set<IBijectedAttribute> getBijectedAttributesByType(BijectedAttributeType type) {
+ Set<IBijectedAttribute> result = new HashSet<IBijectedAttribute>();
+ ISeamJavaComponentDeclaration[] ds = components.getJavaDeclarationsArray();
+ for (ISeamJavaComponentDeclaration d: ds) {
+ Set<IBijectedAttribute> as = d.getBijectedAttributesByType(type);
+ if(as != null) result.addAll(as);
+ }
+ return result;
+ }
+
/**
*
* @param v
16 years, 5 months
JBoss Tools SVN: r14956 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-29 06:45:26 -0400 (Wed, 29 Apr 2009)
New Revision: 14956
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4068
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2009-04-29 08:18:17 UTC (rev 14955)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2009-04-29 10:45:26 UTC (rev 14956)
@@ -15,13 +15,19 @@
import java.util.Properties;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.ui.JavaUI;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
@@ -111,4 +117,18 @@
}
+ public void open() {
+ if(javaSource == null) return;
+ if(!javaSource.exists()) {
+ ServiceDialog d = PreferenceModelUtilities.getPreferenceModel().getService();
+ d.showDialog("Warning", "Member " + javaSource.getElementName() + " does not exist.", new String[]{SpecialWizardSupport.OK}, null, ServiceDialog.WARNING);
+ return;
+ }
+ try {
+ JavaUI.openInEditor(javaSource);
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
}
16 years, 5 months
JBoss Tools SVN: r14955 - trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-04-29 04:18:17 -0400 (Wed, 29 Apr 2009)
New Revision: 14955
Modified:
trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferenceList.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3211, code adjustment.
Modified: trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferenceList.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferenceList.java 2009-04-29 07:58:47 UTC (rev 14954)
+++ trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferenceList.java 2009-04-29 08:18:17 UTC (rev 14955)
@@ -106,17 +106,6 @@
*/
String s = null;
/*
- * Old preferences format property value.
- */
- String old = null;
- try {
- old = resource.getPersistentProperty(getPropertyName());
- } catch (CoreException e) {
- /*
- * Ignore, there is no properties for this resource.
- */
- }
- /*
* https://jira.jboss.org/jira/browse/JBIDE-3211
* Storing project preferences to project scope in .settings
*/
@@ -135,6 +124,17 @@
}
}
if (s == null || s.length() == 0) {
+ /*
+ * Old preferences format property value.
+ */
+ String old = null;
+ try {
+ old = resource.getPersistentProperty(getPropertyName());
+ } catch (CoreException e) {
+ /*
+ * Ignore, there is no properties for this resource.
+ */
+ }
if (old == null || old.length() == 0) {
return new String[0];
} else {
@@ -262,18 +262,8 @@
* Property value
*/
String s = null;
+
/*
- * Old preferences format property value.
- */
- String old = null;
- try {
- old = ModelPlugin.getWorkspace().getRoot().getPersistentProperty(getPropertyName());
- } catch (CoreException e) {
- /*
- * Ignore, there is no properties for this resource.
- */
- }
- /*
* https://jira.jboss.org/jira/browse/JBIDE-3211 Reading project
* Reading global preferences from instance scope.
*/
@@ -289,8 +279,21 @@
*/
if (s != null && s.length() > 0) {
parseExternalResources(s);
- } else if (old != null && old.length() > 0) {
- parseExternalResources(old);
+ } else {
+ /*
+ * Old preferences format property value.
+ */
+ String old = null;
+ try {
+ old = ModelPlugin.getWorkspace().getRoot().getPersistentProperty(getPropertyName());
+ } catch (CoreException e) {
+ /*
+ * Ignore, there is no properties for this resource.
+ */
+ }
+ if (old != null && old.length() > 0) {
+ parseExternalResources(old);
+ }
}
}
return allExternalResources;
16 years, 5 months