JBoss Tools SVN: r7058 - trunk/common/plugins/org.jboss.tools.common.model/resources/help.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-21 06:11:30 -0400 (Fri, 21 Mar 2008)
New Revision: 7058
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
Log:
JBIDE-1931
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2008-03-21 10:11:24 UTC (rev 7057)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2008-03-21 10:11:30 UTC (rev 7058)
@@ -556,6 +556,8 @@
IMPORT_STRUTS_PROJECT_WIZARD_PROJECT_FOLDERS = Project Folders
IMPORT_STRUTS_PROJECT_SELECT_PROJECT_FOLDERS = Select Project Folders
+ADD_STRUTS_NATURE = Add Struts Capabilities
+
org.jboss.tools.jsf.ui.wizard.project.ImportJSFWarWizard.mainPageTitle=JSF project
org.jboss.tools.struts.ui.wizard.project.ImportStrutsWarWizard.mainPageTitle=Struts project
org.jboss.tools.jst.web.ui.wizards.project.ImportWebWarWizard.mainPagePrompt=Select *.war file
@@ -563,6 +565,7 @@
IMPORT_STRUTS_PROJECT_EARLIER_VERSION_WARNING=This project has been created in an earlier version of Struts Studio. Select Yes if you want import and convert this project to the current version. Once this project is converted you will not be able to open it in a previous version. Select No if you want to cancel project import and leave it as it is.
IMPORT_JSF_PROJECT_WIZARD_WINDOW_TITLE = Import JSF Project
+ADD_JSF_NATURE = Add JSF Capabilities
# step 1 content
WebPrjAdoptStepName_web.xml_location = web.xml Location
18 years
JBoss Tools SVN: r7057 - trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-21 06:11:24 -0400 (Fri, 21 Mar 2008)
New Revision: 7057
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java
Log:
JBIDE-1931
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java 2008-03-21 09:44:04 UTC (rev 7056)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java 2008-03-21 10:11:24 UTC (rev 7057)
@@ -11,6 +11,7 @@
package org.jboss.tools.struts.ui.internal.action;
import org.eclipse.core.resources.IProject;
+import org.jboss.tools.common.meta.key.WizardKeys;
import org.jboss.tools.common.model.ui.util.ExtensionPointUtils;
import org.eclipse.jface.wizard.IWizard;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
@@ -30,6 +31,7 @@
wizard.setInitialName(project.getName());
wizard.setInitialLocation(findWebXML(project.getLocation().toString()));
wizard.init(ModelUIPlugin.getDefault().getWorkbench(), null);
+ wizard.setWindowTitle(WizardKeys.getString("ADD_STRUTS_NATURE"));
return wizard;
}
18 years
JBoss Tools SVN: r7056 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-03-21 05:44:04 -0400 (Fri, 21 Mar 2008)
New Revision: 7056
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1559
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-03-21 09:24:26 UTC (rev 7055)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-03-21 09:44:04 UTC (rev 7056)
@@ -61,18 +61,20 @@
public void run() {
IStructuredSelection sel = getStructuredSelection();
- if (sel instanceof TreeSelection){
- TreePath path = ((TreeSelection)sel).getPaths()[0];
- ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
- try {
- run(path, consoleConfiguration);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
- } catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't open mapping file.", e);
- } catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
- }
+ if (sel instanceof TreeSelection){
+ for (int i = 0; i < ((TreeSelection)sel).getPaths().length; i++) {
+ TreePath path = ((TreeSelection)sel).getPaths()[i];
+ ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
+ try {
+ run(path, consoleConfiguration);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't open mapping file.", e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
+ }
+ }
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-03-21 09:24:26 UTC (rev 7055)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-03-21 09:44:04 UTC (rev 7056)
@@ -50,33 +50,35 @@
public void run() {
IStructuredSelection sel = getStructuredSelection();
if (sel instanceof TreeSelection){
- TreePath path = ((TreeSelection)sel).getPaths()[0];
- Object lastSegment = path.getLastSegment();
- PersistentClass persClass = getPersistentClass(lastSegment);
- ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
- IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
-
- String fullyQualifiedName = null;
- if (lastSegment instanceof Property){
- Object prevSegment = path.getParentPath().getLastSegment();
- if (prevSegment instanceof Property
- && ((Property)prevSegment).isComposite()){
- fullyQualifiedName =((Component)((Property) prevSegment).getValue()).getComponentClassName();
+ for (int i = 0; i < ((TreeSelection)sel).getPaths().length; i++) {
+ TreePath path = ((TreeSelection)sel).getPaths()[i];
+ Object lastSegment = path.getLastSegment();
+ PersistentClass persClass = getPersistentClass(lastSegment);
+ ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
+ IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
+
+ String fullyQualifiedName = null;
+ if (lastSegment instanceof Property){
+ Object prevSegment = path.getParentPath().getLastSegment();
+ if (prevSegment instanceof Property
+ && ((Property)prevSegment).isComposite()){
+ fullyQualifiedName =((Component)((Property) prevSegment).getValue()).getComponentClassName();
+ }
}
- }
- if (fullyQualifiedName == null && persClass != null){
- fullyQualifiedName = persClass.getClassName();
- }
+ if (fullyQualifiedName == null && persClass != null){
+ fullyQualifiedName = persClass.getClassName();
+ }
- try {
- run(lastSegment, proj, fullyQualifiedName);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
- } catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't open source file.", e);
- } catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
- }
+ try {
+ run(lastSegment, proj, fullyQualifiedName);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't open source file.", e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
+ }
+ }
}
}
18 years
JBoss Tools SVN: r7055 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-21 05:24:26 -0400 (Fri, 21 Mar 2008)
New Revision: 7055
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-1940
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-03-21 09:19:33 UTC (rev 7054)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-03-21 09:24:26 UTC (rev 7055)
@@ -831,31 +831,25 @@
Point pp = t.toControl(x, y);
x = pp.x;
y = pp.y;
- try {
- int lineIndex = (t.getTopPixel() + y) / t.getLineHeight();
- if (lineIndex >= t.getLineCount()) {
- return t.getCharCount();
- } else {
- int c = 0;
- try {
- c = t.getOffsetAtLocation(new Point(x, y));
- if (c < 0)
- c = 0;
- } catch (IllegalArgumentException ex) {
- //do not log, catching that exception is
- //the way to know that we are out of line.
- c = t.getOffsetAtLine(lineIndex + 1)
- - (t.getLineDelimiter() == null ? 0
- : t.getLineDelimiter().length());
- }
- return c;
+ int lineIndex = (t.getTopPixel() + y) / t.getLineHeight();
+ if (lineIndex >= t.getLineCount()) {
+ return t.getCharCount();
+ } else {
+ int c = 0;
+ try {
+ c = t.getOffsetAtLocation(new Point(x, y));
+ if (c < 0) c = 0;
+ } catch (IllegalArgumentException ex) {
+ //do not log, catching that exception is
+ //the way to know that we are out of line.
+ if (lineIndex + 1 >= t.getLineCount()) {
+ return t.getCharCount();
+ }
+ c = t.getOffsetAtLine(lineIndex + 1)
+ - (t.getLineDelimiter() == null
+ ? 0 : t.getLineDelimiter().length());
}
- } catch (IllegalArgumentException ex) {
- //do not log, now we know are out of input area.
- return 0;
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
- return 0;
+ return c;
}
}
18 years
JBoss Tools SVN: r7054 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-21 05:19:33 -0400 (Fri, 21 Mar 2008)
New Revision: 7054
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-1940
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-03-21 08:40:46 UTC (rev 7053)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-03-21 09:19:33 UTC (rev 7054)
@@ -317,36 +317,6 @@
return null;
}
- private int getPosition(StyledText t, int x, int y) {
- try {
- Point pp = t.toControl(x, y);
- x = pp.x;
- y = pp.y;
- int lineIndex = (t.getTopPixel() + y)
- / t.getLineHeight();
- if (lineIndex >= t.getLineCount()) {
- return t.getCharCount();
- } else {
- int c = 0;
- try {
- c = t.getOffsetAtLocation(new Point(x, y));
- if (c < 0)
- c = 0;
- } catch (Exception ex) {
- JspEditorPlugin.getPluginLog().logError(ex);
- c = t.getOffsetAtLine(lineIndex + 1)
- - (t.getLineDelimiter() == null ? 0
- : t.getLineDelimiter()
- .length());
- }
- return c;
- }
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
- return 0;
- }
- }
-
public void dragEnter(DropTargetEvent event) {
getFreeCaretControl(event.widget).enableFreeCaret(true);
}
@@ -852,12 +822,16 @@
}
private int getPosition(int x, int y) {
+ ISourceViewer v = getSourceViewer();
+ return v == null ? 0 : getPosition(v.getTextWidget(), x, y);
+ }
+
+ private int getPosition(StyledText t, int x, int y) {
+ if(t == null || t.isDisposed()) return 0;
+ Point pp = t.toControl(x, y);
+ x = pp.x;
+ y = pp.y;
try {
- ISourceViewer v = getSourceViewer();
- StyledText t = v.getTextWidget();
- Point pp = t.toControl(x, y);
- x = pp.x;
- y = pp.y;
int lineIndex = (t.getTopPixel() + y) / t.getLineHeight();
if (lineIndex >= t.getLineCount()) {
return t.getCharCount();
@@ -867,14 +841,18 @@
c = t.getOffsetAtLocation(new Point(x, y));
if (c < 0)
c = 0;
- } catch (Exception ex) {
- JspEditorPlugin.getPluginLog().logError(ex);
+ } catch (IllegalArgumentException ex) {
+ //do not log, catching that exception is
+ //the way to know that we are out of line.
c = t.getOffsetAtLine(lineIndex + 1)
- - (t.getLineDelimiter() == null ? 0 : t
- .getLineDelimiter().length());
+ - (t.getLineDelimiter() == null ? 0
+ : t.getLineDelimiter().length());
}
return c;
}
+ } catch (IllegalArgumentException ex) {
+ //do not log, now we know are out of input area.
+ return 0;
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError(e);
return 0;
18 years
JBoss Tools SVN: r7053 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-21 04:40:46 -0400 (Fri, 21 Mar 2008)
New Revision: 7053
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
Log:
Cannot set property to non-existent file.
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-03-21 03:21:52 UTC (rev 7052)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-03-21 08:40:46 UTC (rev 7053)
@@ -176,7 +176,7 @@
private void saveSelectedTab() {
IFile file = getFile();
- if(file == null) return;
+ if(file == null || !file.exists()) return;
String q = "" + selectedPageIndex;
try {
file.setPersistentProperty(persistentTabQualifiedName, q);
18 years
JBoss Tools SVN: r7052 - in trunk: labs and 19 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-03-20 23:21:52 -0400 (Thu, 20 Mar 2008)
New Revision: 7052
Added:
trunk/labs/
trunk/labs/docs/
trunk/labs/features/
trunk/labs/plugins/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.classpath
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.project
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.settings/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.settings/org.eclipse.jdt.core.prefs
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/META-INF/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/META-INF/MANIFEST.MF
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/Activator.class
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType$EclipseSourceContainer.class
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType$EclipseSourceContainerBrowser.class
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.class
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/build.properties
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/icons/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/icons/icon.gif
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/plugin.xml
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/Activator.java
trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.java
trunk/labs/tests/
Log:
quick little project to debug another running eclipse installation
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.classpath
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.classpath (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.classpath 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_14"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.project
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.project (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.project 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.labs.pde.sourceprovider</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/.settings/org.eclipse.jdt.core.prefs 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,12 @@
+#Thu Mar 20 20:52:28 EDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/META-INF/MANIFEST.MF
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/META-INF/MANIFEST.MF (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/META-INF/MANIFEST.MF 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse Sourceprovider Plug-in
+Bundle-SymbolicName: org.jboss.tools.labs.pde.sourceprovider;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.labs.pde.sourceprovider.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui
+Eclipse-LazyStart: true
+Bundle-Vendor: Rob Stryker
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/Activator.class
===================================================================
(Binary files differ)
Property changes on: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType$EclipseSourceContainer.class
===================================================================
(Binary files differ)
Property changes on: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType$EclipseSourceContainer.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType$EclipseSourceContainerBrowser.class
===================================================================
(Binary files differ)
Property changes on: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType$EclipseSourceContainerBrowser.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.class
===================================================================
(Binary files differ)
Property changes on: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/bin/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/build.properties
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/build.properties (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/build.properties 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = .
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/icons/icon.gif
===================================================================
(Binary files differ)
Property changes on: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/icons/icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/plugin.xml
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/plugin.xml (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/plugin.xml 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.core.sourceContainerTypes">
+ <sourceContainerType
+ class="org.jboss.tools.labs.pde.sourceprovider.EclipseSourceContainerType"
+ description="Includes all the available source in an eclipse installation"
+ id="org.jboss.tools.labs.pde.sourceprovider.eclipseSourceContainerType"
+ name="Eclipse Installation">
+ </sourceContainerType>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.sourceContainerPresentations">
+ <sourceContainerPresentation
+ browserClass="org.jboss.tools.labs.pde.sourceprovider.EclipseSourceContainerType$EclipseSourceContainerBrowser"
+ containerTypeID="org.jboss.tools.labs.pde.sourceprovider.eclipseSourceContainerType"
+ icon="icons/icon.gif"
+ id="org.jboss.tools.labs.pde.sourceprovider.eclipseSourceContainerPresentation">
+ </sourceContainerPresentation>
+ </extension>
+
+</plugin>
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/Activator.java
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/Activator.java (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/Activator.java 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,50 @@
+package org.jboss.tools.labs.pde.sourceprovider;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.labs.pde.sourceprovider";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.java
===================================================================
--- trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.java (rev 0)
+++ trunk/labs/plugins/org.jboss.tools.labs.pde.sourceprovider/src/org/jboss/tools/labs/pde/sourceprovider/EclipseSourceContainerType.java 2008-03-21 03:21:52 UTC (rev 7052)
@@ -0,0 +1,118 @@
+package org.jboss.tools.labs.pde.sourceprovider;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
+import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainer;
+import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate;
+import org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer;
+import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class EclipseSourceContainerType extends AbstractSourceContainerTypeDelegate {
+
+ public ISourceContainer createSourceContainer(String memento)
+ throws CoreException {
+ Node node = parseDocument(memento );
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Element element = (Element)node;
+ if ("eclipseHome".equals(element.getNodeName())) { //$NON-NLS-1$
+ String string = element.getAttribute("path"); //$NON-NLS-1$
+ if (string == null || string.length() == 0) {
+ abort("Eclipse Home Not Found", null);
+ }
+ return new EclipseSourceContainer(new File(string));
+ }
+ abort("Error unserializing memento", null);
+ }
+ abort("Error unserializing memento", null);
+ return null;
+ }
+
+ public String getMemento(ISourceContainer container2) throws CoreException {
+ EclipseSourceContainer container = (EclipseSourceContainer) container2;
+ Document document = newDocument();
+ Element element = document.createElement("eclipseHome"); //$NON-NLS-1$
+ element.setAttribute("path", container.getFile().getAbsolutePath().toString()); //$NON-NLS-1$
+ document.appendChild(element);
+ return serializeDocument(document);
+ }
+
+ public static class EclipseSourceContainer extends AbstractSourceContainer {
+ public static final String TYPE_ID = "org.jboss.ide.eclipse.labs.pde.sourceprovider.eclipseSourceContainerType";
+ protected File root;
+ protected HashMap<String,ExternalArchiveSourceContainer> pathToContainer;
+ public EclipseSourceContainer(File f) {
+ this.root = f;
+ pathToContainer = new HashMap<String,ExternalArchiveSourceContainer>();
+ search(root);
+ }
+
+ protected void search(File f) {
+ // recursively seek src.zip
+ File[] kids = f.listFiles();
+ for( int i = 0; i < kids.length; i++ ) {
+ if( kids[i].isDirectory()) {
+ search(kids[i]);
+ } else if( kids[i].getName().endsWith("src.zip")) {
+ // add the match
+ pathToContainer.put(kids[i].toString(), new ExternalArchiveSourceContainer(kids[i].getAbsolutePath(), true));
+ }
+ }
+ }
+
+ public Object[] findSourceElements(String name) throws CoreException {
+ Iterator<ExternalArchiveSourceContainer> i = pathToContainer.values().iterator();
+ ExternalArchiveSourceContainer c;
+ Object[] results;
+ while(i.hasNext()) {
+ c = i.next();
+ results = c.findSourceElements(name);
+ if( results.length > 0 )
+ return results;
+ }
+ return new Object[0];
+ }
+
+ public String getName() {
+ return "Eclipse Installation " + root.getAbsolutePath().toString();
+ }
+
+ public ISourceContainerType getType() {
+ return getSourceContainerType(TYPE_ID);
+ }
+
+ public File getFile() {
+ return root;
+ }
+ }
+
+ public static class EclipseSourceContainerBrowser extends AbstractSourceContainerBrowser {
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#addSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
+ */
+ public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
+ DirectoryDialog d = new DirectoryDialog(shell, SWT.OPEN);
+ String s = d.open();
+ if( s != null ) {
+ IPath p = new Path(s);
+ if( p.append("plugins").toFile().exists()) {
+ return new ISourceContainer[] {new EclipseSourceContainer(p.toFile())};
+ }
+ }
+ return new ISourceContainer[0];
+ }
+ }
+}
18 years
JBoss Tools SVN: r7051 - trunk/tests/features/org.jboss.ide.eclipse.test.feature.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-03-20 19:17:46 -0400 (Thu, 20 Mar 2008)
New Revision: 7051
Modified:
trunk/tests/features/org.jboss.ide.eclipse.test.feature/feature.xml
Log:
added archives to tests
Modified: trunk/tests/features/org.jboss.ide.eclipse.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.ide.eclipse.test.feature/feature.xml 2008-03-20 17:56:28 UTC (rev 7050)
+++ trunk/tests/features/org.jboss.ide.eclipse.test.feature/feature.xml 2008-03-20 23:17:46 UTC (rev 7051)
@@ -423,4 +423,10 @@
install-size="0"
version="1.0.0"/>
+ <plugin
+ id="org.jboss.ide.eclipse.archives.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
18 years
JBoss Tools SVN: r7050 - 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-03-20 13:56:28 -0400 (Thu, 20 Mar 2008)
New Revision: 7050
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/refactoring/SeamRenameFolderParticipant.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1919
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-03-20 17:52:21 UTC (rev 7049)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-03-20 17:56:28 UTC (rev 7050)
@@ -306,8 +306,8 @@
</renameParticipant>
<renameParticipant
class="org.jboss.tools.seam.internal.core.refactoring.SeamRenameFolderParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameSourceFolderParticipant"
- name="seam-RenameSourceFolderParticipant">
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameFolderParticipant"
+ name="seam-RenameFolderParticipant">
<enablement>
<with variable="element">
<or>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java 2008-03-20 17:52:21 UTC (rev 7049)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java 2008-03-20 17:56:28 UTC (rev 7050)
@@ -29,7 +29,7 @@
* @author Alexey Kazakov
*/
public class SeamRenameFolderParticipant extends RenameParticipant {
- public static final String PARTICIPANT_NAME="seam-RenameSourceFolderParticipant";
+ public static final String PARTICIPANT_NAME="seam-RenameFolderParticipant";
private IPath oldPath;
18 years
JBoss Tools SVN: r7049 - 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-03-20 13:52:21 -0400 (Thu, 20 Mar 2008)
New Revision: 7049
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java
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/refactoring/SeamRenameProjectChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1919 Added folder renaming.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-03-20 17:48:43 UTC (rev 7048)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-03-20 17:52:21 UTC (rev 7049)
@@ -304,7 +304,19 @@
</with>
</enablement>
</renameParticipant>
+ <renameParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamRenameFolderParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameSourceFolderParticipant"
+ name="seam-RenameSourceFolderParticipant">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.core.resources.IFolder"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
</extension>
-</plugin>
+</plugin>
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectChange.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectChange.java 2008-03-20 17:52:21 UTC (rev 7049)
@@ -0,0 +1,97 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+
+/**
+ * @author Alexey Kazakov
+ */
+public abstract class SeamProjectChange extends Change {
+
+ protected IProject project;
+
+ protected static String[] PROJECT_NAME_PROPERTIES = {
+ ISeamFacetDataModelProperties.SEAM_PARENT_PROJECT,
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT
+ };
+
+ protected static String[] FOLDER_PROPERTIES = {
+ ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER,
+ ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER,
+ ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER,
+ ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER
+ };
+
+ /**
+ * @param project Project that we are asked to check and update.
+ */
+ public SeamProjectChange(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ * @return false if we is not going to update this project
+ */
+ abstract public boolean isRelevant();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
+ */
+ @Override
+ public Object getModifiedElement() {
+ return project;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getName()
+ */
+ @Override
+ public String getName() {
+ return "Update Seam Project Properties for " + project.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initializeValidationData(IProgressMonitor pm) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ /**
+ * @return preferences of project
+ */
+ protected IEclipsePreferences getSeamPreferences() {
+ IScopeContext projectScope = new ProjectScope(project);
+ return projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
+ }
+}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java 2008-03-20 17:52:21 UTC (rev 7049)
@@ -0,0 +1,96 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamRenameFolderChange extends SeamProjectChange {
+
+ private IPath oldPath;
+ private IPath newPath;
+
+ private List<String> relevantProperties = new ArrayList<String>();
+
+ public SeamRenameFolderChange(IProject project, String newName, IPath oldPath) {
+ super(project);
+ this.oldPath = oldPath;
+ this.newPath = oldPath.removeLastSegments(1).append(newName);
+
+ IEclipsePreferences ps = getSeamPreferences();
+ for (int i = 0; i < FOLDER_PROPERTIES.length; i++) {
+ String propertyValue = ps.get(FOLDER_PROPERTIES[i], null);
+ if(propertyValue==null) {
+ continue;
+ }
+ String oldPathString = oldPath.toString();
+ if(propertyValue.equals(oldPathString) ||
+ propertyValue.startsWith(oldPathString + "/")) {
+ relevantProperties.add(FOLDER_PROPERTIES[i]);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
+ */
+ @Override
+ public boolean isRelevant() {
+ return relevantProperties.size()>0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ if(!isRelevant()) {
+ return null;
+ }
+ try {
+ pm.beginTask(getName(), 1);
+
+ IEclipsePreferences ps = getSeamPreferences();
+ for (String propertyName: relevantProperties) {
+ String propertyValue = ps.get(propertyName, "");
+ String oldPathString = oldPath.toString();
+ if(propertyValue.equals(oldPathString)) {
+ ps.put(propertyName, newPath.toString());
+ } else if(propertyValue.startsWith(oldPathString + "/")) {
+ String newPathString = newPath.toString() + propertyValue.substring(oldPathString.length());
+ ps.put(propertyName, newPathString);
+ }
+ }
+
+ try {
+ ps.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return new SeamRenameFolderChange(project, oldPath.lastSegment(), newPath);
+ } finally {
+ pm.done();
+ }
+ }
+}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java 2008-03-20 17:52:21 UTC (rev 7049)
@@ -0,0 +1,78 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+
+/**
+ * Updates seam settings of seam projects if somebody renames source folder.
+ * @author Alexey Kazakov
+ */
+public class SeamRenameFolderParticipant extends RenameParticipant {
+ public static final String PARTICIPANT_NAME="seam-RenameSourceFolderParticipant";
+
+ private IPath oldPath;
+
+ public SeamRenameFolderParticipant() {
+ }
+
+ @Override
+ public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
+ return null;
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ if (!pm.isCanceled()) {
+ String newName = getArguments().getNewName();
+ if(newName == null || newName.trim().length() == 0) {
+ return null;
+ }
+ CompositeChange change = new CompositeChange("Update Seam Projects");
+ IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (int i = 0; i < ps.length; i++) {
+ SeamRenameFolderChange c = new SeamRenameFolderChange(ps[i], newName, oldPath);
+ if(c.isRelevant()) change.add(c);
+ }
+ if(change.getChildren().length > 0) {
+ return change;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ @Override
+ protected boolean initialize(Object element) {
+ if(!(element instanceof IFolder)) {
+ return false;
+ }
+ oldPath = ((IResource)element).getFullPath();
+
+ return true;
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java 2008-03-20 17:48:43 UTC (rev 7048)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java 2008-03-20 17:52:21 UTC (rev 7049)
@@ -15,46 +15,32 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.osgi.service.prefs.BackingStoreException;
/**
* @author Viacheslav Kabanovich
*/
-public class SeamRenameProjectChange extends Change {
- IProject project;
- String newName;
- String oldName;
+public class SeamRenameProjectChange extends SeamProjectChange {
- static String[] PROJECT_NAME_PROPERTIES = {
- ISeamFacetDataModelProperties.SEAM_PARENT_PROJECT,
- ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
- ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
- ISeamFacetDataModelProperties.SEAM_TEST_PROJECT
- };
+ protected String newName;
+ protected String oldName;
- static String[] SOURCE_FOLDER_PROPERTIES = {
- ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER,
- ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER,
- ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER,
- ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER
- };
+ private List<String> relevantProjectNameProperties = new ArrayList<String>();
+ private List<String> relevantSourceFolderProperties = new ArrayList<String>();
- List<String> relevantProjectNameProperties = new ArrayList<String>();
- List<String> relevantSourceFolderProperties = new ArrayList<String>();
-
+ /**
+ * @param project
+ * @param newName
+ * @param oldName
+ */
public SeamRenameProjectChange(IProject project, String newName, String oldName) {
- this.project = project;
+ super(project);
this.newName = newName;
this.oldName = oldName;
IEclipsePreferences ps = getSeamPreferences();
@@ -63,37 +49,27 @@
relevantProjectNameProperties.add(PROJECT_NAME_PROPERTIES[i]);
}
}
- for (int i = 0; i < SOURCE_FOLDER_PROPERTIES.length; i++) {
- if(ps.get(SOURCE_FOLDER_PROPERTIES[i], "").startsWith("/" + oldName + "/")) {
- relevantSourceFolderProperties.add(SOURCE_FOLDER_PROPERTIES[i]);
+ for (int i = 0; i < FOLDER_PROPERTIES.length; i++) {
+ if(ps.get(FOLDER_PROPERTIES[i], "").startsWith("/" + oldName + "/")) {
+ relevantSourceFolderProperties.add(FOLDER_PROPERTIES[i]);
}
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
+ */
+ @Override
public boolean isRelevant() {
return relevantProjectNameProperties.size() > 0 || relevantSourceFolderProperties.size() > 0;
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
+ */
@Override
- public Object getModifiedElement() {
- return project;
- }
-
- @Override
- public String getName() {
- return "Update Seam Project Properties for " + project.getName();
- }
-
- @Override
- public void initializeValidationData(IProgressMonitor pm) {
- }
-
- @Override
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- return new RefactoringStatus();
- }
-
- @Override
public Change perform(IProgressMonitor pm) throws CoreException {
if(!isRelevant()) return null;
try {
@@ -129,9 +105,4 @@
pm.done();
}
}
-
- public IEclipsePreferences getSeamPreferences() {
- IScopeContext projectScope = new ProjectScope(project);
- return projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
- }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java 2008-03-20 17:48:43 UTC (rev 7048)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java 2008-03-20 17:52:21 UTC (rev 7049)
@@ -53,6 +53,9 @@
return null;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getName()
+ */
@Override
public String getName() {
return PARTICIPANT_NAME;
18 years