JBoss Tools SVN: r24105 - trunk/build/component.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-08-12 11:16:49 -0400 (Thu, 12 Aug 2010)
New Revision: 24105
Added:
trunk/build/component/archives.xml
Log:
new archives builder pom for rawblem
Added: trunk/build/component/archives.xml
===================================================================
--- trunk/build/component/archives.xml (rev 0)
+++ trunk/build/component/archives.xml 2010-08-12 15:16:49 UTC (rev 24105)
@@ -0,0 +1,16 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss</groupId>
+ <artifactId>tools</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>../parent</module>
+ <module>../libs</module>
+
+ <module>../../tests</module>
+ <module>../../jmx</module>
+ <module>../../archives</module>
+ </modules>
+</project>
15 years, 8 months
JBoss Tools SVN: r24104 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-08-12 10:34:32 -0400 (Thu, 12 Aug 2010)
New Revision: 24104
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
Log:
https://jira.jboss.org/browse/JBIDE-6808
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-08-12 14:13:17 UTC (rev 24103)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-08-12 14:34:32 UTC (rev 24104)
@@ -182,23 +182,19 @@
IType contextType = context instanceof IType ? (IType)context : context.getDeclaringType();
String key = context == null ? typeParameterSignature : contextType.getFullyQualifiedName() + "+" + typeParameterSignature;
- String t = typeParameterSignature;
- int q = t.indexOf(":");
- if(q >= 0) {
- t = t.substring(0, q);
- }
+ String t = Signature.getTypeVariable(typeParameterSignature);
+ String[] bounds = Signature.getTypeParameterBounds(typeParameterSignature);
+
t = "Q" + t + ";";
if(result == null || t.equals(result.getSignature())) {
- if(q >= 0) {
- String sts = typeParameterSignature.substring(q + 1);
- if(sts.length() > 0) {
- ParametedType st = getParametedType(contextType, sts);
- if(st != null) {
- result = new TypeDeclaration(st, 0, 0);
- }
- } else if(result != null) {
- result.setSignature(t);
+ String sts = bounds.length > 0 ? bounds[0] : "";
+ if(sts.length() > 0) {
+ ParametedType st = getParametedType(contextType, sts);
+ if(st != null) {
+ result = new TypeDeclaration(st, 0, 0);
}
+ } else if(result != null) {
+ result.setSignature(t);
}
if(result == null) {
result = new ParametedType();
15 years, 8 months
JBoss Tools SVN: r24103 - in trunk: tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-08-12 10:13:17 -0400 (Thu, 12 Aug 2010)
New Revision: 24103
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroupsTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/PaletteEditorTest.java
Removed:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroups.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
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/tools/SWTBotWebBrowser.java
Log:
Added Palette Editor Text and added suffix Test to MannagePaletteGroups class name
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2010-08-12 14:12:33 UTC (rev 24102)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -21,13 +21,19 @@
import org.apache.log4j.Logger;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Decorations;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.results.WidgetResult;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
@@ -277,6 +283,191 @@
}
});
}
+ /**
+ * Returns tree menu which contains menuLabel
+ * @param tree
+ * @param menuLabel
+ * @return
+ */
+ public static Menu getTreeMenuViaReflections (final Tree tree, final String menuLabel){
+ // Menu has to be already created
+ return UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
+ public Menu run() {
+ Menu result = null;
+ Composite parent = tree.getParent();
+ while (!(parent instanceof Decorations)){
+ parent = parent.getParent();
+ }
+ try {
+ Menu[] menus = ReflectionsHelper.getPrivateFieldValue(Decorations.class,
+ "menus",
+ parent,
+ Menu[].class);
+ if (menus != null){
+ MenuItem topMenuItem = null;
+ int index = menus.length - 1;
+ while (topMenuItem == null && index >= 0){
+ if (menus[index] != null){
+ MenuItem[] menuItems = menus[index].getItems();
+ int menuItemIndex = 0;
+ while (topMenuItem == null && menuItemIndex < menuItems.length){
+ if (menuItems[menuItemIndex].getText().equals(menuLabel)){
+ topMenuItem = menuItems[menuItemIndex];
+ }
+ menuItemIndex++;
+ }
+ }
+ index--;
+ }
+ if (topMenuItem != null){
+ result = topMenuItem.getParent();
+ }
+ }
+ else{
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel);
+ }
+ } catch (SecurityException se) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,se);
+ } catch (NoSuchFieldException nsfe) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,nsfe);
+ } catch (IllegalArgumentException iae) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,iae);
+ } catch (IllegalAccessException iace) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,iace);
+ }
+ return result;
+ }});
+ }
+ /**
+ * Simulate Right Click on treeItem
+ * @param tree
+ * @param treeItem
+ */
+ public static void treeRightClick(final Tree tree , final TreeItem treeItem) {
+ Rectangle cellBounds = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+ public Rectangle run() {
+ return treeItem.getBounds();
+ }
+ });
+ clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2), tree , treeItem);
+ }
+ /**
+ * Simulate Right Click on treeItem on specified position
+ * @param x
+ * @param y
+ * @param tree
+ * @param treeItem
+ */
+ protected static void clickXY(int x, int y,final Tree tree , final TreeItem treeItem) {
+ notifyTree(SWT.MouseEnter,tree,treeItem);
+ notifyTree(SWT.MouseMove,tree,treeItem);
+ notifyTree(SWT.Activate,tree,treeItem);
+ notifyTree(SWT.FocusIn,tree,treeItem);
+ notifyTree(SWT.MouseDown, createMouseEvent(x, y, 3, SWT.BUTTON3, 1, tree, treeItem),tree);
+ notifyTree(SWT.MouseUp,createMouseEvent(x, y, 3, SWT.BUTTON3, 1, tree, treeItem),tree);
+ notifyTree(SWT.Selection, createEvent(tree,treeItem),tree);
+ notifyTree(SWT.MouseHover,tree,treeItem);
+ notifyTree(SWT.MouseMove,tree,treeItem);
+ notifyTree(SWT.MouseExit,tree,treeItem);
+ notifyTree(SWT.Deactivate,tree,treeItem);
+ notifyTree(SWT.FocusOut,tree,treeItem);
+ }
+ /**
+ * Notify tree with Event of specified eventType
+ * @param eventType
+ * @param tree
+ * @param treeItem
+ */
+ private static void notifyTree(int eventType , Tree tree , TreeItem treeItem) {
+ Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = tree;
+ event.display = tree.getDisplay();
+ event.item = treeItem;
+ notify(eventType, event, tree);
+ }
+ /**
+ * Notify tree with Event of specified eventType
+ * @param eventType
+ * @param event
+ * @param tree
+ */
+ private static void notifyTree(int eventType , Event event , Tree tree) {
+ notify(eventType, event, tree);
+ }
+ /**
+ * Sends a non-blocking notification of the specified type to the widget.
+ *
+ * @param eventType the type of event.
+ * @param createEvent the event to be sent to the {@link #widget}.
+ * @param widget the widget to send the event to.
+ */
+ protected static void notify(final int eventType, final Event createEvent, final Widget widget) {
+ createEvent.type = eventType;
+ widget.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if ((widget == null) || widget.isDisposed()) {
+ return;
+ }
+ widget.notifyListeners(eventType, createEvent);
+ }
+ });
+ widget.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ // do nothing, just wait for sync.
+ }
+ });
+ }
+ /**
+ * Create a mouse event
+ *
+ * @param x the x co-ordinate of the mouse event.
+ * @param y the y co-ordinate of the mouse event.
+ * @param button the mouse button that was clicked.
+ * @param stateMask the state of the keyboard modifier keys.
+ * @param count the number of times the mouse was clicked.
+ * @return an event that encapsulates {@link #widget} and {@link #display}
+ * @since 1.2
+ */
+ protected static Event createMouseEvent(int x, int y, int button, int stateMask, int count, Tree tree , TreeItem treeItem) {
+ Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = tree;
+ event.display = tree.getDisplay();
+ event.x = x;
+ event.y = y;
+ event.button = button;
+ event.stateMask = stateMask;
+ event.count = count;
+ event.item = treeItem;
+ return event;
+ }
+ /**
+ * Create default Event for tree and treeItem
+ * @param tree
+ * @param treeItem
+ * @return
+ */
+ protected static Event createEvent(Tree tree, TreeItem treeItem) {
+ Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = tree;
+ event.display = tree.getDisplay();
+ event.item = treeItem;
+ return event;
+ }
+ /**
+ * Hide menu and all his parent menus
+ * @param menu
+ */
+ public static void hideMenuRecursively(final Menu menu){
+ menu.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ ContextMenuHelper.hide(menu);
+ menu.setVisible(false);
+ }
+ });
+ }
}
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 2010-08-12 14:12:33 UTC (rev 24102)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -140,6 +140,11 @@
public static final String COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER = "File Operation";
public static final String INSERT_TAG = "Insert Tag";
public static final String SHOW_HIDE_DRAWERS = "Show/Hide Drawers";
+ public static final String PALETTE_EDITOR = "Palette Editor";
+ public static final String CREATE_GROUP = "Create Group";
+ public static final String ADD_PALETTE_GROUP = "Add Palette Group";
+ public static final String ADD_PALETTE_MACRO = "Add Palette Macro";
+ public static final String CONFIRMATION = "Confirmation";
}
public class EntityGroup {
@@ -539,4 +544,36 @@
public static final String SHOW_HIDE_TOOL_ITEM = "Show/Hide";
}
+
+ public static class PaletteEditor{
+
+ public static final String XSTUDIO_NODE = "XStudio";
+ public static final String PALETTE_NODE = "Palette";
+ public static final String NEW_MENU_ITEM = "New";
+ public static final String CREATE_GROUP_MENU_ITEM = "Create Group...";
+ public static final String CREATE_MACRO_MENU_ITEM = "Create Macro...";
+ public static final String DELETE_MENU_ITEM = "Delete";
+
+ }
+
+ public static class CreateGroupDialog{
+
+ public static final String NAME = "Name*";
+
+ }
+
+ public static class AddPaletteGroupDialog{
+
+ public static final String NAME = "Name*";
+
+ }
+
+ public static class AddPaletteMacroDialog{
+
+ public static final String NAME = "Name*";
+ public static final String START_TEXT = "Start Text";
+ public static final String END_TEXT = "End Text";
+
+ }
+
}
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-08-12 14:12:33 UTC (rev 24102)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -19,7 +19,8 @@
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;
-import org.jboss.tools.vpe.ui.bot.test.palette.ManagePaletteGroups;
+import org.jboss.tools.vpe.ui.bot.test.palette.ManagePaletteGroupsTest;
+import org.jboss.tools.vpe.ui.bot.test.palette.PaletteEditorTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.EditorSynchronizationTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.JSPPageCreationTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.RenameFacesConfigFileTest;
@@ -60,8 +61,9 @@
suite.addTestSuite(ExternalizeStringsDialogTest.class);
suite.addTestSuite(JspFileEditingTest.class);
suite.addTestSuite(XhtmlFilePerformanceTest.class);
- suite.addTestSuite(ManagePaletteGroups.class);
-
+ suite.addTestSuite(ManagePaletteGroupsTest.class);
+ suite.addTestSuite(PaletteEditorTest.class);
+
return new TestSetup(suite);
}
}
Deleted: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroups.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroups.java 2010-08-12 14:12:33 UTC (rev 24102)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroups.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -1,72 +0,0 @@
-/*******************************************************************************
-
- * Copyright (c) 2007-2010 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.palette;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTBotExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
-/**
- * Tests Showing/hiding JBoss Tools Palette Groups
- * @author vlado pakan
- *
- */
-public class ManagePaletteGroups extends VPEAutoTestCase {
-
- private static final String TEST_PALETTE_GROUP_LABEL = "JSF HTML";
- private static final String TEST_PALETTE_TREE_GROUP_LABEL = "JSF";
-
- private SWTBotExt botExt = null;
-
- public ManagePaletteGroups() {
- super();
- botExt = new SWTBotExt();
- }
- public void testManagePaletteGroups(){
-
- openPage();
- openPalette();
- bot.toolbarButtonWithTooltip(IDELabel.JBossToolsPalette.SHOW_HIDE_TOOL_ITEM).click();
- SWTBot dialogBot = bot.shell(IDELabel.Shell.SHOW_HIDE_DRAWERS).activate().bot();
- SWTBotTreeItem tiTestPaletteGroup = dialogBot.tree().getTreeItem(ManagePaletteGroups.TEST_PALETTE_TREE_GROUP_LABEL);
- if (tiTestPaletteGroup.isChecked()){
- // Check Palette Group hiding
- tiTestPaletteGroup.uncheck();
- dialogBot.button("Ok").click();
- assertTrue("Palette Group " + ManagePaletteGroups.TEST_PALETTE_GROUP_LABEL +
- " has to be hidden but is visible.",
- !SWTBotWebBrowser.paletteContainsPaletteEntry(botExt, ManagePaletteGroups.TEST_PALETTE_GROUP_LABEL));
- }
- else{
- // Check Palette Group showing
- tiTestPaletteGroup.check();
- dialogBot.button("Ok").click();
- assertTrue("Palette Group " + ManagePaletteGroups.TEST_PALETTE_GROUP_LABEL +
- " has to be visible but is hidden.",
- SWTBotWebBrowser.paletteContainsPaletteEntry(botExt, ManagePaletteGroups.TEST_PALETTE_GROUP_LABEL));
- }
-
-
- }
- @Override
- protected void closeUnuseDialogs() {
-
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- return false;
- }
-
-}
Copied: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroupsTest.java (from rev 24005, trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroups.java)
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroupsTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroupsTest.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 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.palette;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests Showing/hiding JBoss Tools Palette Groups
+ * @author vlado pakan
+ *
+ */
+public class ManagePaletteGroupsTest extends VPEAutoTestCase {
+
+ private static final String TEST_PALETTE_GROUP_LABEL = "JSF HTML";
+ private static final String TEST_PALETTE_TREE_GROUP_LABEL = "JSF";
+
+ private SWTBotExt botExt = null;
+
+ public ManagePaletteGroupsTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+ public void testManagePaletteGroups(){
+
+ openPage();
+ openPalette();
+ bot.toolbarButtonWithTooltip(IDELabel.JBossToolsPalette.SHOW_HIDE_TOOL_ITEM).click();
+ SWTBot dialogBot = bot.shell(IDELabel.Shell.SHOW_HIDE_DRAWERS).activate().bot();
+ SWTBotTreeItem tiTestPaletteGroup = dialogBot.tree().getTreeItem(ManagePaletteGroupsTest.TEST_PALETTE_TREE_GROUP_LABEL);
+ if (tiTestPaletteGroup.isChecked()){
+ // Check Palette Group hiding
+ tiTestPaletteGroup.uncheck();
+ dialogBot.button("Ok").click();
+ assertTrue("Palette Group " + ManagePaletteGroupsTest.TEST_PALETTE_GROUP_LABEL +
+ " has to be hidden but is visible.",
+ !SWTBotWebBrowser.paletteContainsPaletteEntry(botExt, ManagePaletteGroupsTest.TEST_PALETTE_GROUP_LABEL));
+ }
+ else{
+ // Check Palette Group showing
+ tiTestPaletteGroup.check();
+ dialogBot.button("Ok").click();
+ assertTrue("Palette Group " + ManagePaletteGroupsTest.TEST_PALETTE_GROUP_LABEL +
+ " has to be visible but is hidden.",
+ SWTBotWebBrowser.paletteContainsPaletteEntry(botExt, ManagePaletteGroupsTest.TEST_PALETTE_GROUP_LABEL));
+ }
+
+
+ }
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ManagePaletteGroupsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/PaletteEditorTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/PaletteEditorTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/PaletteEditorTest.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -0,0 +1,132 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 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.palette;
+
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests Palette Editor
+ * @author vlado pakan
+ *
+ */
+public class PaletteEditorTest extends VPEAutoTestCase {
+ private SWTBotExt botExt = null;
+
+ public PaletteEditorTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+
+ public void testPaletteEditor(){
+ openPage();
+ openPalette();
+ // add First Palette Group
+ bot.toolbarButtonWithTooltip(IDELabel.JBossToolsPalette.PALETTE_EDITOR_TOOL_ITEM).click();
+ SWTBot palettEditorBot = bot.shell(IDELabel.Shell.PALETTE_EDITOR).activate().bot();
+ SWTBotTree tree = palettEditorBot.tree();
+ SWTBotTreeItem tiPalette = tree.expandNode(IDELabel.PaletteEditor.XSTUDIO_NODE)
+ .getNode(IDELabel.PaletteEditor.PALETTE_NODE)
+ .select();
+ ContextMenuHelper.treeRightClick(tree.widget, tiPalette.widget);
+ Menu menu = ContextMenuHelper.getTreeMenuViaReflections(tree.widget,IDELabel.PaletteEditor.NEW_MENU_ITEM);
+ ContextMenuHelper.clickContextMenu(menu,
+ IDELabel.PaletteEditor.NEW_MENU_ITEM,
+ IDELabel.PaletteEditor.CREATE_GROUP_MENU_ITEM);
+ ContextMenuHelper.hideMenuRecursively(menu);
+ SWTBot createGroupDialogBot = bot.shell(IDELabel.Shell.CREATE_GROUP).activate().bot();
+ final String firstGroup = "First";
+ createGroupDialogBot.textWithLabel(IDELabel.CreateGroupDialog.NAME).setText(firstGroup);
+ createGroupDialogBot.button(IDELabel.Button.FINISH).click();
+ // add Second Inner Palette Group
+ SWTBotTreeItem tiFirstGroup = tree.expandNode(IDELabel.PaletteEditor.XSTUDIO_NODE)
+ .expandNode(IDELabel.PaletteEditor.PALETTE_NODE)
+ .expandNode(firstGroup)
+ .select();
+ ContextMenuHelper.treeRightClick(tree.widget, tiFirstGroup.widget);
+ menu = ContextMenuHelper.getTreeMenuViaReflections(tree.widget,IDELabel.PaletteEditor.CREATE_GROUP_MENU_ITEM);
+ ContextMenuHelper.clickContextMenu(menu,
+ IDELabel.PaletteEditor.CREATE_GROUP_MENU_ITEM);
+ ContextMenuHelper.hideMenuRecursively(menu);
+ SWTBot addPaletteGroupBot = bot.shell(IDELabel.Shell.ADD_PALETTE_GROUP).activate().bot();
+ final String secondGroup = "Second";
+ addPaletteGroupBot.textWithLabel(IDELabel.AddPaletteGroupDialog.NAME).setText(secondGroup);
+ addPaletteGroupBot.button(IDELabel.Button.FINISH).click();
+ // add Macro
+ SWTBotTreeItem tiSecondGroup = tree.expandNode(IDELabel.PaletteEditor.XSTUDIO_NODE)
+ .expandNode(IDELabel.PaletteEditor.PALETTE_NODE)
+ .expandNode(firstGroup)
+ .expandNode(secondGroup)
+ .select();
+ ContextMenuHelper.treeRightClick(tree.widget, tiSecondGroup.widget);
+ menu = ContextMenuHelper.getTreeMenuViaReflections(tree.widget,IDELabel.PaletteEditor.NEW_MENU_ITEM);
+ ContextMenuHelper.clickContextMenu(menu,
+ IDELabel.PaletteEditor.NEW_MENU_ITEM,
+ IDELabel.PaletteEditor.CREATE_MACRO_MENU_ITEM);
+ ContextMenuHelper.hideMenuRecursively(menu);
+ SWTBot addPaletteMacroBot = bot.shell(IDELabel.Shell.ADD_PALETTE_MACRO).activate().bot();
+ final String macroName = "Test Macro";
+ addPaletteMacroBot.textWithLabel(IDELabel.AddPaletteMacroDialog.NAME).setText(macroName);
+ final String startText = "<HTML>";
+ addPaletteMacroBot.textWithLabel(IDELabel.AddPaletteMacroDialog.START_TEXT).setText(startText);
+ final String endText = "</HTML>";
+ addPaletteMacroBot.textWithLabel(IDELabel.AddPaletteMacroDialog.END_TEXT).setText(endText);
+ addPaletteMacroBot.button(IDELabel.Button.FINISH).click();
+ palettEditorBot.button(IDELabel.Button.OK).click();
+ //add Test Macro to Page Source
+ final SWTBotEclipseEditor jspTextEditor = botExt.editorByTitle(TEST_PAGE)
+ .toTextEditor();
+ final String originalText = jspTextEditor.getText();
+ jspTextEditor.setFocus();
+ jspTextEditor.insertText(0, 0, "\n");
+ jspTextEditor.insertText(0, 0, "");
+ SWTBotWebBrowser.activatePaletteTool(botExt,macroName);
+ // Check if Macro was added to Source Editor
+ String insertedText = jspTextEditor.getTextOnCurrentLine().trim();
+ assertTrue("Inserted text has to be '" + startText + endText +
+ "' and was '" + insertedText + "'",
+ insertedText.equals(startText + endText));
+ jspTextEditor.setText(originalText);
+ jspTextEditor.saveAndClose();
+ // Delete New Group From Palette
+ bot.toolbarButtonWithTooltip(IDELabel.JBossToolsPalette.PALETTE_EDITOR_TOOL_ITEM).click();
+ palettEditorBot = bot.shell(IDELabel.Shell.PALETTE_EDITOR).activate().bot();
+ tree = palettEditorBot.tree();
+ tiFirstGroup = tree.expandNode(IDELabel.PaletteEditor.XSTUDIO_NODE)
+ .expandNode(IDELabel.PaletteEditor.PALETTE_NODE)
+ .expandNode(firstGroup)
+ .select();
+ ContextMenuHelper.treeRightClick(tree.widget, tiFirstGroup.widget);
+ menu = ContextMenuHelper.getTreeMenuViaReflections(tree.widget,IDELabel.PaletteEditor.CREATE_GROUP_MENU_ITEM);
+ ContextMenuHelper.clickContextMenu(menu,
+ IDELabel.PaletteEditor.DELETE_MENU_ITEM);
+ SWTBot deleteDialogBot = bot.shell(IDELabel.Shell.CONFIRMATION).activate().bot();
+ deleteDialogBot.button(IDELabel.Button.OK).click();
+ palettEditorBot.button(IDELabel.Button.OK).click();
+ }
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/PaletteEditorTest.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/tools/SWTBotWebBrowser.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2010-08-12 14:12:33 UTC (rev 24102)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2010-08-12 14:13:17 UTC (rev 24103)
@@ -29,7 +29,6 @@
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.eclipse.gef.finder.finders.PaletteFinder;
import org.eclipse.swtbot.eclipse.gef.finder.matchers.ToolEntryLabelMatcher;
-import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
@@ -435,6 +434,15 @@
*/
public void activatePaletteTool (String toolLabel){
+ SWTBotWebBrowser.activatePaletteTool(bot,toolLabel);
+
+ }
+ /**
+ * Activate JBoss Tools Palette Tool with specified Label static version
+ * @param toolLabel
+ */
+ public static void activatePaletteTool (SWTBotExt bot , String toolLabel){
+
PaletteViewer paletteViewer = SWTBotWebBrowser.getPaletteViewer(bot);
PaletteEntry peJsfHtml = SWTBotWebBrowser.getPaletteEntry(paletteViewer , toolLabel);
paletteViewer.setActiveTool((ToolEntry) peJsfHtml);
15 years, 8 months
JBoss Tools SVN: r24102 - in branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: input and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-08-12 10:12:33 -0400 (Thu, 12 Aug 2010)
New Revision: 24102
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputReaderConfigurationContributor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputSourceType.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InvalidInputSourceTypeException.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/Messages.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/contributors/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/contributors/SimpleMessageContributor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/messages.properties
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6823
Tidy up the input type /reader type selection handling
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2010-08-12 13:55:36 UTC (rev 24101)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2010-08-12 14:12:33 UTC (rev 24102)
@@ -87,7 +87,9 @@
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.smooks.configuration.SmooksModelUtils;
+import org.jboss.tools.smooks.configuration.editors.input.InputSourceType;
import org.jboss.tools.smooks.configuration.editors.input.InputType;
+import org.jboss.tools.smooks.configuration.editors.input.InvalidInputSourceTypeException;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard;
import org.jboss.tools.smooks.configuration.editors.wizard.StructuredDataSelectionWizard;
@@ -150,7 +152,6 @@
private CheckboxTableViewer inputDataViewer;
private TreeViewer inputModelViewer;
private Combo readerCombo;
- private List<Object> readerTypeList = new ArrayList<Object>();
private Composite readerConfigComposite;
// private ModelPanelCreator modelPanelCreator;
protected boolean lockCheck = false;
@@ -361,33 +362,20 @@
}
private void initReaderConfigSection() {
- Object reader = getCurrentReaderModel();
ISmooksModelProvider provider = getSmooksModelProvider();
- if (provider == null)
+
+ if (provider == null) {
return;
- String type = provider.getInputType();
- if (reader instanceof EObject && type != null) {
-// SmooksResourceListType list = getSmooksConfigResourceList();
-// createReaderPanel((EObject) list.getAbstractReader().get(0));
- } else {
- disposeCompositeControls(readerConfigComposite, null);
- createSimpleReaderPanel(reader);
}
+
+ addInputConfigControls();
}
- private void createSimpleReaderPanel(Object reader){
- Label formText = this.getManagedForm().getToolkit().createLabel(readerConfigComposite, ""); //$NON-NLS-1$
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 50;
- gd.horizontalSpan = 2;
- formText.setLayoutData(gd);
- if (reader instanceof XMLReader || reader instanceof JavaReader || reader instanceof XSDReader) {
- formText.setText(Messages.SmooksReaderFormPage_Warning_Specify_Sample_Data);
- }
-
- if (reader instanceof NullReader) {
- formText.setText(Messages.SmooksReaderFormPage_Warning_Specify_Input_Type);
- }
+ private void addInputConfigControls() {
+ disposeCompositeControls(readerConfigComposite, null);
+
+ getCurrentInputType().getConfigurationContributor().addInputConfigControls(this, readerConfigComposite);
+
readerConfigComposite.layout();
scrolledPageBook.reflow(false);
}
@@ -410,13 +398,16 @@
}
}
- private Object getCurrentReaderModel() {
- if (readerCombo == null || readerCombo.isDisposed())
- return null;
- int index = readerCombo.getSelectionIndex();
- if (index < 0)
- return null;
- return readerTypeList.get(index);
+ private InputSourceType getCurrentInputType() {
+ if (readerCombo == null || readerCombo.isDisposed()) {
+ return InputSourceType.NONE;
+ }
+
+ try {
+ return InputSourceType.fromTypeIndex(readerCombo.getSelectionIndex());
+ } catch (InvalidInputSourceTypeException e) {
+ return InputSourceType.NONE;
+ }
}
protected void createInputDataSection(FormToolkit toolkit, Composite parent) {
@@ -450,7 +441,7 @@
inputDataViewer.setCheckStateProvider(new ICheckStateProvider() {
public boolean isGrayed(Object element) {
- return isIncorrectInputType((InputType) element);
+ return !isValidInputType((InputType) element);
}
public boolean isChecked(Object element) {
@@ -467,7 +458,7 @@
return;
boolean checked = event.getChecked();
InputType inputType = (InputType) event.getElement();
- if (isIncorrectInputType(inputType)) {
+ if (!isValidInputType(inputType)) {
lockCheck = true;
inputDataViewer.setChecked(inputType, false);
lockCheck = false;
@@ -707,40 +698,20 @@
return getSmooksModelProvider().getSmooksModel();
}
- protected boolean isIncorrectInputType(InputType element) {
- if (element == null)
- return false;
- if (element instanceof InputType) {
- String type = ((InputType) element).getType();
- int index = readerCombo.getSelectionIndex();
- if (index == -1)
- return true;
+ protected boolean isValidInputType(InputType element) {
+ if (element == null) {
+ // not specified is OK...
+ return true;
+ }
+
+ String type = element.getType();
+ int selectionIndex = readerCombo.getSelectionIndex();
- Object reader = readerTypeList.get(index);
- if (reader instanceof NullReader) {
- return true;
- }
- if (reader instanceof XMLReader || reader instanceof XSDReader || reader instanceof JavaReader) {
-
- }
-
- if (reader instanceof XMLReader) {
- if (!SmooksModelUtils.INPUT_TYPE_XML.equals(type)) {
- return true;
- }
- }
- if (reader instanceof XSDReader) {
- if (!SmooksModelUtils.INPUT_TYPE_XSD.equals(type)) {
- return true;
- }
- }
- if (reader instanceof JavaReader) {
- if (!SmooksModelUtils.INPUT_TYPE_JAVA.equals(type)) {
- return true;
- }
- }
+ try {
+ return InputSourceType.isValidIndexNamePair(selectionIndex, type);
+ } catch (InvalidInputSourceTypeException e) {
+ return false;
}
- return false;
}
@@ -783,16 +754,11 @@
return;
readerCombo.removeAll();
- readerTypeList.clear();
- readerCombo.add(Messages.SmooksReaderFormPage_NoInputComboText);
- readerTypeList.add(new NullReader());
- readerCombo.add(Messages.SmooksReaderFormPage_XMLReaderComboText);
- readerTypeList.add(new XMLReader());
- readerCombo.add(Messages.SmooksReaderFormPage_JavaReaderComboText);
- readerTypeList.add(new JavaReader());
- readerCombo.add(Messages.SmooksReaderFormPage_XSDReaderComboText);
- readerTypeList.add(new XSDReader());
+ readerCombo.add(Messages.SmooksReaderFormPage_NoInputComboText, InputSourceType.NONE.getTypeIndex());
+ readerCombo.add(Messages.SmooksReaderFormPage_XMLReaderComboText, InputSourceType.XML.getTypeIndex());
+ readerCombo.add(Messages.SmooksReaderFormPage_XSDReaderComboText, InputSourceType.XSD.getTypeIndex());
+ readerCombo.add(Messages.SmooksReaderFormPage_JavaReaderComboText, InputSourceType.JAVA.getTypeIndex());
}
private void initReaderCombo() {
@@ -809,45 +775,22 @@
String inputType = modelProvider.getInputType();
if (inputType == null) {
- readerCombo.select(0);
+ readerCombo.select(InputSourceType.NONE.getTypeIndex());
return;
-// // for the first time to open the file.
-// List<IComponent> compoenents = model.getModelRoot().getComponents();
-// for (Iterator<?> iterator = compoenents.iterator(); iterator.hasNext();) {
-// IComponent component = (IComponent) iterator.next();
-// }
-// if (rlist.getAbstractReader().isEmpty()) {
-// readerCombo.select(0);
-// return;
-// } else {
-// }
}
- if (SmooksModelUtils.INPUT_TYPE_XML.equals(inputType)) {
- readerCombo.select(1);
+
+ try {
+ readerCombo.select(InputSourceType.fromTypeName(inputType).getTypeIndex());
+ } catch (InvalidInputSourceTypeException e) {
+ readerCombo.select(InputSourceType.NONE.getTypeIndex());
}
- if (SmooksModelUtils.INPUT_TYPE_JAVA.equals(inputType)) {
- readerCombo.select(2);
- }
- if (SmooksModelUtils.INPUT_TYPE_XSD.equals(inputType)) {
- readerCombo.select(3);
- }
- return;
}
private void handleReaderCombo(final Combo combo) {
combo.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
- Object newreader = getCurrentReaderModel();
- if (newreader == null)
- return;
- // String type = getCurrentReaderType();
- // if (type == null) {
- // getSmooksGraphicsExtType().eUnset(GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__INPUT_TYPE);
- // } else {
- // getSmooksGraphicsExtType().setInputType(type);
- // }
- readerChanged(newreader);
+ readerChanged();
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -857,43 +800,9 @@
});
}
- private String getCurrentReaderType() {
- Object reader = getCurrentReaderModel();
- return getReaderType(reader);
- }
-
- private String getReaderType(Object reader) {
- if (reader instanceof XMLReader) {
- return SmooksModelUtils.INPUT_TYPE_XML;
- }
- if (reader instanceof JavaReader) {
- return SmooksModelUtils.INPUT_TYPE_JAVA;
- }
- if (reader instanceof XSDReader) {
- return SmooksModelUtils.INPUT_TYPE_XSD;
- }
- if (reader instanceof EObject) {
- Object obj = ((EObject) reader);
+ private void readerChanged() {
-// if (obj instanceof CSV12Reader) {
-// return SmooksModelUtils.INPUT_TYPE_CSV;
-// }
-// if (obj instanceof EDI12Reader) {
-// return SmooksModelUtils.INPUT_TYPE_EDI_1_1;
-// }
-// if (obj instanceof Json12Reader) {
-// return SmooksModelUtils.INPUT_TYPE_JSON_1_1;
-// }
-// if (obj instanceof ReaderType) {
-// return SmooksModelUtils.INPUT_TYPE_CUSTOME;
-// }
- }
- return null;
- }
-
- private void readerChanged(Object reader) {
-
- String type = getCurrentReaderType();
+ String type = getCurrentInputType().toTypeString();
String oldType = this.getSmooksModelProvider().getInputType();
if (type == null && oldType == null) {
@@ -917,8 +826,7 @@
compoundCommand.append(addparamsCommand);
}
- IParam param = SmooksUIUtils
- .getInputTypeParam(getSmooksConfigResourceList().getModelRoot());
+ IParam param = SmooksUIUtils.getInputTypeParam(getSmooksConfigResourceList().getModelRoot());
if (param == null) {
// add new one
param = ICoreFactory.eINSTANCE.createParam();
@@ -946,29 +854,12 @@
if (removeCommand != null && removeCommand.canExecute()) {
compoundCommand.append(removeCommand);
}
- if (readerConfigComposite != null) {
- disposeCompositeControls(readerConfigComposite, null);
- scrolledPageBook.reflow(true);
- }
- if (reader instanceof EObject) {
-// Object obj = ((EObject) reader);
-// obj = AdapterFactoryEditingDomain.unwrap(obj);
-// Command command = AddCommand.create(getEditingDomain(), getSmooksConfigResourceList(),
-// SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__ABSTRACT_READER_GROUP, createReaderEntry(obj,
-// false));
-// if (command.canExecute()) {
-// compoundCommand.append(command);
-// }
- } else {
- createSimpleReaderPanel(reader);
- }
+ addInputConfigControls();
+
deactiveAllInputFile(compoundCommand);
if (!compoundCommand.isEmpty() && compoundCommand.canExecute()) {
getEditingDomain().getCommandStack().execute(compoundCommand);
- if (reader != null && reader instanceof EObject) {
-// createReaderPanel(((EObject) reader));
- }
}
if (inputDataViewer != null) {
@@ -1095,34 +986,18 @@
public void sourceChange(Object model) {
}
-
- private class NullReader {
-
- }
-
- private class XMLReader {
-
- }
-
- private class XSDReader {
-
- }
-
- private class JavaReader {
-
- }
private class InputDataViewerLabelProvider extends ExtentionInputLabelProvider implements ITableColorProvider {
public Color getBackground(Object element, int columnIndex) {
- if (isIncorrectInputType((InputType) element)) {
+ if (!isValidInputType((InputType) element)) {
// return ColorConstants.darkGray;
}
return null;
}
public Color getForeground(Object element, int columnIndex) {
- if (isIncorrectInputType((InputType) element)) {
+ if (!isValidInputType((InputType) element)) {
return ColorConstants.lightGray;
}
return null;
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputReaderConfigurationContributor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputReaderConfigurationContributor.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputReaderConfigurationContributor.java 2010-08-12 14:12:33 UTC (rev 24102)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.input;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.editor.FormPage;
+
+/**
+ *
+ * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
+ */
+public interface InputReaderConfigurationContributor {
+
+ /**
+ * Add the input configuration controls to the Input Configuration area
+ * of the input task panel.
+ * @param formPage The composite parent {@link FormPage}.
+ * @param configComposite The task panel Composite.
+ */
+ void addInputConfigControls(FormPage formPage, Composite configComposite);
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputReaderConfigurationContributor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputSourceType.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputSourceType.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputSourceType.java 2010-08-12 14:12:33 UTC (rev 24102)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.input;
+
+import org.jboss.tools.smooks.configuration.editors.input.contributors.SimpleMessageContributor;
+
+/**
+ * Smooks filter input Source type.
+ *
+ * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
+ */
+public enum InputSourceType {
+
+ // NOTE: If a new type is added, be sure and update the fromTypeIndex/fromTypeName static methods !!!
+ NONE(0, new SimpleMessageContributor(Messages.InputSourceType_Warning_Specify_Input_Type)),
+ XML(1, new SimpleMessageContributor(Messages.InputSourceType_Warning_Specify_Sample_Data)),
+ XSD(2, new SimpleMessageContributor(Messages.InputSourceType_Warning_Specify_Sample_Data)),
+ JAVA(3, new SimpleMessageContributor(Messages.InputSourceType_Warning_Specify_Sample_Data));
+
+ private int typeIndex;
+ private InputReaderConfigurationContributor configurationContributor;
+
+ InputSourceType(int typeIndex, InputReaderConfigurationContributor configurationContributor) {
+ this.typeIndex = typeIndex;
+ this.configurationContributor = configurationContributor;
+ }
+
+ public int getTypeIndex() {
+ return typeIndex;
+ }
+
+ public InputReaderConfigurationContributor getConfigurationContributor() {
+ return configurationContributor;
+ }
+
+ public boolean isType(int typeIndex) {
+ return (this.typeIndex == typeIndex);
+ }
+
+ public boolean isType(String typeString) {
+ return (name().equals(typeString) || toTypeString().equals(typeString));
+ }
+
+ public String toTypeString() {
+ return ("input." + name().toLowerCase());
+ }
+
+ public static InputSourceType fromTypeIndex(int typeIndex) throws InvalidInputSourceTypeException {
+
+ if(InputSourceType.XML.isType(typeIndex)) {
+ return InputSourceType.XML;
+ } else if(InputSourceType.XSD.isType(typeIndex)) {
+ return InputSourceType.XSD;
+ } else if(InputSourceType.JAVA.isType(typeIndex)) {
+ return InputSourceType.JAVA;
+ } else if(InputSourceType.NONE.isType(typeIndex)) {
+ return InputSourceType.NONE;
+ }
+
+ throw new InvalidInputSourceTypeException("");
+ }
+
+ public static InputSourceType fromTypeName(String typeName) throws InvalidInputSourceTypeException {
+
+ if(InputSourceType.XML.isType(typeName)) {
+ return InputSourceType.XML;
+ } else if(InputSourceType.XSD.isType(typeName)) {
+ return InputSourceType.XSD;
+ } else if(InputSourceType.JAVA.isType(typeName)) {
+ return InputSourceType.JAVA;
+ } else if(InputSourceType.NONE.isType(typeName)) {
+ return InputSourceType.NONE;
+ }
+
+ throw new InvalidInputSourceTypeException("");
+ }
+
+ public static boolean isValidIndexNamePair(int typeIndex, String typeName) throws InvalidInputSourceTypeException {
+ return (fromTypeIndex(typeIndex) == fromTypeName(typeName));
+ }
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InputSourceType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InvalidInputSourceTypeException.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InvalidInputSourceTypeException.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InvalidInputSourceTypeException.java 2010-08-12 14:12:33 UTC (rev 24102)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.input;
+
+/**
+ * Invalid Input Source Type Exception.
+ *
+ * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
+ */
+public class InvalidInputSourceTypeException extends Exception {
+
+ public InvalidInputSourceTypeException(String message) {
+ super(message);
+ }
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/InvalidInputSourceTypeException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/Messages.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/Messages.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/Messages.java 2010-08-12 14:12:33 UTC (rev 24102)
@@ -0,0 +1,17 @@
+package org.jboss.tools.smooks.configuration.editors.input;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ public static String InputSourceType_Warning_Specify_Input_Type;
+ public static String InputSourceType_Warning_Specify_Sample_Data;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(Messages.class.getPackage().getName() + ".messages", Messages.class); //$NON-NLS-1$
+ }
+
+ private Messages() {
+ }
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/Messages.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/contributors/SimpleMessageContributor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/contributors/SimpleMessageContributor.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/contributors/SimpleMessageContributor.java 2010-08-12 14:12:33 UTC (rev 24102)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.input.contributors;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.jboss.tools.smooks.configuration.editors.input.InputReaderConfigurationContributor;
+
+/**
+ * Simple contributor used to add a "No type selected" warning message to the composite.
+ *
+ * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
+ */
+public class SimpleMessageContributor implements InputReaderConfigurationContributor {
+
+ private String message;
+
+ public SimpleMessageContributor(String message) {
+ this.message = message;
+ }
+
+ public void addInputConfigControls(FormPage formPage, Composite configComposite) {
+ Label formText = formPage.getManagedForm().getToolkit().createLabel(configComposite, ""); //$NON-NLS-1$
+ GridData gd = new GridData(GridData.FILL_BOTH);
+
+ gd.heightHint = 50;
+ gd.horizontalSpan = 2;
+ formText.setLayoutData(gd);
+ formText.setText(message);
+ }
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/contributors/SimpleMessageContributor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/messages.properties
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/messages.properties (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/input/messages.properties 2010-08-12 14:12:33 UTC (rev 24102)
@@ -0,0 +1,2 @@
+InputSourceType_Warning_Specify_Input_Type=Input type should be specified.
+InputSourceType_Warning_Specify_Sample_Data=Specify sample data in the Input Data section.
\ No newline at end of file
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties 2010-08-12 13:55:36 UTC (rev 24101)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties 2010-08-12 14:12:33 UTC (rev 24102)
@@ -76,4 +76,4 @@
SmooksReaderFormPage_Warning_Specify_Input_Type=Input type should be specified.
SmooksReaderFormPage_Warning_Specify_Sample_Data=Specify sample data in the Input Data section.
SmooksReaderFormPage_XMLReaderComboText=XML
-SmooksReaderFormPage_XSDReaderComboText=XSD/WSDL
+SmooksReaderFormPage_XSDReaderComboText=XSD
15 years, 8 months
JBoss Tools SVN: r24101 - in branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2010-08-12 09:55:36 -0400 (Thu, 12 Aug 2010)
New Revision: 24101
Modified:
branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template
branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java
Log:
JBIDE-6651
Modified: branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template
===================================================================
--- branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template 2010-08-12 13:09:12 UTC (rev 24100)
+++ branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template 2010-08-12 13:55:36 UTC (rev 24101)
@@ -10,7 +10,7 @@
public void testSimpleProcess() throws Exception {
// Extract a process definition from the processdefinition.xml file.
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple/processdefinition.xml");
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple.jpdl.xml");
assertNotNull("Definition should not be null", processDefinition);
// Create an instance of the process definition.
Modified: branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java
===================================================================
--- branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java 2010-08-12 13:09:12 UTC (rev 24100)
+++ branches/jbosstools-3.1.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java 2010-08-12 13:55:36 UTC (rev 24101)
@@ -264,7 +264,7 @@
// if (!processesFolder.exists()) {
// processesFolder.create(true, true, null);
// }
- IFolder folder = javaProject.getProject().getFolder("src/main/jpdl/simple");
+ IFolder folder = javaProject.getProject().getFolder("src/main/jpdl");
if (!folder.exists()) {
folder.create(true, true, null);
}
@@ -279,11 +279,21 @@
File fromDir = new File(fromPath);
if (!fromDir.exists()) return;
File[] files = fromDir.listFiles();
+ IFile destination = null;
for (int i = 0; i < files.length; i++) {
- copyJbpmResource(files[i], folder);
+ if ("processdefinition.xml".equals(files[i].getName())) {
+ destination = folder.getFile("simple.jpdl.xml");
+ } else if ("gpd.xml".equals(files[i].getName())) {
+ destination = folder.getFile(".simple.gpd.xml");
+ } else if ("processimage.jpg".equals(files[i].getName())) {
+ destination = folder.getFile("simple.jpg");
+ }
+ if (destination != null) {
+ destination.create(new FileInputStream(files[i]), true, null);
+ }
}
}
-
+
private void createSimpleProcessTest(IJavaProject javaProject) throws JavaModelException, IOException {
String resourceName = "org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template";
IFolder folder = javaProject.getProject().getFolder("src/test/java");
15 years, 8 months
JBoss Tools SVN: r24100 - in trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2010-08-12 09:09:12 -0400 (Thu, 12 Aug 2010)
New Revision: 24100
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java
Log:
JBIDE-6651
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template 2010-08-12 12:44:46 UTC (rev 24099)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template 2010-08-12 13:09:12 UTC (rev 24100)
@@ -10,7 +10,7 @@
public void testSimpleProcess() throws Exception {
// Extract a process definition from the processdefinition.xml file.
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple/processdefinition.xml");
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple.jpdl.xml");
assertNotNull("Definition should not be null", processDefinition);
// Create an instance of the process definition.
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java 2010-08-12 12:44:46 UTC (rev 24099)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessProjectWizard.java 2010-08-12 13:09:12 UTC (rev 24100)
@@ -266,7 +266,7 @@
// if (!processesFolder.exists()) {
// processesFolder.create(true, true, null);
// }
- IFolder folder = javaProject.getProject().getFolder("src/main/jpdl/simple");
+ IFolder folder = javaProject.getProject().getFolder("src/main/jpdl");
if (!folder.exists()) {
folder.create(true, true, null);
}
@@ -281,11 +281,21 @@
File fromDir = new File(fromPath);
if (!fromDir.exists()) return;
File[] files = fromDir.listFiles();
+ IFile destination = null;
for (int i = 0; i < files.length; i++) {
- copyJbpmResource(files[i], folder);
+ if ("processdefinition.xml".equals(files[i].getName())) {
+ destination = folder.getFile("simple.jpdl.xml");
+ } else if ("gpd.xml".equals(files[i].getName())) {
+ destination = folder.getFile(".simple.gpd.xml");
+ } else if ("processimage.jpg".equals(files[i].getName())) {
+ destination = folder.getFile("simple.jpg");
+ }
+ if (destination != null) {
+ destination.create(new FileInputStream(files[i]), true, null);
+ }
}
}
-
+
private void createSimpleProcessTest(IJavaProject javaProject) throws JavaModelException, IOException {
String resourceName = "org/jbpm/gd/jpdl/resource/SimpleProcessTest.java.template";
IFolder folder = javaProject.getProject().getFolder("src/test/java");
15 years, 8 months
JBoss Tools SVN: r24099 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-08-12 08:44:46 -0400 (Thu, 12 Aug 2010)
New Revision: 24099
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-6822
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-08-12 12:39:02 UTC (rev 24098)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-08-12 12:44:46 UTC (rev 24099)
@@ -822,9 +822,11 @@
if(dataModelName==null) {
// here must be the only one @DataModel in the component
Set<IBijectedAttribute> dataBinders = declaration.getBijectedAttributesByType(BijectedAttributeType.DATA_BINDER);
+ ITextSourceReference location = null;
if(dataBinders!=null && dataBinders.size()>1) {
for (IBijectedAttribute dataBinder : dataBinders) {
- addError(SeamValidationMessages.MULTIPLE_DATA_BINDER, SeamPreferences.MULTIPLE_DATA_BINDER, dataBinder, declaration.getResource());
+ location = dataBinder.getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ addError(SeamValidationMessages.MULTIPLE_DATA_BINDER, SeamPreferences.MULTIPLE_DATA_BINDER, location, declaration.getResource());
}
}
} else {
15 years, 8 months
JBoss Tools SVN: r24098 - trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-08-12 08:39:02 -0400 (Thu, 12 Aug 2010)
New Revision: 24098
Modified:
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/FocusPointTest.java
Log:
[JBIDE-6376] focuspoint test for 1 level added
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/FocusPointTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/FocusPointTest.java 2010-08-12 12:20:53 UTC (rev 24097)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/FocusPointTest.java 2010-08-12 12:39:02 UTC (rev 24098)
@@ -10,6 +10,7 @@
private static final String root = "root";
private static final String child1 = "child1";
private static final String URI_SEPARATOR_ENCODED = EncodingUtils.checkedEncodeUtf8(FocusPoint.URI_SEPARATOR);
+ private static final String TITLE_SEPARATOR_ENCODED = EncodingUtils.checkedEncodeUtf8(FocusPoint.TITLE_SEPARATOR);
public void testGetContentURI_Simple() throws Exception {
FocusPoint focusPoint = new FocusPoint(root);
@@ -31,4 +32,12 @@
assertNotNull(contentTitle);
assertEquals(root, contentTitle);
}
+
+ public void testGetContentTitle_OneLevel() throws Exception {
+ FocusPoint focusPoint = new FocusPoint(root).setChild(new FocusPoint(child1));
+ String contentTitle = focusPoint.getContentTitle();
+ assertNotNull(contentTitle);
+ assertEquals(root + TITLE_SEPARATOR_ENCODED + child1, contentTitle);
+ }
+
}
15 years, 8 months
JBoss Tools SVN: r24097 - in trunk/jsf: plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-08-12 08:20:53 -0400 (Thu, 12 Aug 2010)
New Revision: 24097
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/util/JSF2ResourceUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/JSF2ComponentsValidatorTest.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
https://jira.jboss.org/browse/JBIDE-6685
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/util/JSF2ResourceUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/util/JSF2ResourceUtil.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/util/JSF2ResourceUtil.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -51,6 +51,8 @@
public static final String COMPONENT_RESOURCE_PATH_KEY = "component_resource_path_key"; //$NON-NLS-1$
+ public static final String JSF2_COMPONENT_NAME = "jsf2_resource_name"; //$NON-NLS-1$
+
public static final int JAR_FILE_RESOURCE_TYPE = 1;
public static final int JAR_DIRECTORY_RESOURCE_TYPE = JAR_FILE_RESOURCE_TYPE << 1;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2010-08-12 12:20:53 UTC (rev 24097)
@@ -100,11 +100,11 @@
DeleteManagedBeanHandler_Failure=Failure
DeleteManagedPropertyHandler_Delete=Delete {0}
DeleteManagedPropertyHandler_DeleteJavaProperty=Delete java property
-Create_JSF_2_Composite_Component=Create JSF 2 composite component in a project resources folder
+Create_JSF_2_Composite_Component=Create JSF 2 composite component named "{0}" in "{1}"
Missing_JSF_2_Composite_Component=Composite component "{0}" was not found in a project resources directory
Missing_JSF_2_Component_Attr=Attribute "{0}" is not defined for "{1}" composite component
Create_JSF_2_Interface_Attr=Create attribute in an interface declaration of a composite component
-Missing_JSF_2_Resources_Folder=Resources folder "{0}" is missing in a project root directory
+Missing_JSF_2_Resources_Folder=JSF 2 Resources folder "{0}" is missing in a project root directory
Create_JSF_2_Resources_Folder=Create a folder container for JSF 2 resources
Rename_JSF_2_Composite_Components=Rename JSF 2 composite components
Refactoring_JSF_2_resources=Refactoring JSF 2 resources
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -110,6 +110,7 @@
component.getType());
message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
component.getComponentResourceLocation());
+ message.setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, component.getElement().getLocalName());
String[] attrNames = component.getAttrNames();
if (attrNames != null) {
for (int i = 0; i < attrNames.length; i++) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -15,7 +15,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator;
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
@@ -37,19 +39,17 @@
}
String fixType = (String) marker
.getAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY);
- if (fixType != null) {
- if (fixType
- .equals(IJSF2ValidationComponent.JSF2_COMPOSITE_COMPONENT_TYPE)) {
- return new IMarkerResolution[] { new JSF2CompositeComponentProposal() };
+ if (IJSF2ValidationComponent.JSF2_COMPOSITE_COMPONENT_TYPE.equals(fixType)) {
+ return new IMarkerResolution[] { new JSF2CompositeComponentProposal(marker.getResource(),
+ (String) marker.getAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME),
+ (String) marker.getAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY)) };
}
- if (fixType
- .equals(IJSF2ValidationComponent.JSF2_FIXABLE_ATTR_TYPE)) {
+ if (IJSF2ValidationComponent.JSF2_FIXABLE_ATTR_TYPE.equals(fixType)) {
return new IMarkerResolution[] { new JSF2CompositeAttrsProposal() };
}
- if (fixType.equals(IJSF2ValidationComponent.JSF2_URI_TYPE)) {
+ if (IJSF2ValidationComponent.JSF2_URI_TYPE.equals(fixType)) {
return new IMarkerResolution[] { new JSF2ResourcesFolderProposal() };
}
- }
} catch (CoreException e) {
JSFModelPlugin.getPluginLog().logError(e);
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -11,17 +11,25 @@
package org.jboss.tools.jsf.web.validation.jsf2.action;
+import java.io.File;
+import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
-import java.util.Map.Entry;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
@@ -37,9 +45,12 @@
private String componentPath = null;
private String[] attrs = null;
+ private String elementName;
- public JSF2CompositeComponentProposal() {
- super();
+ public JSF2CompositeComponentProposal(IResource validateResource, String elementName,String componentPath) {
+ super(validateResource);
+ this.elementName=elementName;
+ this.componentPath=componentPath;
}
public JSF2CompositeComponentProposal(IResource validateResource,
@@ -67,7 +78,20 @@
}
public String getDisplayString() {
- return JSFUIMessages.Create_JSF_2_Composite_Component;
+ IVirtualComponent component = ComponentCore.createComponent(validateResource.getProject());
+ String projectResourceRelativePath = componentPath;
+ if (component != null) {
+ IVirtualFolder webRootFolder = component.getRootFolder().getFolder(
+ new Path("/")); //$NON-NLS-1$
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ IFolder webFolder = ResourcesPlugin.getWorkspace().getRoot()
+ .getFolder(folder.getFullPath());
+ IFolder resourcesFolder = webFolder.getFolder("resources");
+ resourcesFolder.getProjectRelativePath().toString();
+ projectResourceRelativePath=validateResource.getProject().getName()+File.separator+resourcesFolder.getProjectRelativePath().toString()+componentPath;
+ }
+ return MessageFormat.format(JSFUIMessages.Create_JSF_2_Composite_Component,elementName,
+ projectResourceRelativePath);
}
@SuppressWarnings("unchecked")
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -79,4 +79,11 @@
return componentResLoc;
}
+ /**
+ * @return the element
+ */
+ public ElementImpl getElement() {
+ return element;
+ }
+
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/JSF2ComponentsValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/JSF2ComponentsValidatorTest.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/JSF2ComponentsValidatorTest.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -52,14 +52,13 @@
IMarker[] markers = resource.findMarkers(
"org.jboss.tools.jsf.jsf2problemmarker", false, 1); //$NON-NLS-1$
assertNotNull(markers);
- assertTrue(markers.length == 4);
assertTrue(isMarkerExist(markers,
"Composite component \"echo\" was not found in a project resources directory")); //$NON-NLS-1$
assertTrue(isMarkerExist(markers,
"Attribute \"anknownAttr\" is not defined for \"echo\" composite component")); //$NON-NLS-1$
assertTrue(isMarkerExist(
markers,
- "Resources folder \"/resources/jarPage1\" is missing in a project root directory")); //$NON-NLS-1$
+ "JSF 2 Resources folder \"/resources/jarPage1\" is missing in a project root directory")); //$NON-NLS-1$
assertTrue(isMarkerExist(markers,
"Composite component \"echo1\" was not found in a project resources directory")); //$NON-NLS-1$
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2010-08-12 12:08:31 UTC (rev 24096)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2010-08-12 12:20:53 UTC (rev 24097)
@@ -14,7 +14,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.CompletionProposal;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
15 years, 8 months
JBoss Tools SVN: r24096 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-08-12 08:08:31 -0400 (Thu, 12 Aug 2010)
New Revision: 24096
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6806
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-08-12 12:07:43 UTC (rev 24095)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-08-12 12:08:31 UTC (rev 24096)
@@ -1429,7 +1429,7 @@
public void testStereotypeWithMissingTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 19);
}
public void testStereotypeWithMissingRetention() throws Exception {
@@ -1439,12 +1439,12 @@
public void testStereotypeWithWrongTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, 15);
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 15);
}
public void testScopeWithMissingTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE, 33);
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 33);
}
public void testScopeWithMissingRetention() throws Exception {
@@ -1454,7 +1454,7 @@
public void testScopeWithWrongTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE, 30);
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 30);
}
/**
15 years, 8 months