JBoss Tools SVN: r26246 - trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-11-04 09:01:26 -0400 (Thu, 04 Nov 2010)
New Revision: 26246
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7381 , SwtBotTest was updated, testTaglibRegistration in JSP and XHTML were added.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-11-04 09:53:59 UTC (rev 26245)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-11-04 13:01:26 UTC (rev 26246)
@@ -751,6 +751,141 @@
editor.toTextEditor().getSelection());
}
+ public void testTaglibRegistrationInJSP() throws Throwable {
+ /*
+ * Open simple html file in order to get the VPE toolbar
+ */
+ SWTBotEditor editor = SWTTestExt.packageExplorer.openFile(JBT_TEST_PROJECT_NAME,
+ "WebContent", "pages", TEST_PAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ editor.setFocus();
+ editor.toTextEditor().selectLine(0);
+ assertEquals("JSF Core taglib should present on page", //$NON-NLS-1$
+ "<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\" %>", //$NON-NLS-1$
+ editor.toTextEditor().getSelection());
+ /*
+ * Rewrite the taglib
+ */
+ editor.toTextEditor().typeText(" "); //$NON-NLS-1$
+ /*
+ * Make sure that taglib doesn't present
+ */
+ assertTrue("JSF Core taglib should be removed", //$NON-NLS-1$
+ (editor.toTextEditor().getText().indexOf(
+ "<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\" %>") == -1)); //$NON-NLS-1$
+ editor = createNewBundleToLastPage("", "inputUserName4"); //$NON-NLS-1$ //$NON-NLS-2$
+ /*
+ * Select 'via <f:loadBundle> tag on the current page' radio button
+ */
+ SWTBotRadio rb = bot.radioInGroup(
+ JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_LOAD_BUNDLE,
+ JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_SAVE_RESOURCE_BUNDLE);
+ assertNotNull(CANNOT_FIND_RADIO_BUTTON
+ + JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_LOAD_BUNDLE,
+ rb);
+ rb.setFocus();
+ rb.click();
+ assertTrue("("+JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_LOAD_BUNDLE+") " + //$NON-NLS-1$ //$NON-NLS-2$
+ "radio button should be enabled.", //$NON-NLS-1$
+ rb.isSelected());
+
+ /*
+ * 'OK' button should be enabled. Press it.
+ */
+ assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).isEnabled());
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ isUnusedDialogOpened = false;
+ /*
+ * Check that the text was replaced
+ */
+ editor.setFocus();
+ editor.toTextEditor().selectLine(1);
+ assertEquals("Taglig insertion failed!", //$NON-NLS-1$
+ "<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\"%>", //$NON-NLS-1$
+ editor.toTextEditor().getSelection());
+ }
+
+ public void testTaglibRegistrationInXHTML() throws Throwable {
+ isUnusedDialogOpened = false;
+ /*
+ * Open simple html file in order to get the VPE toolbar
+ */
+ SWTBotEditor editor = SWTTestExt.packageExplorer.openFile(FACELETS_TEST_PROJECT_NAME,
+ "WebContent", "pages", FACELETS_TEST_PAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ editor.setFocus();
+ editor.toTextEditor().selectLine(4);
+ assertEquals("JSF Core taglib should present on page", //$NON-NLS-1$
+ " xmlns:f=\"http://java.sun.com/jsf/core\"", //$NON-NLS-1$
+ editor.toTextEditor().getSelection());
+ /*
+ * Rewrite the taglib
+ */
+ editor.toTextEditor().typeText(" "); //$NON-NLS-1$
+ /*
+ * Make sure that taglib doesn't present
+ */
+ assertTrue("JSF Core taglib should be removed", //$NON-NLS-1$
+ (editor.toTextEditor().getText().indexOf(
+ "xmlns:f=\"http://java.sun.com/jsf/core\"") == -1)); //$NON-NLS-1$
+ editor.toTextEditor().selectRange(10, 45, 4);
+ /*
+ * Get toolbar button
+ */
+ assertTrue(TOOLBAR_ICON_ENABLED, bot
+ .toolbarButtonWithTooltip(TOOL_TIP)
+ .isEnabled());
+ bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+ bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
+ bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
+ isUnusedDialogOpened = true;
+ SWTBotCheckBox checkBox = bot.checkBox();
+ assertNotNull("Cannot find checkbox '" //$NON-NLS-1$
+ + JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_NEW_FILE + "'", //$NON-NLS-1$
+ checkBox);
+ checkBox.select();
+ assertTrue("Checkbox should be checked.", //$NON-NLS-1$
+ checkBox.isChecked());
+ assertTrue("Next button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.NEXT_BUTTON).isEnabled());
+ bot.button(WidgetVariables.NEXT_BUTTON).click();
+ /*
+ * 'Next>' button should be enabled. Press it.
+ */
+ assertTrue("(Next>) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.NEXT_BUTTON).isEnabled());
+ bot.button(WidgetVariables.NEXT_BUTTON).click();
+ /*
+ * Select 'via <f:loadBundle> tag on the current page' radio button
+ */
+ SWTBotRadio rb = bot.radioInGroup(
+ JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_LOAD_BUNDLE,
+ JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_SAVE_RESOURCE_BUNDLE);
+ assertNotNull(CANNOT_FIND_RADIO_BUTTON
+ + JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_LOAD_BUNDLE,
+ rb);
+ rb.setFocus();
+ rb.click();
+ assertTrue("("+JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_LOAD_BUNDLE+") " + //$NON-NLS-1$ //$NON-NLS-2$
+ "radio button should be enabled.", //$NON-NLS-1$
+ rb.isSelected());
+
+ /*
+ * 'OK' button should be enabled. Press it.
+ */
+ assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).isEnabled());
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ isUnusedDialogOpened = false;
+ /*
+ * Check that the text was replaced
+ */
+ editor.setFocus();
+ editor.toTextEditor().selectLine(6);
+ assertEquals("Taglig insertion failed!", //$NON-NLS-1$
+ " xmlns:f=\"http://java.sun.com/jsf/core\">", //$NON-NLS-1$
+ editor.toTextEditor().getSelection());
+ }
+
/**
* Creates the new bundle till last page.
*
15 years, 5 months
JBoss Tools SVN: r26245 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test: editor/preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-11-04 05:53:59 -0400 (Thu, 04 Nov 2010)
New Revision: 26245
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PromptForTagAttributesDuringTagInsertTest.java
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/VPEAutoTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
Log:
Added PromptForTagAttributesDuringTagInsertTest test.
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 2010-11-04 09:27:53 UTC (rev 26244)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-04 09:53:59 UTC (rev 26245)
@@ -18,6 +18,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.AlwaysHideSelectionBarWithoutPromptTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.BorderForUnknownTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ChangeEditorTabForTheFirstOpenPageTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.preferences.PromptForTagAttributesDuringTagInsertTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowNonVisualTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowResourceBundlesUsageasELexpressionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowSelectionTagBarTest;
@@ -72,6 +73,7 @@
suite.addTestSuite(InsertActionsTest.class);
suite.addTestSuite(EditingActionsTest.class);
suite.addTestSuite(TextEditingActionsTest.class);
+ suite.addTestSuite(PromptForTagAttributesDuringTagInsertTest.class);
return new TestSetup(suite);
}
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-11-04 09:27:53 UTC (rev 26244)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-11-04 09:53:59 UTC (rev 26245)
@@ -414,7 +414,10 @@
*/
protected abstract boolean isUnuseDialogOpened();
-
+ /**
+ * Opens page pageName
+ * @param pageName
+ */
protected void openPage(String pageName){
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
@@ -422,7 +425,9 @@
.expandNode("WebContent").expandNode("pages").getNode(pageName).doubleClick(); //$NON-NLS-1$ //$NON-NLS-2$
bot.sleep(Timing.time3S());
}
-
+ /**
+ * Opens Test Page
+ */
protected void openPage(){
openPage(TEST_PAGE);
}
@@ -446,4 +451,16 @@
bot.sleep(Timing.time2S());
}
}
+ /**
+ * Deletes page pageName
+ * @param pageName
+ */
+ protected void deletePage(String pageName){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ innerBot.tree().expandNode(JBT_TEST_PROJECT_NAME).expandNode("WebContent") //$NON-NLS-1$
+ .expandNode("pages").getNode("testPage.jsp").select(); //$NON-NLS-1$//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.shell("Confirm Delete").activate(); //$NON-NLS-1$
+ bot.button("OK").click(); //$NON-NLS-1$
+ }
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2010-11-04 09:27:53 UTC (rev 26244)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2010-11-04 09:53:59 UTC (rev 26245)
@@ -64,7 +64,7 @@
}
private void selectSelection(){
- bot.toolbarToggleButton(SHOW_SELECTION_BAR).click();
+ bot.toolbarToggleButtonWithTooltip(TOGGLE_SELECTION_BAR_TOOLTIP).click();
}
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2010-11-04 09:27:53 UTC (rev 26244)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2010-11-04 09:53:59 UTC (rev 26245)
@@ -15,7 +15,7 @@
public abstract class PreferencesTestCase extends VPEAutoTestCase{
- protected static final String SHOW_SELECTION_BAR = "Show Selection Bar"; //$NON-NLS-1$
+ protected static final String TOGGLE_SELECTION_BAR_TOOLTIP = "Toggle Selection Bar (Ctrl+6)"; //$NON-NLS-1$
protected static final String SHOW_NON_VISUAL_TAGS = "Show non-visual tags"; //$NON-NLS-1$
protected static final String SHOW_BORDER_FOR_UNKNOWN_TAGS = "Show border for unknown tags"; //$NON-NLS-1$
protected static final String SHOW_RESOURCE_BUNDLES = "Show resource bundles usage as EL expressions"; //$NON-NLS-1$
@@ -75,7 +75,7 @@
}
void setPreferencesToDefault(boolean fromEditor) throws WidgetNotFoundException{
- SWTBotToolbarToggleButton tbShowSelectionBar = bot.toolbarToggleButton(SHOW_SELECTION_BAR);
+ SWTBotToolbarToggleButton tbShowSelectionBar = bot.toolbarToggleButtonWithTooltip(TOGGLE_SELECTION_BAR_TOOLTIP);
if (!tbShowSelectionBar.isChecked()){
tbShowSelectionBar.click();
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PromptForTagAttributesDuringTagInsertTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PromptForTagAttributesDuringTagInsertTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PromptForTagAttributesDuringTagInsertTest.java 2010-11-04 09:53:59 UTC (rev 26245)
@@ -0,0 +1,82 @@
+package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Prompt for Tag Attributes during Tag Insert test
+ * @author vlado pakan
+ *
+ */
+public class PromptForTagAttributesDuringTagInsertTest extends PreferencesTestCase{
+
+ private static final String TEST_PAGE_NAME = "PromptForTagAttributes.jsp";
+ private SWTBotEclipseEditor jspEditor;
+ private SWTBotWebBrowser webBrowser;
+ private SWTBotExt botExt = null;
+
+ public PromptForTagAttributesDuringTagInsertTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ eclipse.maximizeActiveShell();
+ createJspPage(PromptForTagAttributesDuringTagInsertTest.TEST_PAGE_NAME);
+ jspEditor = botExt.editorByTitle(PromptForTagAttributesDuringTagInsertTest.TEST_PAGE_NAME).toTextEditor();
+ webBrowser = new SWTBotWebBrowser(PromptForTagAttributesDuringTagInsertTest.TEST_PAGE_NAME,botExt);
+ }
+ /**
+ * Prompt for Tag Attributes during Tag Insert test
+ */
+ public void testPromptForTagAttributesDuringTagInsert(){
+ jspEditor.setText("");
+ jspEditor.save();
+ bot.sleep(Timing.time2S());
+ // Check Ask for Tag Attributes during Insert
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ SWTBotCheckBox chbAskForAttributes = bot.checkBox(ASK_FOR_ATTRIBUTES);
+ if (!chbAskForAttributes.isChecked()) {
+ chbAskForAttributes.click();
+ }
+ bot.button("OK").click();
+
+ webBrowser.activatePaletteTool("outputText");
+ SWTBot dialogBot = null;
+ try{
+ dialogBot = botExt.shell(IDELabel.Shell.INSERT_TAG).activate().bot();
+ dialogBot.button(IDELabel.Button.FINISH).click();
+ } catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+ assertNotNull("Dialog asking for Tag Attributes during Insert was not opened but it has to.",dialogBot);
+ // Uncheck Ask for Tag Attributes during Insert
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ chbAskForAttributes = bot.checkBox(ASK_FOR_ATTRIBUTES);
+ chbAskForAttributes.click();
+ bot.button("OK").click();
+ webBrowser.activatePaletteTool("outputText");
+ dialogBot = null;
+ try{
+ dialogBot = botExt.shell(IDELabel.Shell.INSERT_TAG).activate().bot();
+ dialogBot.button(IDELabel.Button.FINISH).click();
+ } catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+ assertNull("Dialog asking for Tag Attributes during Insert was opened but it must not to be.",dialogBot);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PromptForTagAttributesDuringTagInsertTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2010-11-04 09:27:53 UTC (rev 26244)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2010-11-04 09:53:59 UTC (rev 26245)
@@ -33,7 +33,7 @@
}
private void selectSelection(){
- bot.toolbarToggleButton(SHOW_SELECTION_BAR).click();
+ bot.toolbarToggleButtonWithTooltip(TOGGLE_SELECTION_BAR_TOOLTIP).click();
}
private void checkIsHide(){
15 years, 5 months
JBoss Tools SVN: r26244 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-11-04 05:27:53 -0400 (Thu, 04 Nov 2010)
New Revision: 26244
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java
Log:
show bundle's messages as EL expressions on all opened vpe pages by clicking 'show bundle's messages as EL expressions' button on toolbar (https://jira.jboss.org/browse/JBIDE-7383)
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java 2010-11-04 08:33:27 UTC (rev 26243)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java 2010-11-04 09:27:53 UTC (rev 26244)
@@ -18,6 +18,7 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.commands.IElementUpdater;
@@ -65,22 +66,31 @@
public void updateElement(UIElement element, Map parameters) {
- IEditorPart activeEditor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (!(activeEditor instanceof JSPMultiPageEditor)) {
+ boolean toggleState = JspEditorPlugin
+ .getDefault()
+ .getPreferenceStore()
+ .getBoolean(
+ IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
+
+ IEditorReference[] openedEditors = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage()
+ .getEditorReferences();
+ for (IEditorReference openedEditor : openedEditors) {
+ IEditorPart editor = openedEditor.getEditor(true);
+ toggleShowBundleAsEl(editor, toggleState);
+ }
+ }
+
+ private void toggleShowBundleAsEl(IEditorPart editor, boolean toggleState) {
+
+ if (!(editor instanceof JSPMultiPageEditor)) {
return;
}
- JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) editor;
VpeController vpeController = (VpeController) jspEditor
.getVisualEditor().getController();
- boolean toggleState = JspEditorPlugin
- .getDefault()
- .getPreferenceStore()
- .getBoolean(
- IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
-
/*
* Update bundle messages.
*/
15 years, 5 months
JBoss Tools SVN: r26243 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-11-04 04:33:27 -0400 (Thu, 04 Nov 2010)
New Revision: 26243
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
Log:
show text formatting bar on all opened vpe pages by clicking 'show text formatting bar' button on toolbar (https://jira.jboss.org/browse/JBIDE-7383)
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-04 07:57:56 UTC (rev 26242)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-04 08:33:27 UTC (rev 26243)
@@ -17,12 +17,8 @@
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.commands.IElementUpdater;
@@ -31,13 +27,9 @@
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
-import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.toolbar.IVpeToolBarManager;
-import org.jboss.tools.vpe.editor.toolbar.VpeToolBarManager;
-import org.jboss.tools.vpe.editor.toolbar.format.FormatControllerManager;
-import org.jboss.tools.vpe.editor.toolbar.format.TextFormattingToolBar;
/**
* Handler for ShowTextFormatting
@@ -78,13 +70,23 @@
boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_TEXT_FORMATTING);
- IEditorPart activeEditor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (!(activeEditor instanceof JSPMultiPageEditor)) {
+ IEditorReference[] openedEditors = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage()
+ .getEditorReferences();
+ for (IEditorReference openedEditor : openedEditors) {
+ IEditorPart editor = openedEditor.getEditor(true);
+ toggleShowTextFormatting(editor, toggleState);
+ }
+ }
+
+ private void toggleShowTextFormatting(IEditorPart editor,
+ boolean toggleState) {
+
+ if (!(editor instanceof JSPMultiPageEditor)) {
return;
}
- JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) editor;
MozillaEditor mozillaEditor = ((VpeEditorPart) jspEditor
.getVisualEditor()).getVisualEditor();
IVpeToolBarManager vpeToolBarManager = mozillaEditor
15 years, 5 months
JBoss Tools SVN: r26242 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-11-04 03:57:56 -0400 (Thu, 04 Nov 2010)
New Revision: 26242
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java
Log:
show non-visual tags on all opened vpe pages by clicking 'show non-visual tags' button on toolbar (https://jira.jboss.org/browse/JBIDE-7383)
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java 2010-11-04 07:41:25 UTC (rev 26241)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java 2010-11-04 07:57:56 UTC (rev 26242)
@@ -18,6 +18,7 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.commands.IElementUpdater;
@@ -64,18 +65,29 @@
public void updateElement(UIElement element, Map parameters) {
- IEditorPart activeEditor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (!(activeEditor instanceof JSPMultiPageEditor)) {
+ boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
+ .getBoolean(IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
+
+ IEditorReference[] openedEditors = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage()
+ .getEditorReferences();
+ for (IEditorReference openedEditor : openedEditors) {
+ IEditorPart editor = openedEditor.getEditor(true);
+ toggleShowNonVisualElements(editor, toggleState);
+ }
+ }
+
+ private void toggleShowNonVisualElements(IEditorPart editor,
+ boolean toggleState) {
+
+ if (!(editor instanceof JSPMultiPageEditor)) {
return;
}
- JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) editor;
VpeController vpeController = (VpeController) jspEditor
.getVisualEditor().getController();
- boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
- .getBoolean(IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
/*
* Change flag
*/
15 years, 5 months
JBoss Tools SVN: r26241 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-11-04 03:41:25 -0400 (Thu, 04 Nov 2010)
New Revision: 26241
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddNewSeamRuntimeMarkerResolution.java
Log:
https://jira.jboss.org/browse/JBIDE-5134
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddNewSeamRuntimeMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddNewSeamRuntimeMarkerResolution.java 2010-11-04 03:47:59 UTC (rev 26240)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddNewSeamRuntimeMarkerResolution.java 2010-11-04 07:41:25 UTC (rev 26241)
@@ -47,21 +47,12 @@
private String runtimeName;
private String label;
- private SeamRuntimeListFieldEditor seamRuntimes;
-
public AddNewSeamRuntimeMarkerResolution(IMarker marker){
project = (IProject)marker.getResource();
IEclipsePreferences preferences = SeamCorePlugin.getSeamPreferences(project);
-
runtimeName = preferences.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,"");
this.label = MessageFormat.format(SeamUIMessages.ADD_NEW_SEAM_RUNTIME_MARKER_RESOLUTION_TITLE, new Object[]{runtimeName});
- seamRuntimes = new SeamRuntimeListFieldEditor(
- "rtlist", SeamPreferencesMessages.SEAM_PREFERENCE_PAGE_SEAM_RUNTIMES, new ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes()))); //$NON-NLS-1$
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- Composite root = new Composite(shell, SWT.NONE);
- root.setVisible(false);
- seamRuntimes.getEditorControls(root);
}
public String getLabel() {
@@ -86,12 +77,21 @@
SeamGuiPlugin.getPluginLog().logError(ex);
}
+ SeamRuntimeListFieldEditor seamRuntimes = new SeamRuntimeListFieldEditor(
+ "rtlist", SeamPreferencesMessages.SEAM_PREFERENCE_PAGE_SEAM_RUNTIMES, new ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes()))); //$NON-NLS-1$
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ Composite root = new Composite(shell, SWT.NONE);
+ root.setVisible(false);
+ seamRuntimes.getEditorControls(root);
+
+
seamRuntimes.getAddAction().run(runtimeName, runtimeVersion);
for (SeamRuntime rt : seamRuntimes.getAddedSeamRuntimes()) {
SeamRuntimeManager.getInstance().addRuntime(rt);
}
SeamRuntimeManager.getInstance().save();
+ seamRuntimes.dispose();
}
}
15 years, 5 months
JBoss Tools SVN: r26240 - trunk/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2010-11-03 23:47:59 -0400 (Wed, 03 Nov 2010)
New Revision: 26240
Modified:
trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
Log:
updated with new fixed issues
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2010-11-03 23:03:45 UTC (rev 26239)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2010-11-04 03:47:59 UTC (rev 26240)
@@ -337,6 +337,21 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-6815">JBIDE-6815</ulink>: A template page has been added that does not incorporate Facelets.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6285">JBIDE-6285</ulink>: Previously when a user would insert a start and ending tag (for example, <tag><tag>), code assistance would turn on when the cursor was placed between the tags. This behavior was not an assistance to the user under normal circumstances as when a user pressed the <keycode>Enter</keycode> key, to seperate the tags, the first code assist proposal would be inserted instead. For this release Code assistance has been improved by realizing that in the mentioned circumstance no assistance is required.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6276">JBIDE-6276</ulink>: The ability to preview refactoring changes made to JSF 2 components has been added.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6266">JBIDE-6266</ulink>: Content Assist now includes support for Web Standards Tools (WST) categories. A futher two categories have been added: JBoss JSF/Seam EL and JBoss JSF/Seam Tag Proposals.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
@@ -382,6 +397,11 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-6487">JBIDE-6487</ulink>: The Maven Hibernate Configurator has been added. This insures that if a maven project contains a dependency with <property>groupId=org.hibernate</property> and an <property>artifactId</property> starting with <property>hibernate</property>, the Maven Hibernate Configurator will enable Hibernate 3 support.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6293">JBIDE-6293</ulink>: The final version of Maven Portletbridge 2.0.0 libraries have been added to the tool set.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara> -->
@@ -448,6 +468,11 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-6610">JBIDE-6610</ulink>: Components defined in a custom <filename>component.xml</filename> file were not recognized. This bug has been corrected through the modification of <filename>XMLScanner.java</filename>, <filename>SeamComponentsEntityRecognizer.java</filename> and <filename>SeamResourceVisitor.java</filename>.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6360">JBIDE-6360</ulink>: Previously <property>view-id</property> entries in the navigation of XML files was not tested for validlity. Error checking for this parameter has been added to the Seam tools set with this release.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
@@ -503,9 +528,14 @@
</listitem>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-7034">JBIDE-7034</ulink>, <ulink url="http://jira.jboss.com/jira/browse/JBIDE-">JBIDE-</ulink> and <ulink url="http://jira.jboss.com/jira/browse/JBIDE-">JBIDE-</ulink>: New reporting fields were added to the usage plug-in for the gathering of user data. See the individual JIRAs for specific field details.
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-7034">JBIDE-7034</ulink> and <ulink url="http://jira.jboss.com/jira/browse/JBIDE-">JBIDE-</ulink>: New reporting fields were added to the usage plug-in for the gathering of user data. See the individual JIRAs for specific field details.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6376">JBIDE-6376</ulink>: Usage reporting component based on Google Analytics has been added.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara> -->
@@ -544,6 +574,21 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-6600">JBIDE-6600</ulink>: The Visual Page Editor would use all available template libraries reguardless of the opened content. This caused conflicts between templates; an example of this is the <property>head</property> tag appearing in both the docbook and HTML templates. The solution has been to create a seperate editor for docbook.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6385">JBIDE-6385</ulink>: The icon for the <guiicon>Externalize Strings</guiicon> action in the Visual Page Editor toolbar has been updated.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6333">JBIDE-6333</ulink>: When resizing an image, a caption now appears at the users cursor to indicate the current size an image will be resized to.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-6288">JBIDE-6288</ulink>: When hovering over a button created in the Visual Page Editor, the button would not be highlighted on Linux operating systems. This issue has been corrected by modifying the following files: <filename>VpeController.java</filename>, <filename>VpeDnD.java</filename>, <filename>MozillaEventAdapter.java</filename>, <filename>VisualDomUtil.java</filename> and <filename>MozillaDndListener.java</filename>.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
15 years, 5 months
JBoss Tools SVN: r26239 - in trunk: cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-11-03 19:03:45 -0400 (Wed, 03 Nov 2010)
New Revision: 26239
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/references/
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/references/CDIPreferencePageTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/PreferencePageAbstractTest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
Log:
CDI PreferencePage tests
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java 2010-11-03 22:13:24 UTC (rev 26238)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java 2010-11-03 23:03:45 UTC (rev 26239)
@@ -22,6 +22,11 @@
* @author Alexey Kazakov
*/
public class CDIPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * @see plugin.xml descriptor for ID
+ */
+ public static final String ID = "org.jboss.tools.common.model.ui.cdi";
@Override
protected Control createContents(Composite parent) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2010-11-03 22:13:24 UTC (rev 26238)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2010-11-03 23:03:45 UTC (rev 26239)
@@ -11,6 +11,7 @@
package org.jboss.tools.cdi.ui.test;
import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.jboss.tools.cdi.ui.test.references.CDIPreferencePageTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIWizardTest;
import junit.framework.Test;
@@ -28,6 +29,7 @@
TestSuite suite = new TestSuite("CDI UI Tests");
suite.addTestSuite(CATest.class);
suite.addTestSuite(NewCDIWizardTest.class);
+ suite.addTestSuite(CDIPreferencePageTest.class);
return suite;
}
}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/references/CDIPreferencePageTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/references/CDIPreferencePageTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/references/CDIPreferencePageTest.java 2010-11-03 23:03:45 UTC (rev 26239)
@@ -0,0 +1,28 @@
+package org.jboss.tools.cdi.ui.test.references;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.jboss.tools.cdi.ui.preferences.CDIPreferencePage;
+import org.jboss.tools.cdi.ui.preferences.CDISettingsPreferencePage;
+import org.jboss.tools.cdi.ui.preferences.CDIValidatorPreferencePage;
+import org.jboss.tools.test.util.PreferencePageAbstractTest;
+
+
+public class CDIPreferencePageTest extends PreferencePageAbstractTest{
+
+
+
+ public void testCDIPreferencePageIsCreated() {
+ PreferenceDialog prefDialog = createPreferenceDialog(CDIPreferencePage.ID);
+ assertTrue("Selected page is not an instance of CDIPreferencePage", isPreferencePageIsCreated(CDISettingsPreferencePage.ID, CDIPreferencePage.class));
+
+ }
+
+ public void testCDIValidatorPreferencePageIsCreated() {
+ PreferenceDialog prefDialog = createPreferenceDialog(CDIValidatorPreferencePage.PREF_ID);
+ assertTrue("Selected page is not an instance of CDIPreferencePage", isPreferencePageIsCreated(CDIValidatorPreferencePage.PREF_ID, CDIValidatorPreferencePage.class));
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/references/CDIPreferencePageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/PreferencePageAbstractTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/PreferencePageAbstractTest.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/PreferencePageAbstractTest.java 2010-11-03 23:03:45 UTC (rev 26239)
@@ -0,0 +1,33 @@
+package org.jboss.tools.test.util;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import junit.framework.TestCase;
+
+public class PreferencePageAbstractTest extends TestCase {
+
+ public boolean isPreferencePageIsCreated(String id, Class expectedInstance) {
+ PreferenceDialog prefDialog = createPreferenceDialog(id);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ return expectedInstance.isInstance(selectedPage); //$NON-NLS-1$
+ } finally {
+ prefDialog.close();
+ }
+
+ }
+
+ public static PreferenceDialog createPreferenceDialog(String pageId) {
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), pageId, new String[] {pageId}, null);
+ dialog.setBlockOnOpen(false);
+ return dialog;
+ }
+
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/PreferencePageAbstractTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r26238 - in trunk/bpel/plugins: org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-11-03 18:13:24 -0400 (Wed, 03 Nov 2010)
New Revision: 26238
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/AssignImplSection.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/LiteralAssignCategory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java
Log:
CODING IN PROGRESS - issue JBIDE-7351: General issues with Variable Initialization, Assign, and Copy
https://jira.jboss.org/browse/JBIDE-7351
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -3134,8 +3134,14 @@
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
- elementData.append(getText(n));
- break;
+ // https://jira.jboss.org/browse/JBIDE-7351
+ // don't display "null" for literal editor widgets
+ {
+ String data = getText(n);
+ if (data != null)
+ elementData.append(data);
+ break;
+ }
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/AssignImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/AssignImplSection.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/AssignImplSection.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -592,6 +592,11 @@
fCurrentCopy.setFrom(BPELFactory.eINSTANCE.createFrom());
}
section.fCurrent.setInput(fCurrentCopy.getFrom());
+
+ // https://jira.jboss.org/browse/JBIDE-7351
+ // construct an initializer if From is empty
+ if (section.fCurrent instanceof LiteralAssignCategory)
+ VariableInitializationSection.createDefaultInitializer(getBPELEditor(), fCurrentCopy.getFrom(), fCurrentCopy.getTo());
}
section.showCurrent();
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/LiteralAssignCategory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/LiteralAssignCategory.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/LiteralAssignCategory.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -10,31 +10,20 @@
*******************************************************************************/
package org.eclipse.bpel.ui.properties;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
import org.eclipse.bpel.common.ui.flatui.FlatFormAttachment;
import org.eclipse.bpel.common.ui.flatui.FlatFormData;
import org.eclipse.bpel.model.From;
-import org.eclipse.bpel.model.impl.VariableImpl;
import org.eclipse.bpel.model.resource.BPELResource;
import org.eclipse.bpel.model.util.BPELUtils;
-import org.eclipse.bpel.model.util.XSD2XMLGenerator;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Messages;
import org.eclipse.bpel.ui.adapters.IVirtualCopyRuleSide;
import org.eclipse.bpel.ui.util.BPELUtil;
-import org.eclipse.bpel.validator.EmfModelQuery;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
/**
@@ -99,73 +88,16 @@
From from = BPELUtil.adapt(aModel.getCopyRuleSide(), From.class);
fChangeHelper.startNonUserChange();
- try {
- String fromString = EMPTY_STRING;
- if (from != null) {
- fromString = from.getLiteral();
- }
- if (fromString == null) {
- fromString = EMPTY_STRING;
- // https://jira.jboss.org/browse/JBIDE-7351
- // if "From" is empty, construct a suitable literal for the variable
- try {
- VariableImpl var = (VariableImpl)fOwnerSection.getModel();
- String rootElement = null;
- String uriWSDL = null;
-
- // Variable is defined using "messageType"
- Message msg = (Message)var.getMessageType();
- if (msg != null) {
- if (msg.eIsProxy()) {
- EObject obj = EmfModelQuery.lookupMessage(getBPELEditor().getProcess(), msg.getQName());
- if (obj instanceof Message)
- msg = (Message)obj;
- }
- Part part = null;
- Map parts = msg.getParts();
- if (parts!=null && !parts.isEmpty()) {
- Map.Entry entry = (Map.Entry)parts.entrySet().iterator().next();
- part = (Part)entry.getValue();
- }
- if (aModel.getPart() != null)
- part = aModel.getPart();
- if (part!=null) {
- XSDElementDeclaration declaration = part.getElementDeclaration();
- if (declaration != null) {
- uriWSDL = declaration.getSchema().getSchemaLocation();
- rootElement = declaration.getName();
- }
- }
- }
-
- // Variable is defined using "type"
- XSDTypeDefinition type = var.getType();
- if (type != null) {
- QName qname = new QName(type.getTargetNamespace(), type.getName());
- rootElement = qname.getLocalPart();
- uriWSDL = type.eResource().getURI().toString();
- }
-
- // Variable is defined using "element"
- XSDElementDeclaration element = var.getXSDElement();
- if (element != null) {
- QName qname = new QName(element.getTargetNamespace(), element
- .getName());
- rootElement = qname.getLocalPart();
- uriWSDL = element.eResource().getURI().toString();
- }
-
- XSD2XMLGenerator generator = new XSD2XMLGenerator(uriWSDL, rootElement);
- fromString = generator.createXML();
- }
- catch (Exception e) {
- }
- }
-
- fLiteralText.setText(fromString);
- } finally {
- fChangeHelper.finishNonUserChange();
+ String fromString = EMPTY_STRING;
+ if (from != null) {
+ fromString = from.getLiteral();
}
+ if (fromString == null) {
+ fromString = EMPTY_STRING;
+ }
+
+ fLiteralText.setText(fromString);
+ fChangeHelper.finishNonUserChange();
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -11,16 +11,25 @@
package org.eclipse.bpel.ui.properties;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
import org.eclipse.bpel.common.ui.details.IDetailsAreaConstants;
import org.eclipse.bpel.common.ui.flatui.FlatFormAttachment;
import org.eclipse.bpel.common.ui.flatui.FlatFormData;
import org.eclipse.bpel.model.BPELFactory;
import org.eclipse.bpel.model.BPELPackage;
+import org.eclipse.bpel.model.From;
+import org.eclipse.bpel.model.To;
import org.eclipse.bpel.model.Variable;
+import org.eclipse.bpel.model.util.XSD2XMLGenerator;
+import org.eclipse.bpel.ui.BPELEditor;
import org.eclipse.bpel.ui.Messages;
import org.eclipse.bpel.ui.commands.SetCommand;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.bpel.ui.util.MultiObjectAdapter;
+import org.eclipse.bpel.validator.EmfModelQuery;
import org.eclipse.core.resources.IMarker;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
@@ -30,6 +39,10 @@
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Part;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDTypeDefinition;
/**
@@ -274,6 +287,19 @@
section.updateCombo();
}
+ // https://jira.jboss.org/browse/JBIDE-7351
+ // generate an appropriate XML initializer literal if currently empty
+ if (section.fCurrent instanceof LiteralAssignCategory) {
+ From from = fVariable.getFrom();
+ if (from!=null) {
+ String literal = from.getLiteral();
+ if (literal==null || literal.isEmpty()) {
+ literal = createDefaultInitializer(getBPELEditor(), fVariable, null);
+ from.setLiteral(literal);
+ }
+ }
+ }
+
// Set the input of the category after we insert the to or from into the model.
section.fCurrent.setInput( fVariable.getFrom() );
section.showCurrent();
@@ -311,4 +337,87 @@
public void gotoMarker(IMarker marker) {
refresh();
}
+
+ /**
+ * Construct an appropriate XML literal initializer for the given "from" and "to" parts
+ *
+ * @param bpelEditor
+ * @param from
+ * @param to
+ * @return
+ */
+ public static String createDefaultInitializer(BPELEditor bpelEditor, From from, To to) {
+ String literal = EMPTY_STRING;
+ if ( from!=null && to!=null) {
+ literal = from.getLiteral();
+ if (literal==null || literal.isEmpty()) {
+ literal = createDefaultInitializer(bpelEditor, to.getVariable(), to.getPart());
+ from.setLiteral(literal);
+ }
+ }
+ return literal;
+ }
+
+ /**
+ * Construct an appropriate XML literal initializer for the given variable and message part.
+ *
+ * @param bpelEditor
+ * @param var - the variable to be initialized
+ * @param part - if the variable is defined as a message, this is the message part
+ * otherwise null
+ * @return - XML string representing an intializer for the given variable
+ * @see https://jira.jboss.org/browse/JBIDE-7351
+ */
+ public static String createDefaultInitializer(BPELEditor bpelEditor, Variable var, Part part) {
+ String fromString = EMPTY_STRING;
+ try {
+ String rootElement = null;
+ String uriWSDL = null;
+
+ // Variable is defined using "messageType"
+ Message msg = (Message)var.getMessageType();
+ if (msg != null) {
+ if (msg.eIsProxy()) {
+ msg = (Message)EmfModelQuery.resolveProxy(bpelEditor.getProcess(), msg);
+ }
+ if (part==null) {
+ Map parts = msg.getParts();
+ if (parts!=null && !parts.isEmpty()) {
+ Map.Entry entry = (Map.Entry)parts.entrySet().iterator().next();
+ part = (Part)entry.getValue();
+ }
+ }
+ if (part!=null) {
+ XSDElementDeclaration declaration = part.getElementDeclaration();
+ if (declaration != null) {
+ uriWSDL = declaration.getSchema().getSchemaLocation();
+ rootElement = declaration.getName();
+ }
+ }
+ }
+
+ // Variable is defined using "type"
+ XSDTypeDefinition type = var.getType();
+ if (type != null) {
+ QName qname = new QName(type.getTargetNamespace(), type.getName());
+ rootElement = qname.getLocalPart();
+ uriWSDL = type.eResource().getURI().toString();
+ }
+
+ // Variable is defined using "element"
+ XSDElementDeclaration element = var.getXSDElement();
+ if (element != null) {
+ QName qname = new QName(element.getTargetNamespace(), element
+ .getName());
+ rootElement = qname.getLocalPart();
+ uriWSDL = element.eResource().getURI().toString();
+ }
+
+ XSD2XMLGenerator generator = new XSD2XMLGenerator(uriWSDL, rootElement);
+ fromString = generator.createXML();
+ }
+ catch (Exception e) {
+ }
+ return fromString;
+ }
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -39,20 +39,17 @@
import org.eclipse.bpel.ui.util.XSDUtils;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.wsdl.Message;
import org.eclipse.wst.wsdl.Part;
import org.eclipse.xsd.XSDAttributeDeclaration;
@@ -480,6 +477,10 @@
side.setQuery(null);
}
+ /*
+ // https://jira.jboss.org/browse/JBIDE-7351
+ // remove all of this: don't ask to initialize variables whenever focus
+ // changes - this makes for a bad user experience!
// From?
if (side.isSource())
return;
@@ -502,6 +503,7 @@
(new Object[] { var.getName() })))) {
initTargetVariable(var, side);
}
+ */
}
private boolean isInitializerExist(Variable var, IVirtualCopyRuleSide side) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -83,6 +83,7 @@
import org.eclipse.bpel.ui.extensions.BPELUIRegistry;
import org.eclipse.bpel.ui.uiextensionmodel.ActivityExtension;
import org.eclipse.bpel.ui.uiextensionmodel.UiextensionmodelPackage;
+import org.eclipse.bpel.validator.EmfModelQuery;
import org.eclipse.bpel.wsil.model.inspection.InspectionPackage;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -1720,6 +1721,11 @@
public static void openEditor(EObject modelObject, BPELEditor editor) {
try {
+ // https://jira.jboss.org/browse/JBIDE-7351
+ // try to resolve proxies here, otherwise we don't know editor input
+ if (modelObject.eIsProxy()) {
+ modelObject = EmfModelQuery.resolveProxy(editor.getProcess(), modelObject);
+ }
Assert.isNotNull(modelObject);
Assert.isNotNull(modelObject.eResource());
IFile file = BPELUtil.getFileFromURI(modelObject.eResource().getURI());
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java 2010-11-03 22:07:20 UTC (rev 26237)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java 2010-11-03 22:13:24 UTC (rev 26238)
@@ -12,7 +12,6 @@
import java.util.List;
-import javax.wsdl.OperationType;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
@@ -22,10 +21,19 @@
import org.eclipse.bpel.model.Variable;
import org.eclipse.bpel.model.partnerlinktype.PartnerLinkType;
import org.eclipse.bpel.model.partnerlinktype.Role;
+import org.eclipse.bpel.model.proxy.MessageProxy;
+import org.eclipse.bpel.model.proxy.OperationProxy;
+import org.eclipse.bpel.model.proxy.PartProxy;
+import org.eclipse.bpel.model.proxy.PartnerLinkTypeProxy;
+import org.eclipse.bpel.model.proxy.PortTypeProxy;
+import org.eclipse.bpel.model.proxy.PropertyProxy;
+import org.eclipse.bpel.model.proxy.RoleProxy;
+import org.eclipse.bpel.model.proxy.XSDElementDeclarationProxy;
+import org.eclipse.bpel.model.proxy.XSDTypeDefinitionProxy;
import org.eclipse.bpel.model.util.ImportResolver;
import org.eclipse.bpel.model.util.ImportResolverRegistry;
+import org.eclipse.bpel.model.util.WSDLUtil;
import org.eclipse.bpel.model.util.XSDComparer;
-import org.eclipse.bpel.model.util.WSDLUtil;
import org.eclipse.bpel.model.util.XSDUtil;
import org.eclipse.bpel.validator.factory.AdapterFactory;
import org.eclipse.emf.common.util.EList;
@@ -495,6 +503,40 @@
return null;
}
+ public static EObject resolveProxy( Process process, EObject obj) {
+ if (obj instanceof MessageProxy) {
+ return scanImports ( process, ((MessageProxy)obj).getQName(), WSDLUtil.WSDL_MESSAGE );
+ }
+ else if (obj instanceof PortTypeProxy) {
+ return scanImports ( process, ((PortTypeProxy)obj).getQName(), WSDLUtil.WSDL_PORT_TYPE );
+ }
+ else if (obj instanceof PartnerLinkTypeProxy) {
+ return scanImports ( process, ((PartnerLinkTypeProxy)obj).getQName(), WSDLUtil.BPEL_PARTNER_LINK_TYPE );
+ }
+ else if (obj instanceof RoleProxy) {
+ return scanImports ( process, ((RoleProxy)obj).getQName(), WSDLUtil.BPEL_ROLE );
+ }
+ else if (obj instanceof PropertyProxy) {
+ return scanImports ( process, ((PropertyProxy)obj).getQName(), WSDLUtil.BPEL_PROPERTY );
+ }
+ else if (obj instanceof OperationProxy) {
+ QName qname = new QName(((OperationProxy)obj).getName());
+ return scanImports ( process, qname, WSDLUtil.WSDL_OPERATION );
+ }
+ else if (obj instanceof PartProxy) {
+ QName qname = new QName(((PartProxy)obj).getName());
+ return scanImports ( process, qname, WSDLUtil.WSDL_PART );
+ }
+ else if (obj instanceof XSDTypeDefinitionProxy) {
+ QName qname = new QName(((XSDTypeDefinitionProxy)obj).getName());
+ return scanImports ( process, qname, WSDLUtil.XSD_TYPE_DEFINITION );
+ }
+ else if (obj instanceof XSDElementDeclarationProxy) {
+ QName qname = new QName(((XSDElementDeclarationProxy)obj).getName());
+ return scanImports ( process, qname, WSDLUtil.XSD_ELEMENT_DECLARATION );
+ }
+ return obj;
+ }
static void assertTrue ( boolean mustBeTrue , String msg ) {
if (!mustBeTrue) {
15 years, 5 months
JBoss Tools SVN: r26237 - branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-11-03 18:07:20 -0400 (Wed, 03 Nov 2010)
New Revision: 26237
Modified:
branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
workspace/Denny/esb-example-soa-p5.0/helloworld_all.zip
Log:
JBDS-1355 Import ESB examples - JBDS complains about runtime name - even if the name is what the error message specifies
Modified: branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2010-11-03 18:36:33 UTC (rev 26236)
+++ branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2010-11-03 22:07:20 UTC (rev 26237)
@@ -30,7 +30,8 @@
org.eclipse.equinox.p2.ui.sdk,
org.eclipse.equinox.p2.metadata,
org.jboss.tools.portlet.core,
- org.eclipse.equinox.p2.operations
+ org.eclipse.equinox.p2.operations,
+ org.eclipse.jst.server.core
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.jboss.tools.project.examples,
Modified: branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-11-03 18:36:33 UTC (rev 26236)
+++ branches/jbosstools-3.2.0.Beta1/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-11-03 22:07:20 UTC (rev 26237)
@@ -1,7 +1,6 @@
package org.jboss.tools.project.examples.fixes;
import java.io.File;
-import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -11,7 +10,15 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.server.core.internal.JavaServerPlugin;
+import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer;
+import org.eclipse.jst.server.core.internal.RuntimeClasspathProviderWrapper;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -21,7 +28,6 @@
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.tools.portlet.core.IPortletConstants;
import org.jboss.tools.portlet.core.internal.PortletRuntimeComponentProvider;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
@@ -37,6 +43,7 @@
private static final String ESB = "esb"; //$NON-NLS-1$
private static final String PORTLET = "portlet"; //$NON-NLS-1$
private static final String REQUIRED_COMPONENTS = "required-components"; //$NON-NLS-1$
+ private static final IPath ESB_SERVER_SUPPLIED_CONTAINER_PATH = new Path("org.jboss.esb.runtime.classpath/server.supplied");
public boolean canFix(Project project, ProjectFix fix) {
if (!ProjectFix.WTP_RUNTIME.equals(fix.getType())) {
@@ -69,6 +76,7 @@
wtpRuntime = RuntimeManager.getRuntime(runtime.getId());
facetedProject.addTargetedRuntime(wtpRuntime, monitor);
facetedProject.setPrimaryRuntime(wtpRuntime, monitor);
+ fixEsb(eclipseProject, fix, wtpRuntime);
}
}
}
@@ -80,6 +88,61 @@
return ret;
}
+ private void fixEsb(IProject eclipseProject,
+ ProjectFix fix, org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime) throws JavaModelException {
+ String required_components = fix.getProperties().get(REQUIRED_COMPONENTS);
+ if (required_components == null) {
+ return;
+ }
+ List<String> components = tokenize(required_components);
+ if (components == null) {
+ return;
+ }
+ boolean esbRequired = false;
+ for (String component:components) {
+ if (ESB.equals(component)) {
+ esbRequired = true;
+ break;
+ }
+ }
+ if (esbRequired) {
+ IJavaProject javaProject = JavaCore.create(eclipseProject);
+ if (javaProject != null) {
+ if (!javaProject.isOpen()) {
+ javaProject.open(null);
+ }
+ IClasspathEntry[] entries = javaProject.getRawClasspath();
+ IClasspathEntry[] newEntries = new IClasspathEntry[entries.length];
+ boolean changed = false;
+ IRuntime runtime = getRuntime(wtpRuntime);
+ for (int i = 0; i < entries.length; i++) {
+ IClasspathEntry entry = entries[i];
+ if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
+ IPath path = entry.getPath();
+ if (new Path(RuntimeClasspathContainer.SERVER_CONTAINER).isPrefixOf(path)) {
+ RuntimeClasspathProviderWrapper rcpw = JavaServerPlugin.findRuntimeClasspathProvider(runtime.getRuntimeType());
+ IPath serverContainerPath = new Path(RuntimeClasspathContainer.SERVER_CONTAINER)
+ .append(rcpw.getId()).append(runtime.getId());
+ newEntries[i] = JavaCore.newContainerEntry(serverContainerPath);
+ changed = true;
+ } else if (ESB_SERVER_SUPPLIED_CONTAINER_PATH.isPrefixOf(path)) {
+ IPath esbContainerPath = ESB_SERVER_SUPPLIED_CONTAINER_PATH.append(runtime.getId());
+ newEntries[i] = JavaCore.newContainerEntry(esbContainerPath);
+ changed = true;
+ } else {
+ newEntries[i] = entry;
+ }
+ } else {
+ newEntries[i] = entry;
+ }
+ }
+ if (changed) {
+ javaProject.setRawClasspath(newEntries, new NullProgressMonitor());
+ }
+ }
+ }
+ }
+
private IRuntime getBestRuntime(Project project, ProjectFix fix) {
String allowedTypes = fix.getProperties().get(
ProjectFix.ALLOWED_TYPES);
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2010-11-03 18:36:33 UTC (rev 26236)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2010-11-03 22:07:20 UTC (rev 26237)
@@ -508,7 +508,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50</property>
- <property name="eclipse-projects">helloworld</property>
+ <property name="eclipse-projects">helloworld,helloworld_testclient</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 5.0 and the runtime name should be "jboss-soa-p.5.0 Runtime"</property>
</fix>
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_all.zip
===================================================================
(Binary files differ)
15 years, 5 months