JBoss Tools SVN: r13582 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-02-11 11:11:54 -0500 (Wed, 11 Feb 2009)
New Revision: 13582
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-883
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java 2009-02-11 13:38:39 UTC (rev 13581)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java 2009-02-11 16:11:54 UTC (rev 13582)
@@ -1,32 +0,0 @@
-package org.jboss.tools.vpe.xulrunner.browser;
-
-import org.mozilla.interfaces.nsISupports;
-import org.mozilla.interfaces.nsIURI;
-import org.mozilla.interfaces.nsIWebBrowserChrome;
-import org.mozilla.interfaces.nsIWindowCreator;
-import org.mozilla.interfaces.nsIWindowCreator2;
-import org.mozilla.xpcom.Mozilla;
-
-public class WindowCreator implements nsIWindowCreator, nsIWindowCreator2 {
-
- public nsIWebBrowserChrome createChromeWindow(nsIWebBrowserChrome arg0,
- long arg1) {
- // TODO Sergey Vasilyev implement
- System.out.println("WindowCreator:createChromeWindow(" + arg0 +", " + arg1 + ")");
- return arg0;
- }
-
- public nsISupports queryInterface(String arg0) {
- // TODO Auto-generated method stub
- return Mozilla.queryInterface(this, arg0);
- }
-
- public nsIWebBrowserChrome createChromeWindow2(nsIWebBrowserChrome arg0,
- long arg1, long arg2, nsIURI arg3, boolean[] arg4) {
- // TODO Sergey Vasilyev implement
- System.out.println("WindowCreator:createChromeWindow2(" + arg0 +", "
- + arg1 + ", "+ arg2 + ", "+ (arg3 == null ? "null" : arg3.getSpec()) +")");
- return arg0;
- }
-
-}
15 years, 2 months
JBoss Tools SVN: r13581 - in trunk/jsf: tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-02-11 08:38:39 -0500 (Wed, 11 Feb 2009)
New Revision: 13581
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml
Log:
RESOLVED - issue JBIDE-3777: Incorrect position of rich:dataScroller
https://jira.jboss.org/jira/browse/JBIDE-3777
- Support of the attribute 'align' has been added
- JUnit test has been modified
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2009-02-11 11:04:02 UTC (rev 13580)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2009-02-11 13:38:39 UTC (rev 13581)
@@ -125,7 +125,12 @@
*/
creationData.addChildrenInfo(new VpeChildrenInfo(div));
- div.setAttribute(HTML.ATTR_ALIGN, HTML.VALUE_ALIGN_CENTER);
+ String align = sourceElement.getAttribute(RichFaces.ATTR_ALIGN);
+ if (align == null) {
+ align = HTML.VALUE_ALIGN_CENTER;
+ }
+ div.setAttribute(HTML.ATTR_ALIGN, align);
+
div.setAttribute(HTML.ATTR_CLASS, styleClass);
if (ComponentUtil.isNotBlank(style)) {
div.setAttribute(HTML.ATTR_STYLE, style);
@@ -138,7 +143,6 @@
table.appendChild(tbody);
div.appendChild(table);
- table.setAttribute(HTML.ATTR_ALIGN, HTML.VALUE_ALIGN_CENTER);
table.setAttribute(HTML.ATTR_CLASS, tableStyleClass);
if (ComponentUtil.isNotBlank(tableStyle)) {
table.setAttribute(HTML.ATTR_STYLE, tableStyle);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml 2009-02-11 11:04:02 UTC (rev 13580)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml 2009-02-11 13:38:39 UTC (rev 13581)
@@ -11,7 +11,7 @@
<body>
<h:form>
<h1>datascroller</h1>
- <rich:datascroller id="datascroller" for="dataTable" align="top" >
+ <rich:datascroller id="datascroller" for="dataTable" align="right" >
</rich:datascroller>
<rich:dataTable cellpadding="0" cellspacing="0" width="700" border="0"
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml 2009-02-11 11:04:02 UTC (rev 13580)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml 2009-02-11 13:38:39 UTC (rev 13581)
@@ -1,7 +1,7 @@
<tests>
<test id="datascroller">
- <DIV ALIGN="center" CLASS="rich-datascr">
- <TABLE CELLSPACING="1" CELLPADDING="0" BORDER="0" ALIGN="center"
+ <DIV ALIGN="right" CLASS="rich-datascr">
+ <TABLE CELLSPACING="1" CELLPADDING="0" BORDER="0"
CLASS="rich-dtascroller-table">
<TBODY>
<TR>
15 years, 2 months
JBoss Tools SVN: r13580 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-02-11 06:04:02 -0500 (Wed, 11 Feb 2009)
New Revision: 13580
Modified:
trunk/seam/docs/reference/en/modules/directory_structure.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-554 - adding the "Changing Seam Parent Project" section;
Modified: trunk/seam/docs/reference/en/modules/directory_structure.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/directory_structure.xml 2009-02-11 10:58:43 UTC (rev 13579)
+++ trunk/seam/docs/reference/en/modules/directory_structure.xml 2009-02-11 11:04:02 UTC (rev 13580)
@@ -85,6 +85,7 @@
</section>
<section id="seam_version_changing">
+
<title>Changing the Seam Version</title>
<para>To upgrade or downgrade your projects Seam version use the facet preferences. You
@@ -137,12 +138,39 @@
<note>
<title>Note:</title>
- <para>The note "Seam configuration files and their XSDs won't be changed" is meant that
- the libraries, Seam facet and runtime version will be changed, but configuration files that refer to
- the old version will have to be manually updated.</para>
+ <para>The note "Seam configuration files and their XSDs won't be changed" is
+ meant that the libraries, Seam facet and runtime version will be changed, but
+ configuration files that refer to the old version will have to be manually
+ updated.</para>
</note>
</section>
+ <section id="changing_seam_parent_project">
+ <title>Changing Seam Parent Project</title>
+
+ <para>Starting from the 2.0.0.CR2 version of <property>JBoss Tools</property> it is possible
+ to change the Seam parent project. In earlier versions this was only controllable at a
+ project creation time, now it can be changed for existing projects too.</para>
+
+ <para>Go to your project preferences and select <emphasis>
+ <property>Seam Settings</property>
+ </emphasis> category on the left. Press the <emphasis>
+ <property>Browse</property>
+ </emphasis> button next to the <emphasis>
+ <property>Main Seam Project</property>
+ </emphasis> section to select the other Seam parent project.</para>
+
+ <figure>
+ <title>Changing Seam Parent Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/directory_structure/directory_structure_6.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
<section id="renaming_projects_folders">
<title>Renaming the Projects and Folders</title>
15 years, 2 months
JBoss Tools SVN: r13579 - trunk/seam/docs/reference/en/images/directory_structure.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-02-11 05:58:43 -0500 (Wed, 11 Feb 2009)
New Revision: 13579
Added:
trunk/seam/docs/reference/en/images/directory_structure/directory_structure_6.png
Log:
https://jira.jboss.org/jira/browse/JBDS-554 - adding a screen;
Added: trunk/seam/docs/reference/en/images/directory_structure/directory_structure_6.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/directory_structure/directory_structure_6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 2 months
JBoss Tools SVN: r13578 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog: tabs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-02-11 04:54:55 -0500 (Wed, 11 Feb 2009)
New Revision: 13578
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3726
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-02-11 09:44:49 UTC (rev 13577)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-02-11 09:54:55 UTC (rev 13578)
@@ -20,17 +20,25 @@
import java.util.Set;
import java.util.Map.Entry;
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.IFileBuffer;
+import org.eclipse.core.filebuffers.LocationKind;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
+import org.eclipse.wst.css.core.internal.text.StructuredTextPartitionerForCSS;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
import org.w3c.dom.css.CSSRuleList;
@@ -54,9 +62,9 @@
private CSSStyleSheet styleSheet = null;
private ICSSStyleSheet eclipseStyleSheet = null;
+ private String COPY_SUFFIX = "_copy";
-
/**
* Constructor.
*
@@ -76,9 +84,30 @@
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getExistingModelForEdit(styleFile);
+
if (model == null)
model = modelManager.getModelForEdit(styleFile);
- if (model instanceof ICSSModel) {
+ else {
+
+ // copy the model
+ model = modelManager.copyModelForEdit(model.getId(), model
+ .getId()
+ + COPY_SUFFIX);
+
+ // set the correct location
+ model.setBaseLocation(styleFile.getLocation().toString());
+
+ // some steps to prepare document ( it is necessary to correct
+ // work of highlight in preview tab )
+ IDocumentPartitioner partitioner = new StructuredTextPartitionerForCSS();
+ ((IDocumentExtension3) model.getStructuredDocument())
+ .setDocumentPartitioner(
+ IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
+ partitioner);
+ partitioner.connect(model.getStructuredDocument());
+
+ }
+ if (model instanceof ICSSModel) {
ICSSModel cssModel = (ICSSModel) model;
ICSSDocument document = cssModel.getDocument();
if (document instanceof CSSStyleSheet) {
@@ -94,7 +123,9 @@
JspEditorPlugin.getPluginLog().logError(e.getMessage());
} catch (CoreException e) {
JspEditorPlugin.getPluginLog().logError(e.getMessage());
- }
+ } catch (ResourceInUse e) {
+ JspEditorPlugin.getPluginLog().logError(e.getMessage());
+ }
}
/**
@@ -301,8 +332,8 @@
*/
public void releaseModel() {
IModelManager modelManager = StructuredModelManager.getModelManager();
- if(!modelManager.isShared(model.getId()))
- model.releaseFromEdit();
+ if (!modelManager.isShared(model.getId()))
+ model.releaseFromEdit();
}
/**
@@ -310,7 +341,15 @@
*/
public void saveModel() {
try {
- model.save();
+
+ // it is necessary not to dialog appears when "dirty" css file is
+ // being saved
+ IFileBuffer buffer = FileBuffers.getTextFileBufferManager()
+ .getFileBuffer(styleFile.getFullPath(),
+ LocationKind.NORMALIZE);
+ buffer.setDirty(false);
+
+ model.save();
} catch (IOException e) {
JspEditorPlugin.getPluginLog().logError(e.getMessage());
} catch (CoreException e) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-02-11 09:44:49 UTC (rev 13577)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-02-11 09:54:55 UTC (rev 13578)
@@ -11,9 +11,7 @@
package org.jboss.tools.jst.jsp.outline.cssdialog.tabs;
import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
@@ -23,10 +21,8 @@
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
@@ -39,12 +35,6 @@
/** Editor in which we open visual page. */
protected final static String EDITOR_ID = "org.eclipse.wst.css.core.csssource.source"; //$NON-NLS-1$
-
- /**
- * TODO remove the field
- * @deprecated
- */
- private StructuredTextEditor editor = null;
SourceViewer viewer = null;
private CSSModel cssModel = null;
@@ -67,71 +57,32 @@
* @param cssFile CSS file to be displayed in preview area
*/
public void initPreview(CSSModel cssModel) {
- this.cssModel = cssModel;
- if (cssModel != null) {
- IEditorInput input = new FileEditorInput(cssModel.getStyleFile());
-// try {
-// WorkbenchWindow workbenchWindow = (WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-// EditorAreaHelper editorPresentation = new EditorAreaHelper((WorkbenchPage) workbenchWindow.getActivePage());
-// EditorManager editorManager = new EditorManager(workbenchWindow, (WorkbenchPage) workbenchWindow.getActivePage(), editorPresentation);
+ this.cssModel = cssModel;
+ if (cssModel != null) {
+ IEditorInput input = new FileEditorInput(cssModel.getStyleFile());
+ for (Control control : getChildren()) {
+ control.dispose();
+ }
-// IEditorReference ref = editorManager.openEditor(EDITOR_ID, input, true, null);
-// if (ref != null) {
- // all preview tab editors should be disposed before adding new editor compoment
- for (Control control : getChildren()) {
- control.dispose();
- }
-// if (editor != null) {
-// editor.doRevertToSaved();
-// editor.close(false);
-// }
-// editor = (StructuredTextEditor)ref.getEditor(true);
-// editor.createPartControl(this);
-// editor.getTextViewer().setEditable(false);
-
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationCSS();
+ StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationCSS();
- public String[] getConfiguredContentTypes(
- ISourceViewer sourceViewer) {
- return baseConfiguration
- .getConfiguredContentTypes(sourceViewer);
- }
-
- public LineStyleProvider[] getLineStyleProviders(
- ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(
- sourceViewer, partitionType);
- }
- };
- viewer = new StructuredTextViewer(this, null, null,
- false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ viewer = new StructuredTextViewer(this, null, null, false,
+ SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
((StructuredTextViewer) viewer).getTextWidget().setFont(
JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
-
- // IStructuredModel scratchModel =
- // StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForCSS.ContentTypeID_CSS);
- // IDocument document = scratchModel.getStructuredDocument();
- viewer.configure(sourceViewerConfiguration);
+
+ viewer.configure(baseConfiguration);
viewer.setDocument(cssModel.getStructuredDocument());
viewer.setEditable(false);
-// }
- layout();
-// } catch (PartInitException e) {
-// e.printStackTrace();
-// }
- }
- }
+ layout();
+ }
+ }
public void doRevertToSaved() {
cssModel.reload();
-// if (editor != null) {
-// editor.doRevertToSaved();
-// }
-
}
/**
@@ -169,14 +120,11 @@
* @param save true if close editor with closure operation; false - otherwise
*/
public void closeEditor(boolean save) {
-// if (editor != null) {
-// editor.doRevertToSaved();
-// editor.close(save);
-// editor = null;
-// }
- if(!save)
- doRevertToSaved();
+ // TODO if copy of model is used then reverting will not be required
+ if (!save)
+ doRevertToSaved();
+
if (cssModel != null) {
cssModel.releaseModel();
}
15 years, 2 months
JBoss Tools SVN: r13577 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-02-11 04:44:49 -0500 (Wed, 11 Feb 2009)
New Revision: 13577
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-3770 - classpath issues
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-02-11 00:15:46 UTC (rev 13576)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-02-11 09:44:49 UTC (rev 13577)
@@ -22,11 +22,14 @@
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
@@ -40,8 +43,10 @@
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.StandardClasspathProvider;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
@@ -51,13 +56,12 @@
public class JBossServerStartupLaunchConfiguration extends AbstractJBossLaunchConfigType {
- protected static final char[] INVALID_CHARS = new char[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
- private static final String LAUNCH_TYPE = "org.jboss.ide.eclipse.as.core.server.startupConfiguration";
- private static final String DEFAULTS_SET = "jboss.defaults.been.set";
- private static final String START_JAR_LOC = "bin" + Path.SEPARATOR + "run.jar";
- private static final String START_MAIN_TYPE = "org.jboss.Main";
+ static final char[] INVALID_CHARS = new char[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
+ static final String LAUNCH_TYPE = "org.jboss.ide.eclipse.as.core.server.startupConfiguration";
+ static final String DEFAULTS_SET = "jboss.defaults.been.set";
+ static final String START_JAR_LOC = "bin" + Path.SEPARATOR + "run.jar";
+ static final String START_MAIN_TYPE = "org.jboss.Main";
-
public static ILaunchConfigurationWorkingCopy setupLaunchConfiguration(IServer server, String action) throws CoreException {
ILaunchConfigurationWorkingCopy config = createLaunchConfiguration(server);
setupLaunchConfiguration(config, server);
@@ -75,8 +79,9 @@
if( jbs == null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Server " + server.getName() + " is not a proper JBoss Server"));
- if( workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String)null) != null ) {
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String)null);
+ String cpProvider = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String)null);
+ if( !DEFAULT_CP_PROVIDER_ID.equals(cpProvider)) {
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, DEFAULT_CP_PROVIDER_ID);
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
}
@@ -103,12 +108,14 @@
if( jbrt == null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Runtime not found"));
+ /* Args and vm args */
+
String args = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
String vmArgs = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
- String h = jbs.getServer().getHost();
- String h2 = ArgsUtil.getValue(args, "-b", "--host");
- if( !jbs.getServer().getHost().equals(ArgsUtil.getValue(args, "-b", "--host")))
- args = ArgsUtil.setArg(args, "-b", "--host", jbs.getServer().getHost());
+ String host = jbs.getServer().getHost();
+ String host2 = ArgsUtil.getValue(args, "-b", "--host");
+ if( !host.equals(host2))
+ args = ArgsUtil.setArg(args, "-b", "--host", host);
IJBossServerRuntime runtime = (IJBossServerRuntime)
jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
@@ -122,15 +129,33 @@
vmArgs = ArgsUtil.setArg(vmArgs, null, "-Djava.library.path",
"\"" + runtime.getRuntime().getLocation().append("bin").append("native") + "\"", false);
+ /* Claspath */
+ List<String> cp = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, (List<String>)null);
+ List<String> newCP = fixCP(cp, jbs);
-
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR + "bin");
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, args);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, newCP);
+ wc.setAttribute(SERVER_ID,jbs.getServer().getId());
+
}
- public static void forceDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer server) throws CoreException {
+ protected static List<String> fixCP(List<String> list, JBossServer jbs) {
+ try {
+ String[] asString = (String[]) list.toArray(new String[list.size()]);
+ for( int i = 0; i < asString.length; i++ ) {
+ if( asString[i].contains(RunJarContainerWrapper.ID)) {
+ asString[i] = getRunJarRuntimeCPEntry(jbs).getMemento();
+ }
+ }
+ return Arrays.asList(asString);
+ } catch( CoreException ce) {
+ return list;
+ }
+ }
+
+ protected static void forceDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer server) throws CoreException {
JBossServer jbs = findJBossServer(server.getId());
if( jbs == null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Server " + server.getName() + " is not a proper JBoss Server"));
@@ -160,15 +185,16 @@
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jrePath);
wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, jbrt.getDefaultRunEnvVars());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, DEFAULT_CP_PROVIDER_ID);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
-
+
wc.setAttribute(DEFAULTS_SET, true);
}
- public static ArrayList<String> getClasspath(JBossServer jbs) throws CoreException {
+ protected static ArrayList<String> getClasspath(JBossServer jbs) throws CoreException {
IJBossServerRuntime jbrt = findJBossServerRuntime(jbs.getServer());
ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
- addCPEntry(classpath, jbs, START_JAR_LOC);
+ classpath.add(getRunJarRuntimeCPEntry(jbs));
addJREEntry(classpath, jbrt.getVM());
String version = jbs.getServer().getRuntime().getRuntimeType().getVersion();
@@ -180,7 +206,12 @@
}
- public static String getDefaultArgs(JBossServer jbs) throws CoreException {
+ protected static IRuntimeClasspathEntry getRunJarRuntimeCPEntry(JBossServer jbs) throws CoreException {
+ IPath containerPath = new Path(RunJarContainerWrapper.ID).append(jbs.getServer().getName());
+ return JavaRuntime.newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.USER_CLASSES);
+ }
+
+ protected static String getDefaultArgs(JBossServer jbs) throws CoreException {
IJBossServerRuntime rt = findJBossServerRuntime(jbs.getServer());
if (rt != null) {
return rt.getDefaultRunArgs() + " -b " + jbs.getServer().getHost();
@@ -264,4 +295,36 @@
wc.setAttribute(SERVER_ID, server.getId());
return wc;
}
+
+ /* For "restore defaults" functionality */
+ private static final String DEFAULT_CP_PROVIDER_ID = "org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider";
+ public static class JBossServerDefaultClasspathProvider extends StandardClasspathProvider {
+ public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
+ boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
+ if (useDefault) {
+ return defaultEntries(configuration);
+ }
+ return super.computeUnresolvedClasspath(configuration);
+ }
+
+ protected IRuntimeClasspathEntry[] defaultEntries(ILaunchConfiguration config) {
+ try {
+ String server = config.getAttribute(SERVER_ID, (String)null);
+ IServer s = ServerCore.findServer(server);
+ IJBossServerRuntime ibjsrt = (IJBossServerRuntime)s.getRuntime().loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ JBossServer jbs = (JBossServer)s.loadAdapter(JBossServer.class, new NullProgressMonitor());
+ IVMInstall install = ibjsrt.getVM();
+ ArrayList<IRuntimeClasspathEntry> list = new ArrayList<IRuntimeClasspathEntry>();
+ addJREEntry(list, install);
+ list.add(getRunJarRuntimeCPEntry(jbs));
+ return (IRuntimeClasspathEntry[]) list
+ .toArray(new IRuntimeClasspathEntry[list.size()]);
+ } catch( CoreException ce) {
+ }
+ try {
+ return super.computeUnresolvedClasspath(config);
+ } catch( CoreException ce ) {}
+ return new IRuntimeClasspathEntry[]{};
+ }
+ }
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java 2009-02-11 09:44:49 UTC (rev 13577)
@@ -0,0 +1,98 @@
+package org.jboss.ide.eclipse.as.core.server.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.core.ClasspathContainerInitializer;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+
+public class RunJarContainerWrapper {
+ public static final String ID = "org.jboss.ide.eclipse.as.core.server.internal.launch.runJarContainer";
+ public static final String RESOLVER_ID = "org.jboss.ide.eclipse.as.core.server.internal.launch.runtimeCPEResolver";
+
+ public static class RunJarContainerInitializer extends ClasspathContainerInitializer {
+ public void initialize(IPath containerPath, IJavaProject project)
+ throws CoreException {
+ RunJarContainer container = new RunJarContainer(containerPath);
+ JavaCore.setClasspathContainer(containerPath,
+ new IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
+ }
+ }
+
+ public static class RunJarResolver implements org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver {
+
+ public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(
+ IRuntimeClasspathEntry entry, ILaunchConfiguration configuration)
+ throws CoreException {
+ IPath p = entry.getPath();
+ IClasspathEntry[] entries = new RunJarContainer(p).getClasspathEntries();
+ IRuntimeClasspathEntry[] rtEntries = new IRuntimeClasspathEntry[entries.length];
+ for( int i = 0; i < entries.length; i++ ) {
+ rtEntries[i] = JavaRuntime.newArchiveRuntimeClasspathEntry(entries[i].getPath());
+ }
+ return rtEntries;
+ }
+
+ public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(
+ IRuntimeClasspathEntry entry, IJavaProject project)
+ throws CoreException {
+ return null;
+ }
+
+ public IVMInstall resolveVMInstall(IClasspathEntry entry)
+ throws CoreException {
+ return null;
+ }
+
+ }
+
+ public static class RunJarContainer implements IClasspathContainer {
+ protected IPath path;
+ public RunJarContainer(IPath path) {
+ this.path = path;
+ }
+
+ public IClasspathEntry[] getClasspathEntries() {
+ String name = path.segment(1);
+ IServer[] servers = ServerCore.getServers();
+ IServer s = null;
+ for( int i = 0; i < servers.length; i++ ) {
+ if( servers[i].getName().equals(name))
+ s = servers[i];
+ }
+ if( s != null ) {
+ IRuntime rt = s.getRuntime();
+ IPath home = rt.getLocation();
+ IPath runJar = home.append(JBossServerStartupLaunchConfiguration.START_JAR_LOC);
+
+ return new IClasspathEntry[] {
+ JavaRuntime.newArchiveRuntimeClasspathEntry(
+ runJar).getClasspathEntry()
+ };
+ }
+ return new IClasspathEntry[]{};
+ }
+
+ public String getDescription() {
+ return "Test Desc";
+ }
+
+ public int getKind() {
+ return K_APPLICATION;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-02-11 00:15:46 UTC (rev 13576)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-02-11 09:44:49 UTC (rev 13577)
@@ -706,4 +706,26 @@
class="org.jboss.ide.eclipse.as.core.extensions.jmx.JBossServerConnectionProvider">
</connectionProvider>
</extension>
+ <extension
+ point="org.eclipse.jdt.core.classpathContainerInitializer">
+ <classpathContainerInitializer
+ class="org.jboss.ide.eclipse.as.core.server.internal.launch.RunJarContainerWrapper$RunJarContainerInitializer"
+ id="org.jboss.ide.eclipse.as.core.server.internal.launch.runJarContainer">
+ </classpathContainerInitializer>
+ </extension>
+ <extension
+ point="org.eclipse.jdt.launching.runtimeClasspathEntryResolvers">
+ <runtimeClasspathEntryResolver
+ class="org.jboss.ide.eclipse.as.core.server.internal.launch.RunJarContainerWrapper$RunJarResolver"
+ container="org.jboss.ide.eclipse.as.core.server.internal.launch.runJarContainer"
+ id="org.jboss.ide.eclipse.as.core.server.internal.launch.runJarContainer.resolver">
+ </runtimeClasspathEntryResolver>
+ </extension>
+ <extension
+ point="org.eclipse.jdt.launching.classpathProviders">
+ <classpathProvider
+ class="org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration$JBossServerDefaultClasspathProvider"
+ id="org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider">
+ </classpathProvider>
+ </extension>
</plugin>
15 years, 2 months
JBoss Tools SVN: r13576 - in trunk/common/tests: org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-02-10 19:15:46 -0500 (Tue, 10 Feb 2009)
New Revision: 13576
Added:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/test/
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/test/AntParserTest.java
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/test/
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/test/DeveloperExceptionTest.java
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/test/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/test/FavoritesClassControllerTest.java
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
Log:
increase code coverage for JUnit tests
Added: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/test/AntParserTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/test/AntParserTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/test/AntParserTest.java 2009-02-11 00:15:46 UTC (rev 13576)
@@ -0,0 +1,16 @@
+package org.jboss.tools.common.ant.parser.test;
+
+import org.jboss.tools.common.ant.parser.AntParser;
+
+import junit.framework.TestCase;
+
+public class AntParserTest extends TestCase {
+
+ public static final String ANT_FILE_CONTENT="<project><target name=\"name1\"/><target name=\"name2\"/><target name=\"name3\"/ </project>";
+
+ public void testGetTargets() {
+ AntParser parser = new AntParser(ANT_FILE_CONTENT);
+ assertEquals(3,parser.getTargets());
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/ant/parser/test/AntParserTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/test/DeveloperExceptionTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/test/DeveloperExceptionTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/test/DeveloperExceptionTest.java 2009-02-11 00:15:46 UTC (rev 13576)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.jboss.tools.common.model.exception.test;
+
+import org.jboss.tools.common.model.exception.DeveloperException;
+
+import junit.framework.TestCase;
+
+/**
+ * @author eskimo
+ *
+ */
+public class DeveloperExceptionTest extends TestCase {
+
+ private final Throwable THROWABLE = new Throwable();
+ private final String MESSAGE = "Message";
+
+ /**
+ * @param name
+ */
+ public DeveloperExceptionTest(String name) {
+ super(name);
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.model.exception.DeveloperException#DeveloperException(java.lang.String)}.
+ */
+ public void testDeveloperExceptionString() {
+ DeveloperException ex = new DeveloperException(MESSAGE);
+ assertEquals(MESSAGE, ex.getMessage());
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.model.exception.DeveloperException#DeveloperException(java.lang.String, java.lang.Throwable)}.
+ */
+ public void testDeveloperExceptionStringThrowable() {
+
+ DeveloperException ex = new DeveloperException(MESSAGE, THROWABLE);
+ assertEquals(MESSAGE, ex.getMessage());
+ assertEquals(THROWABLE, ex.getCause());
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.model.exception.DeveloperException#DeveloperException(java.lang.Throwable)}.
+ */
+ public void testDeveloperExceptionThrowable() {
+ DeveloperException ex = new DeveloperException(THROWABLE);
+ assertEquals(THROWABLE, ex.getCause());
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/exception/test/DeveloperExceptionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java 2009-02-10 23:22:56 UTC (rev 13575)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java 2009-02-11 00:15:46 UTC (rev 13576)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.model.test;
+import org.jboss.tools.common.ant.parser.test.AntParserTest;
+import org.jboss.tools.common.model.exception.test.DeveloperExceptionTest;
+
import junit.framework.Test;
import junit.framework.TestSuite;
/**
@@ -24,6 +27,8 @@
suite.setName("All tests for " + PLUGIN_ID);
suite.addTestSuite(MetaModelTest.class);
suite.addTestSuite(ClassPathTest.class);
+ suite.addTestSuite(AntParserTest.class);
+ suite.addTestSuite(DeveloperExceptionTest.class);
return suite;
}
}
Added: trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/test/FavoritesClassControllerTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/test/FavoritesClassControllerTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/test/FavoritesClassControllerTest.java 2009-02-11 00:15:46 UTC (rev 13576)
@@ -0,0 +1,58 @@
+/**
+ *
+ */
+package org.jboss.tools.common.core.jdt.test;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.core.jdt.FavoritesClassController;
+
+/**
+ * @author eskimo
+ *
+ */
+public class FavoritesClassControllerTest extends TestCase {
+
+ /**
+ * Test method for {@link org.jboss.tools.common.core.jdt.FavoritesClassController#getFavoritesClassesList()}.
+ */
+ public void testGetFavoritesClassesList() {
+ List<String> favClasses = FavoritesClassController.getFavoritesClassesList();
+ assertEquals(0, favClasses.size());
+ FavoritesClassController.push("corg.jboss.TestClass1");
+ FavoritesClassController.push("corg.jboss.TestClass2");
+ FavoritesClassController.push("corg.jboss.TestClass3");
+ FavoritesClassController.push("corg.jboss.TestClass4");
+ FavoritesClassController.push("corg.jboss.TestClass5");
+ favClasses = FavoritesClassController.getFavoritesClassesList();
+ assertEquals(5, favClasses.size());
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.core.jdt.FavoritesClassController#push(java.lang.String)}.
+ */
+ public void testPush() {
+ FavoritesClassController.push("corg.jboss.TestClass1");
+ List<String> favClasses = FavoritesClassController.getFavoritesClassesList();
+ assertEquals("corg.jboss.TestClass1", favClasses.get(0));
+ FavoritesClassController.push("corg.jboss.TestClass5");
+ favClasses = FavoritesClassController.getFavoritesClassesList();
+ assertEquals("corg.jboss.TestClass5", favClasses.get(0));
+ FavoritesClassController.push("corg.jboss.TestClass6");
+ favClasses = FavoritesClassController.getFavoritesClassesList();
+ assertEquals("corg.jboss.TestClass6", favClasses.get(0));
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.common.core.jdt.FavoritesClassController#getLabelProvider()}.
+ */
+ public void testGetLabelProvider() {
+ Image img1 = FavoritesClassController.getLabelProvider().getImage(new Object());
+ Image img2 = FavoritesClassController.getLabelProvider().getImage(new Object());
+ assertTrue(img1==img2);
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/core/jdt/test/FavoritesClassControllerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java 2009-02-10 23:22:56 UTC (rev 13575)
+++ trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java 2009-02-11 00:15:46 UTC (rev 13576)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.test;
+import org.jboss.tools.common.core.jdt.test.FavoritesClassControllerTest;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -25,6 +27,7 @@
suite.setName("All tests for " + PLUGIN_ID);
suite.addTestSuite(ModelUiPreferencesPageTest.class);
suite.addTestSuite(ObjectDecoratorTest.class);
+ suite.addTestSuite(FavoritesClassControllerTest.class);
return suite;
}
15 years, 2 months
JBoss Tools SVN: r13575 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-02-10 18:22:56 -0500 (Tue, 10 Feb 2009)
New Revision: 13575
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
Log:
JBIDE-3759 Servers properties menu errors.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2009-02-10 23:22:28 UTC (rev 13574)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2009-02-10 23:22:56 UTC (rev 13575)
@@ -57,14 +57,18 @@
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
helper = new ServerAttributeHelper(server.getOriginal(), server);
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "ServerEditorPortSection");
- for( int i = 0; i < cf.length; i++ ) {
- try {
- Object o = cf[i].createExecutableExtension("class");
- if( o != null && o instanceof IPortEditorExtension)
- sectionList.add((IPortEditorExtension)o);
- } catch( CoreException ce) { /* ignore */ }
+ if (sectionList.size() <= 0) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(
+ JBossServerUIPlugin.PLUGIN_ID, "ServerEditorPortSection");
+ for (int i = 0; i < cf.length; i++) {
+ try {
+ Object o = cf[i].createExecutableExtension("class");
+ if (o != null && o instanceof IPortEditorExtension)
+ sectionList.add((IPortEditorExtension) o);
+ } catch (CoreException ce) { /* ignore */
+ }
+ }
}
}
15 years, 2 months
JBoss Tools SVN: r13574 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-02-10 18:22:28 -0500 (Tue, 10 Feb 2009)
New Revision: 13574
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
Log:
JBIDE-3759 Servers properties menu errors.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2009-02-10 22:22:52 UTC (rev 13573)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2009-02-10 23:22:28 UTC (rev 13574)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -48,7 +49,7 @@
// deployment. It should run after ear project created and imported into
// workspace
setUser(true);
- setRule(project);
+ setRule(ResourcesPlugin.getWorkspace().getRoot());
this.s = s;
this.deploy = deploy;
}
15 years, 2 months
JBoss Tools SVN: r13573 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-02-10 17:22:52 -0500 (Tue, 10 Feb 2009)
New Revision: 13573
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
JBIDE-3782 Move SeamProjectCreator.execute() to Seam facet install delegate
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-02-10 22:22:47 UTC (rev 13572)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-02-10 22:22:52 UTC (rev 13573)
@@ -209,6 +209,8 @@
public boolean performFinish() {
SeamInstallWizardPage page = (SeamInstallWizardPage)getPage(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_SEAM_FACET);
page.finishPressed();
+ IDataModel model = page.getConfig();
+ model.setProperty(ISeamFacetDataModelProperties.CREATE_EAR_PROJECTS, Boolean.TRUE);
return super.performFinish();
}
@@ -219,25 +221,10 @@
protected void performFinish(final IProgressMonitor monitor) throws CoreException {
super.performFinish(monitor);
- // Create ear, ejb, test projects
IProject warProject = this.getFacetedProject().getProject();
SeamInstallWizardPage page = (SeamInstallWizardPage)getPage(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_SEAM_FACET);
IDataModel model = page.getConfig();
- String seamVersionString = model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
- SeamVersion seamVersion = SeamVersion.parseFromString(seamVersionString);
- SeamProjectCreator creator = null;
- if(seamVersion == SeamVersion.SEAM_1_2) {
- creator = new SeamProjectCreator(model, warProject);
- } else if(seamVersion == SeamVersion.SEAM_2_0) {
- creator = new Seam2ProjectCreator(model, warProject);
- } else if(seamVersion == SeamVersion.SEAM_2_1) {
- creator = new Seam2ProjectCreator(model, warProject);
- } else {
- throw new RuntimeException("Can't get seam version from seam facet model");
- }
- creator.execute(monitor);
-
boolean deployAsEar = ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS));
IProject earProject = null;
IProject ejbProject = null;
15 years, 2 months