JBoss Tools SVN: r27912 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-05 09:55:29 -0500 (Wed, 05 Jan 2011)
New Revision: 27912
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImageItem.java
Log:
[JBIDE-7294] changed label in tree to display ALIAS__OR__NAME[ID] for instances
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImageItem.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImageItem.java 2011-01-05 14:50:15 UTC (rev 27911)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImageItem.java 2011-01-05 14:55:29 UTC (rev 27912)
@@ -14,7 +14,6 @@
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.ui.views.cloud.property.ImagePropertySource;
-import org.jboss.tools.internal.deltacloud.ui.utils.DeltaCloudObjectLabelUtils;
/**
* @author Jeff Johnston
@@ -25,11 +24,21 @@
protected ImageItem(DeltaCloudImage model, DeltaCloudViewItem<?> parent, TreeViewer viewer) {
super(model, parent, viewer);
}
-
+
public String getName() {
- return DeltaCloudObjectLabelUtils.getLabel(getModel());
+ DeltaCloudImage image = getModel();
+ StringBuilder builder = new StringBuilder();
+ if (image != null) {
+ if (image.getName() != null) {
+ builder.append(image.getName()).append(' ');
+ }
+ if (image.getId() != null) {
+ builder.append('[').append(image.getId()).append(']');
+ }
+ }
+ return builder.toString();
}
-
+
@Override
public IPropertySource getPropertySource() {
return new ImagePropertySource(getModel());
13 years, 8 months
JBoss Tools SVN: r27911 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-05 09:50:15 -0500 (Wed, 05 Jan 2011)
New Revision: 27911
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java
Log:
[JBIDE-7294] changed label in tree to display ALIAS__OR__NAME[ID] for instances
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java 2011-01-05 13:56:57 UTC (rev 27910)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java 2011-01-05 14:50:15 UTC (rev 27911)
@@ -14,7 +14,6 @@
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.ui.views.cloud.property.InstancePropertySource;
-import org.jboss.tools.internal.deltacloud.ui.utils.DeltaCloudObjectLabelUtils;
/**
* @author Jeff Johnston
@@ -27,7 +26,23 @@
}
public String getName() {
- return DeltaCloudObjectLabelUtils.getLabel(getModel());
+ DeltaCloudInstance instance = getModel();
+ StringBuilder sb = new StringBuilder();
+ if (instance != null) {
+ String alias = instance.getAlias();
+ if (alias != null) {
+ sb.append(alias).append(' ');
+ } else {
+ String name = instance.getName();
+ if (name != null) {
+ sb.append(name);
+ }
+ }
+ if (instance.getId() != null) {
+ sb.append('[').append(instance.getId()).append(']');
+ }
+ }
+ return sb.toString();
}
@Override
13 years, 8 months
JBoss Tools SVN: r27910 - in trunk/hibernatetools: tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2011-01-05 08:56:57 -0500 (Wed, 05 Jan 2011)
New Revision: 27910
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7991 - add JUnit test
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2011-01-05 13:22:24 UTC (rev 27909)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2011-01-05 13:56:57 UTC (rev 27910)
@@ -63,18 +63,22 @@
completionComparator = DisplayStringProposalComparator.INSTANCE;
}
- public ICompletionProposal[] computeCompletionProposals( ITextViewer viewer, int documentOffset ) {
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
+ IDocument doc = viewer.getDocument();
+ return computeCompletionProposals(doc, documentOffset);
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(IDocument doc, int documentOffset) {
ICompletionProposal[] result = new ICompletionProposal[0];
try {
- IDocument doc = viewer.getDocument();
ITypedRegion partition = null;
if (documentOffset > 0) {
- partition = viewer.getDocument().getPartition( documentOffset - 1 );
+ partition = doc.getPartition( documentOffset - 1 );
}
else {
- partition = viewer.getDocument().getPartition( documentOffset );
+ partition = doc.getPartition( documentOffset );
}
if(partition!=null) {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java 2011-01-05 13:22:24 UTC (rev 27909)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java 2011-01-05 13:56:57 UTC (rev 27910)
@@ -10,19 +10,36 @@
******************************************************************************/
package org.hibernate.eclipse.hqleditor;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.IPage;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.QueryInputModel;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.test.project.SimpleTestProject;
+import org.hibernate.eclipse.console.test.project.SimpleTestProjectWithMapping;
+import org.hibernate.eclipse.console.test.project.TestProject;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
import org.hibernate.eclipse.console.views.QueryParametersPage;
import org.hibernate.eclipse.console.views.QueryParametersView;
@@ -32,40 +49,59 @@
*/
public class HQLEditorTest extends TestCase {
+ private static final String PROJ_NAME = "HQLEditorTest"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = PROJ_NAME;
+
+ private SimpleTestProjectWithMapping project = null;
+
+ protected void setUp() throws Exception {
+ }
+
+ protected void tearDown() throws Exception {
+ cleanUpProject();
+ }
+
+ protected void cleanUpProject() {
+ if (project != null) {
+ project.deleteIProject();
+ project = null;
+ }
+ }
+
public void testHQLEditorOpen(){
IEditorPart editorPart = HibernateConsolePlugin.getDefault()
- .openScratchHQLEditor(null, "");
- assertNotNull("Editor was not opened", editorPart);
- assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor);
+ .openScratchHQLEditor(null, ""); //$NON-NLS-1$
+ assertNotNull("Editor was not opened", editorPart); //$NON-NLS-1$
+ assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor); //$NON-NLS-1$
HQLEditor editor = (HQLEditor)editorPart;
QueryInputModel model = editor.getQueryInputModel();
- assertNotNull("Model is NULL", model);
+ assertNotNull("Model is NULL", model); //$NON-NLS-1$
}
public void testSingleLineCommentsCutOff() throws PartInitException{
- String query = "from pack.Article a\n" +
- "where a.articleid in (:a, :b) --or a.articleid = :c";
+ String query = "from pack.Article a\n" + //$NON-NLS-1$
+ "where a.articleid in (:a, :b) --or a.articleid = :c"; //$NON-NLS-1$
IEditorPart editorPart = HibernateConsolePlugin.getDefault()
.openScratchHQLEditor(null, query);
- assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor);
+ assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor); //$NON-NLS-1$
HQLEditor editor = (HQLEditor)editorPart;
assertEquals(editor.getEditorText(), query);
- assertFalse("Comments were not cut off", editor.getQueryString().contains("--"));
+ assertFalse("Comments were not cut off", editor.getQueryString().contains("--")); //$NON-NLS-1$ //$NON-NLS-2$
QueryInputModel model = editor.getQueryInputModel();
assertTrue(model.getParameterCount() == 0);
IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getActivePage().showView("org.hibernate.eclipse.console.views.QueryParametersView");
- assertNotNull("View was not opened", view);
- assertTrue("Opened view is not QueryParametersView", view instanceof QueryParametersView);
+ .getActivePage().showView("org.hibernate.eclipse.console.views.QueryParametersView"); //$NON-NLS-1$
+ assertNotNull("View was not opened", view); //$NON-NLS-1$
+ assertTrue("Opened view is not QueryParametersView", view instanceof QueryParametersView); //$NON-NLS-1$
QueryParametersView paramView = (QueryParametersView)view;
IPage ipage = paramView.getCurrentPage();
- assertNotNull("Current Page is NULL", ipage);
- assertTrue("Page is not Query Parameters Page", ipage instanceof QueryParametersPage);
+ assertNotNull("Current Page is NULL", ipage); //$NON-NLS-1$
+ assertTrue("Page is not Query Parameters Page", ipage instanceof QueryParametersPage); //$NON-NLS-1$
QueryParametersPage page = (QueryParametersPage)ipage;
IToolBarManager manager = page.getSite().getActionBars().getToolBarManager();
@@ -73,17 +109,59 @@
ActionContributionItem addParamItem = null;
for (int i = 0; i < items.length; i++) {
ActionContributionItem item = (ActionContributionItem) items[i];
- if (item.getAction().getClass().getName().endsWith("NewRowAction")){
+ if (item.getAction().getClass().getName().endsWith("NewRowAction")){ //$NON-NLS-1$
addParamItem = item;
break;
}
}
assertNotNull(HibernateConsoleMessages.QueryParametersPage_add_query_parameter_tooltip
- + " item not found", addParamItem);
+ + " item not found", addParamItem); //$NON-NLS-1$
addParamItem.getAction().run();//add query parameters automatically
assertTrue(model.getParameterCount() == 2);//a and b
}
+ public void testHQLEditorCodeCompletionWithTabs() throws CoreException, NoSuchFieldException, IllegalAccessException{
+ cleanUpProject();
+ project = new SimpleTestProjectWithMapping(PROJ_NAME);
+
+ IPackageFragmentRoot sourceFolder = project.createSourceFolder();
+ IPackageFragment pf = sourceFolder.createPackageFragment(SimpleTestProject.PACKAGE_NAME, false, null);
+ ConsoleConfigUtils.customizeCfgXmlForPack(pf);
+ List<IPath> libs = new ArrayList<IPath>();
+ project.generateClassPath(libs, sourceFolder);
+ project.fullBuild();
+
+ //setup console configuration
+ IPath cfgFilePath = new Path(project.getIProject().getName() + File.separator +
+ TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME);
+ ConsoleConfigUtils.createConsoleConfig(PROJ_NAME, cfgFilePath, CONSOLE_NAME);
+ ConsoleConfiguration cc = KnownConfigurations.getInstance().find(CONSOLE_NAME);
+ assertNotNull("Console Configuration not found", cc); //$NON-NLS-1$
+ cc.build();
+
+ final String codeCompletionPlaceMarker = " from "; //$NON-NLS-1$
+ final String query = "select\t \tt1." + codeCompletionPlaceMarker + //$NON-NLS-1$
+ project.getFullyQualifiedTestClassName() + " t1"; //$NON-NLS-1$
+ IEditorPart editorPart = HibernateConsolePlugin.getDefault()
+ .openScratchHQLEditor(CONSOLE_NAME, query);
+ assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor); //$NON-NLS-1$
+
+ HQLEditor editor = (HQLEditor)editorPart;
+ assertEquals(editor.getEditorText(), query);
+
+ QueryInputModel model = editor.getQueryInputModel();
+ assertTrue(model.getParameterCount() == 0);
+
+ editor.setConsoleConfigurationName(CONSOLE_NAME);
+ IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
+
+ HQLCompletionProcessor processor = new HQLCompletionProcessor(editor);
+
+ int position = query.indexOf(codeCompletionPlaceMarker);
+ ICompletionProposal[] proposals = processor.computeCompletionProposals(doc, position);
+ assertTrue(proposals.length > 0);
+ cc.reset();
+ }
}
13 years, 8 months
JBoss Tools SVN: r27909 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor: tags and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-01-05 08:22:24 -0500 (Wed, 05 Jan 2011)
New Revision: 27909
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CoreHTMLTagsTest.java
Log:
Added CoreHTMLTagsTest and small fixes for VPE Bot Tests
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CoreHTMLTagsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CoreHTMLTagsTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CoreHTMLTagsTest.java 2011-01-05 13:22:24 UTC (rev 27909)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests Core HTML Tags behavior
+ * @author vlado pakan
+ *
+ */
+public class CoreHTMLTagsTest extends VPEEditorTestCase {
+
+ private static final String PAGE_TEXT = "<html>\n" +
+ " <body style=\"color:red; text-align:center; background-color:green\">Body tag test</body>\n" +
+ "</html>";
+
+ private static final String TEST_PAGE_NAME = "CoreHTMLTagsTest.jsp";
+
+ private SWTBotEditorExt jspEditor;
+ private SWTBotWebBrowser webBrowser;
+ private SWTBotExt botExt;
+
+ public CoreHTMLTagsTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ eclipse.maximizeActiveShell();
+ createJspPage(CoreHTMLTagsTest.TEST_PAGE_NAME);
+ jspEditor = botExt.swtBotEditorExtByTitle(CoreHTMLTagsTest.TEST_PAGE_NAME);
+ webBrowser = new SWTBotWebBrowser(CoreHTMLTagsTest.TEST_PAGE_NAME,botExt);
+ }
+ /**
+ * Tests Body Tag
+ */
+ public void testBodyTag(){
+
+ jspEditor.setText(CoreHTMLTagsTest.PAGE_TEXT);
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ assertVisualEditorContains(webBrowser,
+ "BODY",
+ new String[]{"style"},
+ new String[]{"color: red; text-align: center; background-color: green;"},
+ CoreHTMLTagsTest.PAGE_TEXT);
+ // check after refresh
+ bot.toolbarButtonWithTooltip(IDELabel.ToolbarButton.REFRESH).click();
+ assertVisualEditorContains(webBrowser,
+ "BODY",
+ new String[]{"style"},
+ new String[]{"color: red; text-align: center; background-color: green;"},
+ CoreHTMLTagsTest.PAGE_TEXT);
+
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+ @Override
+ protected void tearDown() throws Exception {
+ jspEditor.close();
+ super.tearDown();
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CoreHTMLTagsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 8 months
JBoss Tools SVN: r27908 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-01-05 08:20:20 -0500 (Wed, 05 Jan 2011)
New Revision: 27908
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java
Log:
Added CoreHTMLTagsTest and small fixes for VPE Bot Tests
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-01-05 13:11:19 UTC (rev 27907)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-01-05 13:20:20 UTC (rev 27908)
@@ -654,4 +654,9 @@
}
+ public static class ToolbarButton{
+
+ public static final String REFRESH = "Refresh";
+
+ }
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-01-05 13:11:19 UTC (rev 27907)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-01-05 13:20:20 UTC (rev 27908)
@@ -33,6 +33,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowResourceBundlesUsageasELexpressionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowSelectionTagBarTest;
import org.jboss.tools.vpe.ui.bot.test.editor.selectionbar.SelectionBarTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.CoreHTMLTagsTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ImportTagsFromTLDFileTest;
@@ -96,6 +97,7 @@
suite.addTestSuite(IncludedCssFilesJSPTest.class);
suite.addTestSuite(StylesOnThePageTest.class);
suite.addTestSuite(TextSelectionTest.class);
+ suite.addTestSuite(CoreHTMLTagsTest.class);
return new TestSetup(suite);
}
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java 2011-01-05 13:11:19 UTC (rev 27907)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java 2011-01-05 13:20:20 UTC (rev 27908)
@@ -45,7 +45,7 @@
" </body>\n" +
"</html>";
- private static final String TEST_PAGE_NAME = "TextSelectionTest.jsp";
+ private static final String TEST_PAGE_NAME = "CoreHTMLTagsTest.jsp";
private SWTBotEditorExt jspEditor;
private SWTBotWebBrowser webBrowser;
@@ -65,7 +65,7 @@
/**
* Tests Text Selection
*/
- public void ttestTextSelection(){
+ public void testTextSelection(){
jspEditor.setText(TextSelectionTest.PAGE_TEXT);
jspEditor.save();
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2011-01-05 13:11:19 UTC (rev 27907)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2011-01-05 13:20:20 UTC (rev 27908)
@@ -19,19 +19,19 @@
private String editorText;
private SWTBotEclipseEditor editor;
- String getEditorText() {
+ protected String getEditorText() {
return editorText;
}
- void setEditorText(String textEditor) {
+ protected void setEditorText(String textEditor) {
this.editorText = textEditor;
}
- SWTBotEclipseEditor getEditor() {
+ protected SWTBotEclipseEditor getEditor() {
return editor;
}
- void setEditor(SWTBotEclipseEditor editor) {
+ protected void setEditor(SWTBotEclipseEditor editor) {
this.editor = editor;
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java 2011-01-05 13:11:19 UTC (rev 27907)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELTestCase.java 2011-01-05 13:20:20 UTC (rev 27908)
@@ -1,6 +1,5 @@
package org.jboss.tools.vpe.ui.bot.test.editor.pagedesign;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
@@ -12,26 +11,7 @@
static final String ADD_EL = "Add EL Reference"; //$NON-NLS-1$
static final String SUBSTITUTED_EL = "Substituted EL expressions"; //$NON-NLS-1$
- private SWTBotEclipseEditor editor;
- private String editorText;
-
- SWTBotEclipseEditor getEditor() {
- return editor;
- }
-
- void setEditor(SWTBotEclipseEditor editor) {
- this.editor = editor;
- }
-
- String getEditorText() {
- return editorText;
- }
-
- void setEditorText(String editorText) {
- this.editorText = editorText;
- }
-
@Override
protected void closeUnuseDialogs() {
try {
13 years, 8 months
JBoss Tools SVN: r27907 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-01-05 08:11:19 -0500 (Wed, 05 Jan 2011)
New Revision: 27907
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
Log:
https://issues.jboss.org/browse/JBIDE-8031, images were moved to the CSSPlugin.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2011-01-05 11:17:43 UTC (rev 27906)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2011-01-05 13:11:19 UTC (rev 27907)
@@ -40,9 +40,9 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.model.ui.ModelUIImages;
+import org.jboss.tools.jst.css.CSSPlugin;
import org.jboss.tools.jst.css.dialog.CSSStyleDialog;
import org.jboss.tools.jst.css.dialog.common.Util;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.util.Constants;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.Message;
@@ -237,7 +237,7 @@
Button button = new Button(composite, SWT.PUSH);
button.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false, 1, 1));
button.setToolTipText(VpeUIMessages.EDIT_STYLE_TIP);
- ImageDescriptor colorDesc = JspEditorPlugin
+ ImageDescriptor colorDesc = CSSPlugin
.getImageDescriptor(Util.IMAGE_COLORLARGE_FILE_LOCATION);
Image im = colorDesc.createImage();
button.setImage(im);
13 years, 8 months
JBoss Tools SVN: r27906 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-05 06:17:43 -0500 (Wed, 05 Jan 2011)
New Revision: 27906
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java
Log:
[JBIDE-8051] added alias to property page for instances
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-05 10:57:22 UTC (rev 27905)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-05 11:17:43 UTC (rev 27906)
@@ -1,3 +1,10 @@
+2011-01-05 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties:
+ * src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java
+ (getPropertyDescriptors):
+ (getPropertyValue):
+
2011-01-04 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2011-01-05 10:57:22 UTC (rev 27905)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2011-01-05 11:17:43 UTC (rev 27906)
@@ -16,6 +16,7 @@
CloudViewName=Cloud View
PropertyName.title=Name
+PropertyAlias.title=Alias
PropertyId.title=Id
PropertyOwnerId.title=Owner Id
PropertyHostname.title=Hostname
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java 2011-01-05 10:57:22 UTC (rev 27905)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java 2011-01-05 11:17:43 UTC (rev 27906)
@@ -19,18 +19,23 @@
import org.jboss.tools.deltacloud.ui.views.CVMessages;
import org.jboss.tools.deltacloud.ui.views.cloud.InstanceItem;
+/**
+ * @author Jeff Johnston
+ */
public class InstancePropertySource implements IPropertySource {
private static final String PROPERTY_NAME = "deltacloud.views.instance.name"; //$NON-NLS-1$
+ private static final String PROPERTY_ALIAS = "deltacloud.views.instance.alias"; //$NON-NLS-1$
private static final String PROPERTY_ID = "deltacloud.views.instance.id"; //$NON-NLS-1$
- public static final String PROPERTY_OWNER = "deltacloud.views.instance.owner"; //$NON-NLS-1$
- public static final String PROPERTY_STATE = "deltacloud.views.instance.state"; //$NON-NLS-1$
+ private static final String PROPERTY_OWNER = "deltacloud.views.instance.owner"; //$NON-NLS-1$
+ private static final String PROPERTY_STATE = "deltacloud.views.instance.state"; //$NON-NLS-1$
private static final String PROPERTY_HOSTNAME = "deltacloud.views.instance.hostname"; //$NON-NLS-1$
private static final String PROPERTY_KEYNAME = "deltacloud.views.instance.keyname"; //$NON-NLS-1$
private static final String PROPERTY_PROFILEID = "deltacloud.views.instance.profileid"; //$NON-NLS-1$
private static final String PROPERTY_REALMID = "deltacloud.views.instance.realmid"; //$NON-NLS-1$
private static final String PROPERTY_IMAGEID = "deltacloud.views.instance.imageid"; //$NON-NLS-1$
private static final String PROPERTY_NAME_TITLE = "PropertyName.title"; //$NON-NLS-1$
+ private static final String PROPERTY_ALIAS_TITLE = "PropertyAlias.title"; //$NON-NLS-1$
private static final String PROPERTY_ID_TITLE = "PropertyId.title"; //$NON-NLS-1$
private static final String PROPERTY_OWNER_TITLE = "PropertyOwnerId.title"; //$NON-NLS-1$
private static final String PROPERTY_STATE_TITLE = "PropertyState.title"; //$NON-NLS-1$
@@ -55,27 +60,30 @@
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
if (propertyDescriptors == null) {
- PropertyDescriptor nameDescriptor = new PropertyDescriptor(PROPERTY_NAME,
- CVMessages.getString(PROPERTY_NAME_TITLE));
- PropertyDescriptor idDescriptor = new PropertyDescriptor(PROPERTY_ID,
- CVMessages.getString(PROPERTY_ID_TITLE));
- PropertyDescriptor ownerDescriptor = new PropertyDescriptor(PROPERTY_OWNER,
- CVMessages.getString(PROPERTY_OWNER_TITLE));
- PropertyDescriptor stateDescriptor = new PropertyDescriptor(PROPERTY_STATE,
- CVMessages.getString(PROPERTY_STATE_TITLE));
- PropertyDescriptor hardwareDescriptor = new PropertyDescriptor(PROPERTY_PROFILEID,
- CVMessages.getString(PROPERTY_PROFILEID_TITLE));
- PropertyDescriptor realmDescriptor = new PropertyDescriptor(PROPERTY_REALMID,
- CVMessages.getString(PROPERTY_REALMID_TITLE));
- PropertyDescriptor imageDescriptor = new PropertyDescriptor(PROPERTY_IMAGEID,
- CVMessages.getString(PROPERTY_IMAGEID_TITLE));
- PropertyDescriptor hostnameDescriptor = new PropertyDescriptor(PROPERTY_HOSTNAME,
- CVMessages.getString(PROPERTY_HOSTNAME_TITLE));
- PropertyDescriptor keyDescriptor = new PropertyDescriptor(PROPERTY_KEYNAME,
- CVMessages.getString(PROPERTY_KEYNAME_TITLE));
+ PropertyDescriptor nameDescriptor =
+ new PropertyDescriptor(PROPERTY_NAME, CVMessages.getString(PROPERTY_NAME_TITLE));
+ PropertyDescriptor aliasDescriptor =
+ new PropertyDescriptor(PROPERTY_ALIAS, CVMessages.getString(PROPERTY_ALIAS_TITLE));
+ PropertyDescriptor idDescriptor =
+ new PropertyDescriptor(PROPERTY_ID, CVMessages.getString(PROPERTY_ID_TITLE));
+ PropertyDescriptor ownerDescriptor =
+ new PropertyDescriptor(PROPERTY_OWNER, CVMessages.getString(PROPERTY_OWNER_TITLE));
+ PropertyDescriptor stateDescriptor =
+ new PropertyDescriptor(PROPERTY_STATE, CVMessages.getString(PROPERTY_STATE_TITLE));
+ PropertyDescriptor hardwareDescriptor =
+ new PropertyDescriptor(PROPERTY_PROFILEID, CVMessages.getString(PROPERTY_PROFILEID_TITLE));
+ PropertyDescriptor realmDescriptor =
+ new PropertyDescriptor(PROPERTY_REALMID, CVMessages.getString(PROPERTY_REALMID_TITLE));
+ PropertyDescriptor imageDescriptor =
+ new PropertyDescriptor(PROPERTY_IMAGEID, CVMessages.getString(PROPERTY_IMAGEID_TITLE));
+ PropertyDescriptor hostnameDescriptor =
+ new PropertyDescriptor(PROPERTY_HOSTNAME, CVMessages.getString(PROPERTY_HOSTNAME_TITLE));
+ PropertyDescriptor keyDescriptor =
+ new PropertyDescriptor(PROPERTY_KEYNAME, CVMessages.getString(PROPERTY_KEYNAME_TITLE));
propertyDescriptors = new IPropertyDescriptor[] {
nameDescriptor,
+ aliasDescriptor,
idDescriptor,
ownerDescriptor,
stateDescriptor,
@@ -91,67 +99,42 @@
@Override
public Object getPropertyValue(Object id) {
- if (id.equals(PROPERTY_NAME))
+ if (id.equals(PROPERTY_NAME)) {
return instance.getName();
- if (id.equals(PROPERTY_ID))
+ }
+ if (id.equals(PROPERTY_ALIAS)) {
+ return instance.getAlias();
+ }
+ if (id.equals(PROPERTY_ID)) {
return instance.getId();
- if (id.equals(PROPERTY_OWNER))
+ }
+ if (id.equals(PROPERTY_OWNER)) {
return instance.getOwnerId();
- if (id.equals(PROPERTY_PROFILEID))
+ }
+ if (id.equals(PROPERTY_PROFILEID)) {
return instance.getProfileId();
- if (id.equals(PROPERTY_REALMID))
+ }
+ if (id.equals(PROPERTY_REALMID)) {
return instance.getRealmId();
- if (id.equals(PROPERTY_IMAGEID))
+ }
+ if (id.equals(PROPERTY_IMAGEID)) {
return instance.getImageId();
+ }
if (id.equals(PROPERTY_KEYNAME)) {
- return getKey();
+ return instance.getKeyId();
}
if (id.equals(PROPERTY_STATE)) {
return instance.getState();
}
if (id.equals(PROPERTY_HOSTNAME)) {
List<String> hostnames = instance.getHostNames();
- if (hostnames.size() >= 1)
+ if (hostnames.size() >= 1) {
return hostnames.get(0);
+ }
}
return null;
}
- private Object getKey() {
- // At present (Deltacloud 0.0.7), the keyname is omitted
- // in the data passed back from a listInstances request.
- // If an instance is running and the keyname is missing,
- // we can refresh the instance by its id and this will give us
- // the full data. We can then replace the instance so that
- // it will be complete for future requests until a refresh gets the
- // entire list again.
- String key = null;
- // TODO: very weird stuff here. Why should we check for the server to be
- // a mock and then refresh the instance? investigate what are the
- // consequences of uncommenting this stuff here
- // try {
- key = instance.getKeyId();
- // if (!cloud.getType().equals(DeltaCloud.MOCK_TYPE)) {
- // if (instance.getState().equals(DeltaCloudInstance.State.RUNNING) &&
- // (key == null || key.length() == 0)) {
- // instance = cloud.refreshInstance(instance.getId());
- // consequences
- //
- // if (instance != null) {
- // key = instance.getKey();
- // if (key != null && key.length() > 0)
- // cloud.replaceInstance(instance);
- // }
- // }
- // }
- // } catch (DeltaCloudException e) {
- // ErrorUtils.handleError(
- // "Error", "Could not get key for instance " + instance.getName(),
- // e, Display.getDefault().getActiveShell());
- // }
- return key;
- }
-
@Override
public boolean isPropertySet(Object id) {
return false;
13 years, 8 months
JBoss Tools SVN: r27905 - in trunk/as: plugins and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-01-05 05:57:22 -0500 (Wed, 05 Jan 2011)
New Revision: 27905
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/
Modified:
trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/
trunk/as/plugins/pom.xml
Log:
JBIDE-7412 fully remove as.ssh and remove/ignore bin/target folders
Modified: trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
===================================================================
--- trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml 2011-01-05 10:06:45 UTC (rev 27904)
+++ trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml 2011-01-05 10:57:22 UTC (rev 27905)
@@ -138,12 +138,6 @@
unpack="false"/>
<plugin
- id="org.jboss.ide.eclipse.as.ssh"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
- <plugin
id="org.jboss.ide.eclipse.as.rse.core"
download-size="0"
install-size="0"
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core
___________________________________________________________________
Name: svn:ignore
+ target
bin
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui
___________________________________________________________________
Name: svn:ignore
+ bin
target
Modified: trunk/as/plugins/pom.xml
===================================================================
--- trunk/as/plugins/pom.xml 2011-01-05 10:06:45 UTC (rev 27904)
+++ trunk/as/plugins/pom.xml 2011-01-05 10:57:22 UTC (rev 27905)
@@ -12,7 +12,6 @@
<module>org.jboss.ide.eclipse.as.classpath.ui</module>
<module>org.jboss.ide.eclipse.as.core</module>
<module>org.jboss.ide.eclipse.as.doc.user</module>
- <module>org.jboss.ide.eclipse.as.ssh</module>
<module>org.jboss.ide.eclipse.as.ui</module>
<module>org.jboss.ide.eclipse.as.ui.mbeans</module>
<module>org.jboss.ide.eclipse.as.wtp.core</module>
13 years, 8 months
JBoss Tools SVN: r27903 - in trunk/ws: plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2011-01-05 04:57:35 -0500 (Wed, 05 Jan 2011)
New Revision: 27903
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java
Log:
JBIDE-7913: add warning dialog for overwrite impl class and web.xml
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2011-01-05 09:57:35 UTC (rev 27903)
@@ -1,12 +1,15 @@
package org.jboss.tools.ws.creation.core.commands;
import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
+import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
@@ -49,16 +52,17 @@
import org.eclipse.jdt.core.dom.Type;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.dom.WildcardType;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.text.edits.TextEdit;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
-import org.jboss.tools.ws.creation.core.utils.WSDLPropertyReader;
public class ImplementationClassCreationCommand extends
AbstractDataModelOperation {
@@ -100,27 +104,36 @@
IJavaProject javaPrj = JavaCore.create(project);
List<ICompilationUnit> serviceUnits = JBossWSCreationUtils
- .findJavaUnitsByAnnotation(
- javaPrj,
+ .findJavaUnitsByAnnotation(javaPrj,
JBossWSCreationCoreMessages.Webservice_Annotation,
model.getCustomPackage());
-
+
packageName = model.getCustomPackage();
boolean noPackageName = false;
- if("".equals(packageName)){ //$NON-NLS-1$
+ if ("".equals(packageName)) { //$NON-NLS-1$
noPackageName = true;
}
+ boolean isCheck = true;
for (ICompilationUnit service : serviceUnits) {
if (!service.findPrimaryType().isInterface()) {
continue;
}
- if(noPackageName){
+ if (noPackageName) {
packageName = service.getParent().getElementName();
}
+ String implClsName = getImplClassName(getClassName(service
+ .getElementName()));
+ if (isCheck) {
+ if (findImplClass(implClsName)) {
+ isCheck = false;
+ if (!isOverwriteClass()) {
+ break;
+ }
+ }
+ }
generateImplClass(service);
- String implClsName = getImplPackageName()
- + "." + getImplClassName(getClassName(service.getElementName())); //$NON-NLS-1$
- model.addServiceClasses(implClsName);
+ model.addServiceClasses(getImplPackageName()
+ + "." + implClsName); //$NON-NLS-1$
}
} catch (CoreException e) {
@@ -139,42 +152,48 @@
return status;
}
- protected String getTNSFromWSDL() {
- WSDLPropertyReader reader = new WSDLPropertyReader();
- try {
- URI fileURI = new URI(model.getWsdlURI());
- File tempFile = new File(fileURI);
- reader.readWSDL(tempFile.getAbsolutePath());
- return reader.getTargetnamespace();
- } catch (WSDLException e) {
- e.printStackTrace();
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ private boolean isOverwriteClass() throws JavaModelException {
+ boolean b = MessageDialog
+ .openConfirm(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell(),
+ JBossWSCreationCoreMessages.Confirm_Override_ImplClass,
+ JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSImpl_Overwrite);
+ return b;
+ }
+
+ private boolean findImplClass(String claName) throws JavaModelException {
+ boolean b = false;
+ IPackageFragmentRoot root = getPackageFragmentRoot();
+ String implPackageName = getImplPackageName();
+ IPackageFragment pack = root.getPackageFragment(implPackageName);
+ if (pack.getCompilationUnit(claName + ".java").exists()) { //$NON-NLS-1$
+ b = true;
}
- return null;
+ return b;
}
- protected String getServiceNameFromWSDL() {
- WSDLPropertyReader reader = new WSDLPropertyReader();
-
+ protected String[] getServiceNameFromWSDL() {
+ String[] names = new String[2];
try {
- URI fileURI = new URI(model.getWsdlURI());
- File tempFile = new File(fileURI);
- reader.readWSDL(tempFile.getAbsolutePath());
- List<String> services = reader.getServiceList();
- if (services != null && services.size() > 0) {
- return services.get(0);
+ WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLReader wsdlReader = factory.newWSDLReader();
+ Definition def = wsdlReader.readWSDL(model.getWsdlURI());
+ Map<?, ?> services = def.getServices();
+ if (services != null) {
+ QName[] a = new QName[services.keySet().size()];
+ if (a != null && a.length > 0) {
+ services.keySet().toArray(a);
+ names[0] = a[0].getLocalPart();
+ }
}
+ names[1] = def.getTargetNamespace();
} catch (WSDLException e) {
e.printStackTrace();
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
}
- return null;
+ return names;
}
-
+
@SuppressWarnings("unchecked")
protected void generateImplClass(ICompilationUnit service)
throws CoreException, BadLocationException {
@@ -186,11 +205,13 @@
String className = getClassName(service.getElementName());
String implFileName = getJavaFileName(className);
-
- String serviceName = getServiceNameFromWSDL();
-
- String targetNamespace = getTNSFromWSDL();
+ String[] names = getServiceNameFromWSDL();
+
+ String serviceName = names[0];
+
+ String targetNamespace = names[1];
+
ICompilationUnit icu = pack.createCompilationUnit(implFileName,
"", true, null); //$NON-NLS-1$
// create a working copy with a new owner
@@ -363,8 +384,8 @@
ANNOTATION_PROPERTY_ENDPOINT_INTERFACE, endpoint);
ann.values().add(member);
if (targetNamespace != null) {
- member = createMemberValuePair(ast,
- ANNOTATION_PROPERTY_TNS, targetNamespace);
+ member = createMemberValuePair(ast, ANNOTATION_PROPERTY_TNS,
+ targetNamespace);
ann.values().add(member);
}
return ann;
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2011-01-05 09:57:35 UTC (rev 27903)
@@ -33,9 +33,7 @@
throws ExecutionException {
try {
- String location = JBossWSCreationUtils
- .getJBossWSRuntimeLocation(JBossWSCreationUtils
- .getProjectByName(model.getWebProjectName()));
+ String location = JBossWSCreationUtils.getJBossWSRuntimeLocation(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
if (location.equals("")) { //$NON-NLS-1$
return StatusUtils
.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2011-01-05 09:57:35 UTC (rev 27903)
@@ -21,6 +21,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
import org.eclipse.jst.javaee.core.DisplayName;
@@ -32,6 +33,7 @@
import org.eclipse.jst.javaee.web.WebFactory;
import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
import org.eclipse.jst.jee.project.facet.WebCreateDeploymentFilesDataModelProvider;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -71,19 +73,24 @@
for (int i = 0; i < serviceClasses.size(); i++) {
servletDescriptors[i] = getServletDescriptor(serviceClasses.get(i));
}
- IProject pro = JBossWSCreationUtils.getProjectByName(model.getWebProjectName());
- if (!hasWebXML(pro)) {
+ IProject pro = JBossWSCreationUtils.getProjectByName(model
+ .getWebProjectName());
+ if (!hasWebXML(pro)) {
IVirtualComponent vc = ComponentCore.createComponent(pro);
- IDataModel model = DataModelFactory.createDataModel(new WebCreateDeploymentFilesDataModelProvider());
- model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, vc);
- model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, pro);
+ IDataModel model = DataModelFactory
+ .createDataModel(new WebCreateDeploymentFilesDataModelProvider());
+ model.setProperty(
+ ICreateDeploymentFilesDataModelProperties.GENERATE_DD, vc);
+ model.setProperty(
+ ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT,
+ pro);
IDataModelOperation op = model.getDefaultOperation();
try {
op.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e1) {
// Ignore
- }
- }
+ }
+ }
mergeWebXML(servletDescriptors);
return status;
}
@@ -120,24 +127,48 @@
protected void addServlet(IProject projectByName,
ServletDescriptor servletDescriptor,
org.eclipse.jst.j2ee.webapplication.WebApp webapp) {
+ @SuppressWarnings("rawtypes")
List theServlets = webapp.getServlets();
+ boolean b = false;
for (int i = 0; i < theServlets.size(); i++) {
org.eclipse.jst.j2ee.webapplication.Servlet aServlet = (org.eclipse.jst.j2ee.webapplication.Servlet) theServlets
.get(i);
if (aServlet.getServletName().equals(servletDescriptor.getName())) {
- status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
- return;
+ if (b) {
+ theServlets.remove(aServlet);
+ } else {
+ b = isOverrideServlet();
+ if (b) {
+ theServlets.remove(aServlet);
+ break;
+ } else {
+ status = StatusUtils.errorStatus(""); //$NON-NLS-1$
+ return;
+ }
+ }
}
}
+ @SuppressWarnings("rawtypes")
List theServletMapplings = webapp.getServletMappings();
for (int i = 0; i < theServletMapplings.size(); i++) {
org.eclipse.jst.j2ee.webapplication.ServletMapping aServletMapping = (org.eclipse.jst.j2ee.webapplication.ServletMapping) theServletMapplings
.get(i);
- if (aServletMapping.getServlet().getServletName().equals(servletDescriptor.getName())
+ if (aServletMapping.getServlet().getServletName()
+ .equals(servletDescriptor.getName())
|| aServletMapping.getUrlPattern().equals(
servletDescriptor.getMappings())) {
- status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
- return;
+ if (b) {
+ theServletMapplings.remove(aServletMapping);
+ } else {
+ b = isOverrideServlet();
+ if (b) {
+ theServletMapplings.remove(aServletMapping);
+ break;
+ } else {
+ status = StatusUtils.errorStatus(""); //$NON-NLS-1$
+ return;
+ }
+ }
}
}
org.eclipse.jst.j2ee.webapplication.WebapplicationFactory factory = org.eclipse.jst.j2ee.webapplication.WebapplicationFactory.eINSTANCE;
@@ -162,52 +193,61 @@
}
}
- private ServletDescriptor getServletDescriptor(String clsName) {
- String servletName = model.getServiceName();
- if (servletName == null) {
- servletName = JBossWSCreationUtils
- .classNameFromQualifiedName(clsName);
- }
- if (servletName.endsWith("Impl") && servletName.length() > 4) { //$NON-NLS-1$
- servletName = servletName.substring(0, servletName.length() - 4);
- }
- ServletDescriptor sd = new ServletDescriptor();
- sd.setName(servletName);
- sd.setDisplayName(sd.getName());
- sd.setClassName(clsName);
- sd.setMappings(JBossWSCreationCoreMessages.Separator_Java + sd.getName());
- return sd;
- }
-
- @SuppressWarnings("unchecked")
public void addjeeServlet(IProject webProject,
ServletDescriptor servletDescriptor, WebApp webapp) {
+ @SuppressWarnings("rawtypes")
List theServlets = webapp.getServlets();
+ boolean b = false;
for (int i = 0; i < theServlets.size(); i++) {
Servlet aServlet = (Servlet) theServlets.get(i);
if (aServlet.getServletName().equals(servletDescriptor.getName())) {
- status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
- return;
+ b = isOverrideServlet();
+ if (b) {
+ theServlets.remove(aServlet);
+ break;
+ } else {
+ status = StatusUtils.errorStatus(""); //$NON-NLS-1$
+ return;
+ }
}
}
- List theServletMapplings = webapp.getServletMappings();
+ List<ServletMapping> theServletMapplings = webapp.getServletMappings();
for (int i = 0; i < theServletMapplings.size(); i++) {
ServletMapping aServletMapping = (ServletMapping) theServletMapplings
.get(i);
- if (aServletMapping.getServletName()
- .equals(servletDescriptor.getName())) {
- status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
- return;
+ if (aServletMapping.getServletName().equals(
+ servletDescriptor.getName())) {
+ if (b) {
+ theServletMapplings.remove(aServletMapping);
+ } else {
+ b = isOverrideServlet();
+ if (b) {
+ theServletMapplings.remove(aServletMapping);
+ break;
+ } else {
+ status = StatusUtils.errorStatus(""); //$NON-NLS-1$
+ return;
+ }
+ }
}
- List list = aServletMapping.getUrlPatterns();
+ List<UrlPatternType> list = aServletMapping.getUrlPatterns();
if (list != null) {
for (int j = 0; j < list.size(); j++) {
UrlPatternType url = (UrlPatternType) list.get(j);
if (url.getValue().equals(servletDescriptor.getMappings())) {
- status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
- return;
+ if (b) {
+ theServletMapplings.remove(aServletMapping);
+ } else {
+ if (isOverrideServlet()) {
+ theServletMapplings.remove(aServletMapping);
+ break;
+ } else {
+ status = StatusUtils.errorStatus(""); //$NON-NLS-1$
+ return;
+ }
+ }
}
}
}
@@ -234,15 +274,45 @@
webapp.getServletMappings().add(servletMapping);
}
}
+
+
+ private ServletDescriptor getServletDescriptor(String clsName) {
+ String servletName = model.getServiceName();
+ if (servletName == null) {
+ servletName = JBossWSCreationUtils
+ .classNameFromQualifiedName(clsName);
+ }
+ if (servletName.endsWith("Impl") && servletName.length() > 4) { //$NON-NLS-1$
+ servletName = servletName.substring(0, servletName.length() - 4);
+ }
+ ServletDescriptor sd = new ServletDescriptor();
+ sd.setName(servletName);
+ sd.setDisplayName(sd.getName());
+ sd.setClassName(clsName);
+ sd.setMappings(JBossWSCreationCoreMessages.Separator_Java
+ + sd.getName());
+ return sd;
+ }
private boolean hasWebXML(IProject pro) {
// we are looking for this recursively because though application.xml
// is always in META-INF, it's not always in "earcontent" since the
// earcontent folder name can be custom
- File file = JBossWSCreationUtils.findFileByPath(WEB_XML, pro.getLocation().toOSString());
- if(file == null){
- return false;
- }
+ File file = JBossWSCreationUtils.findFileByPath(WEB_XML, pro
+ .getLocation().toOSString());
+ if (file == null) {
+ return false;
+ }
return true;
}
+
+ private boolean isOverrideServlet() {
+ boolean b = MessageDialog
+ .openConfirm(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell(),
+ JBossWSCreationCoreMessages.Confirm_Override_Servlet,
+ JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
+ return b;
+ }
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2011-01-05 09:57:35 UTC (rev 27903)
@@ -27,7 +27,6 @@
@Override
protected void addCommandlineArgs(List<String> command) {
-
if(model.getCustomPackage() != null && !"".equals(model.getCustomPackage())){ //$NON-NLS-1$
command.add("-p"); //$NON-NLS-1$
command.add(model.getCustomPackage());
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2011-01-05 09:57:35 UTC (rev 27903)
@@ -36,8 +36,11 @@
Error_WS_Location=The JBoss WS Runtime Location is NULL. Please set the location on JBoss WS preferences page.
Error_Create_Client_Sample=When create a client sample, a error comes up. Please check the generated files.
Error_No_Package=The service implementation selected does not follow Java naming conventions. This may result in not being able to generate your WebService.
-Error_JBossWS_GenerateWizard_WSName_Same=The Web Service Name has been used in the web.xml of the web project.
+Error_JBossWS_GenerateWizard_WSName_Same=The Web Service Name has been used in the web.xml of the web project. Do you want to overwrite it?
+Error_JBossWS_GenerateWizard_WSImpl_Overwrite=The Web Service implementation classes have been there. Do you want to overwrite them?
RestEasyLibUtils_Error_UnableToFindRuntimeForProject=Unable to find runtime associated with selected project.
RSMergeWebXMLCommand_REST_App_Exists=Rest Application exists with same name
RSMergeWebXMLCommand_REST_Servlet_Exists=RestEasy servlet already exists.
RSMergeWebXMLCommand_REST_Servlet_Mapping_Exists=RestEasy servlet mapping already exists.
+Confirm_Override_Servlet=Confirm Web Service Name Overwrite
+Confirm_Override_ImplClass=Confirm Web Service Implementation classes Overwrite
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2011-01-05 09:57:35 UTC (rev 27903)
@@ -43,6 +43,7 @@
public static String Error_Create_Client_Sample;
public static String Error_Message_No_Runtime_Specified;
public static String Error_JBossWS_GenerateWizard_WSName_Same;
+ public static String Error_JBossWS_GenerateWizard_WSImpl_Overwrite;
public static String RestEasyLibUtils_Error_UnableToFindRuntimeForProject;
@@ -52,6 +53,8 @@
public static String RSMergeWebXMLCommand_REST_Servlet_Mapping_Exists;
+ public static String Confirm_Override_Servlet;
+ public static String Confirm_Override_ImplClass;
private JBossWSCreationCoreMessages() {
}
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java 2011-01-05 09:55:22 UTC (rev 27902)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java 2011-01-05 09:57:35 UTC (rev 27903)
@@ -15,7 +15,7 @@
* Generated source version: 2.0
*
*/
-@WebServiceClient(name = "HelloWorldService", targetNamespace = "http://www.example.org/HelloWorld", wsdlLocation = "http://localhost:8080/JavaFirstTestProject/HelloWorld?wsdl")
+@WebServiceClient(name = "HelloWorldService", targetNamespace = "http://www.example.org/HelloWorld", wsdlLocation = "http://127.0.0.1:8080/JavaFirstTestProject/HelloWorld?wsdl")
public class HelloWorldService
extends Service
{
13 years, 8 months