JBoss Tools SVN: r29314 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-24 10:57:12 -0500 (Thu, 24 Feb 2011)
New Revision: 29314
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
Log:
swtbotext: added properties view static instance to test base class
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2011-02-24 15:55:42 UTC (rev 29313)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2011-02-24 15:57:12 UTC (rev 29314)
@@ -18,6 +18,7 @@
import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+import org.jboss.tools.ui.bot.ext.view.PropertiesView;
import org.jboss.tools.ui.bot.ext.view.ServersView;
/**
* Base class for SWTBot Tests using SWTBotExt
@@ -39,6 +40,7 @@
public static final ServersView servers = new ServersView();
public static final ProblemsView problems = new ProblemsView();
public static final ConsoleView console = new ConsoleView();
+ public static final PropertiesView properties = new PropertiesView();
// config & state
/**
@@ -48,13 +50,13 @@
*/
public static final ConfiguredState configuredState = new ConfiguredState();
- public static Properties properties;
+ private static Properties props;
/**
* Get properties for tests
* @param key
*/
public static String getProperty(String key) {
- return util.getValue(properties,key);
+ return util.getValue(props,key);
}
static {
System.setProperty("org.eclipse.swtbot.playback.delay","10");
13 years, 10 months
JBoss Tools SVN: r29313 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-24 10:55:42 -0500 (Thu, 24 Feb 2011)
New Revision: 29313
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PropertiesView.java
Log:
swtbotext: added properties view
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PropertiesView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PropertiesView.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PropertiesView.java 2011-02-24 15:55:42 UTC (rev 29313)
@@ -0,0 +1,30 @@
+package org.jboss.tools.ui.bot.ext.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+
+public class PropertiesView extends ViewBase {
+ Logger log = Logger.getLogger(PropertiesView.class);
+ public PropertiesView() {
+ viewObject = ActionItem.View.GeneralProperties.LABEL;
+ }
+ public List<String> getPropertyKeys() {
+ List<String> list = new ArrayList<String>();
+ for (SWTBotTreeItem item : this.show().bot().tree().getAllItems()) {
+ list.add(item.cell(0));
+ }
+ return list;
+ }
+ public String getPropertyValue(String property) {
+ for (SWTBotTreeItem item : this.show().bot().tree().getAllItems()) {
+ if (item.cell(0).equals(property)) {
+ return item.cell(1);
+ }
+ }
+ return null;
+ }
+}
13 years, 10 months
JBoss Tools SVN: r29312 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-24 10:52:24 -0500 (Thu, 24 Feb 2011)
New Revision: 29312
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java
Log:
fixed view due to previous commit
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java 2011-02-24 15:50:54 UTC (rev 29311)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java 2011-02-24 15:52:24 UTC (rev 29312)
@@ -98,7 +98,7 @@
public SWTBotView show() {
SWTBotView b = super.show();
// maximize tester view
- menu(IDEWorkbenchMessages.Workbench_window).menu(
+ bot.menu(IDEWorkbenchMessages.Workbench_window).menu(
WorkbenchMessages.MaximizePartAction_text).click();
return b;
}
@@ -123,12 +123,12 @@
public void setRequestBody(String s) {
// Body Text
- textWithLabel(JBossWSUIMessages.JAXRSWSTestView2_BodyText_Section).setText(s);
+ bot().textWithLabel(JBossWSUIMessages.JAXRSWSTestView2_BodyText_Section).setText(s);
}
public String getRequestBody() {
// Body Text
- return textWithLabel(JBossWSUIMessages.JAXRSWSTestView2_BodyText_Section).getText();
+ return bot().textWithLabel(JBossWSUIMessages.JAXRSWSTestView2_BodyText_Section).getText();
}
public void expandSection(String name) {
@@ -148,18 +148,18 @@
click(true);
}
}
- new X(label(name).widget).expand();
+ new X(bot().label(name).widget).expand();
}
public void addRequestArg(WsTesterView.Request_Arg_Type type, String name,
String value) {
- text(type.ordinal()).typeText(name + "=" + value);
- button("Add", type.ordinal()).click();
- text(type.ordinal()).setText("");
+ bot().text(type.ordinal()).typeText(name + "=" + value);
+ bot().button("Add", type.ordinal()).click();
+ bot().text(type.ordinal()).setText("");
}
public Map<String, String> getRequestArgs(WsTesterView.Request_Arg_Type type) {
- String[] args = list(type.ordinal()).getItems();
+ String[] args = bot().list(type.ordinal()).getItems();
Map<String, String> result = new HashMap<String, String>();
for (String s : args) {
int i = s.indexOf('=');
@@ -170,41 +170,41 @@
public void editRequestArg(WsTesterView.Request_Arg_Type type,
String oldName, String oldValue, String newName, String newValue) {
- list(type.ordinal()).select(oldName + "=" + oldValue);
- button("Edit", type.ordinal()).click();
- SWTBot sh = activeShell().bot();
+ bot().list(type.ordinal()).select(oldName + "=" + oldValue);
+ bot().button("Edit", type.ordinal()).click();
+ SWTBot sh = bot().activeShell().bot();
sh.text(0).typeText(newName + "=" + newValue);
sh.button(IDialogConstants.OK_LABEL).click();
}
public void removeRequestArg(WsTesterView.Request_Arg_Type type,
String name, String value) {
- list(type.ordinal()).select(name + "=" + value);
- button("Remove", type.ordinal()).click();
+ bot().list(type.ordinal()).select(name + "=" + value);
+ bot().button("Remove", type.ordinal()).click();
}
public void clearRequestArgs(WsTesterView.Request_Arg_Type type) {
- SWTBotButton b = button("Clear All", type.ordinal());
+ SWTBotButton b = bot().button("Clear All", type.ordinal());
b.click();
}
public String getResponseBody() {
- return textWithLabel(JBossWSUIMessages.JAXRSWSTestView2_ResponseBody_Section).getText();
+ return bot().textWithLabel(JBossWSUIMessages.JAXRSWSTestView2_ResponseBody_Section).getText();
}
public String[] getResponseHeaders() {
- return listWithLabel(JBossWSUIMessages.JAXRSWSTestView2_ResponseHeaders_Section).getItems();
+ return bot().listWithLabel(JBossWSUIMessages.JAXRSWSTestView2_ResponseHeaders_Section).getItems();
}
public void invoke() {
- toolbarButtonWithTooltip(JBossWSUIMessages.JAXRSWSTestView2_Go_Tooltip).click();
- waitWhile(Conditions.shellIsActive(JBossWSUIMessages.JAXRSWSTestView_Invoke_Label), 120000);
- sleep(500);
+ bot().toolbarButtonWithTooltip(JBossWSUIMessages.JAXRSWSTestView2_Go_Tooltip).click();
+ bot.waitWhile(Conditions.shellIsActive(JBossWSUIMessages.JAXRSWSTestView_Invoke_Label), 120000);
+ bot.sleep(500);
}
public SelectWSDLDialog getFromWSDL() {
- toolbarButtonWithTooltip(JBossWSUIMessages.JAXRSWSTestView2_GetFromWSDL_Tooltip).click();
- return new SelectWSDLDialog(activeShell().widget);
+ bot().toolbarButtonWithTooltip(JBossWSUIMessages.JAXRSWSTestView2_GetFromWSDL_Tooltip).click();
+ return new SelectWSDLDialog(bot.activeShell().widget);
}
private String getStringFromBundle(String key) {
@@ -213,12 +213,12 @@
private SWTBotCombo getRequestTypeCombo() {
// HTTP Method:
- return comboBox(1);
+ return bot().comboBox(1);
}
private SWTBotCombo getServiceURLCombo() {
// Service URL:
- return comboBox(0);
+ return bot().comboBox(0);
}
}
\ No newline at end of file
13 years, 10 months
JBoss Tools SVN: r29311 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-24 10:50:54 -0500 (Thu, 24 Feb 2011)
New Revision: 29311
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ConsoleView.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ViewBase.java
Log:
swtbotext: refactored views (ViewBase does not extend STWBotExt anymore)
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ConsoleView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ConsoleView.java 2011-02-24 15:11:49 UTC (rev 29310)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ConsoleView.java 2011-02-24 15:50:54 UTC (rev 29311)
@@ -43,7 +43,7 @@
public String getConsoleText(){
show();
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = bot.viewByTitle(viewObject.getName()).bot();
String consoleText = null;
try{
consoleText = viewBot.styledText().getText();
@@ -60,7 +60,7 @@
public void clearConsole(){
show();
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = bot.viewByTitle(viewObject.getName()).bot();
try{
SWTBotButton clearConsole = viewBot.buttonWithTooltip(IDELabel.ConsoleView.BUTTON_CLEAR_CONSOLE_TOOLTIP).click();
clearConsole.click();
@@ -93,7 +93,7 @@
public String getConsoleText (long sleepTime , long timeOut , boolean quitWhenNoChange){
long estimatedTime = 0;
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = bot.viewByTitle(viewObject.getName()).bot();
String prevConsoleText = getConsoleText();
String consoleText = prevConsoleText;
log.info("Waiting for console text with TimeOut: " + timeOut);
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2011-02-24 15:11:49 UTC (rev 29310)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2011-02-24 15:50:54 UTC (rev 29311)
@@ -10,6 +10,7 @@
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.WidgetResult;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
@@ -31,8 +32,7 @@
* Selects given project in Package Explorer
*/
public void selectProject(String projectName) {
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
- viewBot.tree().expandNode(projectName).select();
+ bot().tree().expandNode(projectName).select();
}
/**
@@ -45,7 +45,7 @@
*/
public SWTBotTreeItem selectTreeItem(int timeOut, String treeItemText,
String[] path) {
- SWTBot viewBot = show().bot();
+ SWTBot viewBot = bot();
return SWTEclipseExt.getTreeItemOnPath(viewBot, viewBot.tree(), timeOut,
treeItemText, path).select();
}
@@ -71,13 +71,13 @@
SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
new SWTBotMenu(ContextMenuHelper.getContextMenu(viewBot.tree(), IDELabel.Menu.DELETE, false)).click();
- shell("Delete Resources").activate();
+ SWTBotShell shell = bot.shell("Delete Resources").activate();
if (fileSystem) {
- checkBox().click();
+ shell.bot().checkBox().click();
}
- open.finish(this,IDELabel.Button.OK);
- new SWTUtilExt(this).waitForNonIgnoredJobs();
- new SWTUtilExt(this).waitForAll(Timing.time3S());
+ open.finish(shell.bot(),IDELabel.Button.OK);
+ util.waitForNonIgnoredJobs();
+ util.waitForAll(Timing.time3S());
}
/**
* deletes all projects from workspace
@@ -123,7 +123,7 @@
}
item.select().doubleClick();
log.info("File Opened:" + builder.toString());
- SWTBotEditor editor = activeEditor();
+ SWTBotEditor editor = bot.activeEditor();
return editor;
}
/**
@@ -165,9 +165,9 @@
});
if (menuItem != null){
new SWTBotMenu(menuItem).click();
- shell(IDELabel.Shell.RUN_ON_SERVER).activate();
- open.finish(this);
- new SWTUtilExt(this).waitForAll(Timing.time3S());
+ SWTBotShell shell = bot.shell(IDELabel.Shell.RUN_ON_SERVER).activate();
+ open.finish(shell.bot());
+ util.waitForAll(Timing.time3S());
}
else{
throw new WidgetNotFoundException("Unable to find Menu Item with Label 'Run on Server'");
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2011-02-24 15:11:49 UTC (rev 29310)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2011-02-24 15:50:54 UTC (rev 29311)
@@ -33,7 +33,7 @@
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.ADD_AND_REMOVE, false)).click();
try {
- SWTBotShell shell = shell(IDELabel.Menu.ADD_AND_REMOVE);
+ SWTBotShell shell = bot.shell(IDELabel.Menu.ADD_AND_REMOVE);
shell.activate();
SWTBotButton btRemoveAll=shell.bot().button("<< Remove All");
if (btRemoveAll.isEnabled()) {
@@ -41,12 +41,12 @@
log.info("Removing all projects from server '"+serverName+"'");
}
open.finish(shell.bot(), IDELabel.Button.FINISH);
- new SWTUtilExt(this).waitForNonIgnoredJobs();
- new SWTUtilExt(this).waitForAll(Timing.time3S());
+ util.waitForNonIgnoredJobs();
+ util.waitForAll(Timing.time3S());
} catch (WidgetNotFoundException ex) {
ex.printStackTrace();
- shell("Server").activate();
- button(IDELabel.Button.OK).click();
+ bot.shell("Server").activate();
+ bot.button(IDELabel.Button.OK).click();
}
}
@@ -62,8 +62,8 @@
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.STOP, false)).click();
- new SWTUtilExt(this).waitForNonIgnoredJobs();
- new SWTUtilExt(this).waitForAll(Timing.time10S());
+ util.waitForNonIgnoredJobs();
+ util.waitForAll(Timing.time10S());
}
}
@@ -78,7 +78,7 @@
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.DELETE, false)).click();
- SWTBotShell shell = shell("Delete Server");
+ SWTBotShell shell = bot.shell("Delete Server");
shell.activate();
open.finish(shell.bot(), IDELabel.Button.OK);
log.info("Removed server: " + serverName);
@@ -97,8 +97,8 @@
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.START, false)).click();
- new SWTUtilExt(this).waitForNonIgnoredJobs(Timing.time100S());
- new SWTUtilExt(this).waitForAll(Timing.time3S());
+ util.waitForNonIgnoredJobs(Timing.time100S());
+ util.waitForAll(Timing.time3S());
}
else{
throw new RuntimeException("Unable to start server witn name: " + serverName +
@@ -139,11 +139,11 @@
log.info("Found project to be removed from server: " + serverTreeItemChildren[itemIndex].getText());
ContextMenuHelper.prepareTreeItemForContextMenu(serverTree,serverTreeItemChildren[itemIndex]);
new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)).click();
- SWTBotShell shell = shell("Server");
+ SWTBotShell shell = bot.shell("Server");
shell.activate();
open.finish(shell.bot(), IDELabel.Button.OK);
log.info("Removed project from server: " + serverTreeItemChildren[itemIndex].getText());
- new SWTUtilExt(this).waitForNonIgnoredJobs();
+ util.waitForNonIgnoredJobs();
} else {
log.info("Project '"+projectName+"' not found on any server");
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ViewBase.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ViewBase.java 2011-02-24 15:11:49 UTC (rev 29310)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ViewBase.java 2011-02-24 15:50:54 UTC (rev 29311)
@@ -2,28 +2,44 @@
import org.apache.log4j.Logger;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTOpenExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.gen.IView;
/**
* base class for all view extensions
* @author lzoubek(a)redhat.com
*
*/
-public class ViewBase extends SWTBotExt {
+public class ViewBase {
/**
* view object representing current view, MUST be defined in derived
* constructor (for use, see {@link SWTOpenExt#viewOpen(IView)}
*/
protected IView viewObject;
protected final SWTOpenExt open;
+ protected final SWTUtilExt util;
+ protected final SWTBotExt bot;
+
Logger log = Logger.getLogger(ViewBase.class);
public ViewBase() {
- open = new SWTOpenExt(this);
+ open = SWTTestExt.open;
+ util = SWTTestExt.util;
+ bot = SWTTestExt.bot;
+
}
-
/**
+ * gets view bot, view is guaranteed to be shown and focused
+ * @return
+ */
+ public SWTBot bot() {
+ return show().bot();
+ }
+ /**
* shows view
*/
public SWTBotView show() {
13 years, 10 months
JBoss Tools SVN: r29310 - in trunk: jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-24 10:11:49 -0500 (Thu, 24 Feb 2011)
New Revision: 29310
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java
Log:
https://issues.jboss.org/browse/JBIDE-7003, preferences has been added to validator
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java 2011-02-24 12:25:40 UTC (rev 29309)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java 2011-02-24 15:11:49 UTC (rev 29310)
@@ -16,8 +16,11 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.wst.validation.ValidationFramework;
import org.jboss.tools.jsf.web.validation.i18n.I18nValidationComponent;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.preferences.ELSeverityPreferences;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
@@ -44,4 +47,8 @@
assertEquals("Should be 2 Markers", 2,elMarkers.length); //$NON-NLS-1$
}
+ public void testDefaultStateI19nValidator(){
+ IPreferenceStore store = WebKbPlugin.getDefault().getPreferenceStore();
+ assertEquals("By Default I18nValidator should be ignored",ELSeverityPreferences.IGNORE,store.getDefaultString(ELSeverityPreferences.NON_EXTERNALIZED_STRINGS)); //$NON-NLS-1$
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java 2011-02-24 12:25:40 UTC (rev 29309)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java 2011-02-24 15:11:49 UTC (rev 29310)
@@ -39,5 +39,6 @@
defaultPreferences.put(ELSeverityPreferences.CHECK_VARS, ELSeverityPreferences.ENABLE);
defaultPreferences.put(ELSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, ELSeverityPreferences.ENABLE);
defaultPreferences.putInt(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME, SeverityPreferences.DEFAULT_MAX_NUMBER_OF_MARKERS_PER_FILE);
+ defaultPreferences.put(ELSeverityPreferences.NON_EXTERNALIZED_STRINGS, ELSeverityPreferences.IGNORE);
}
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.java 2011-02-24 12:25:40 UTC (rev 29309)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.java 2011-02-24 15:11:49 UTC (rev 29310)
@@ -34,6 +34,7 @@
public static String JSFValidatorConfigurationBlock_pb_revalidateUnresolvedEl_label;
public static String JSFValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label;
public static String JSFValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label;
+ public static String JSFValidatorConfigurationBlock_pb_non_externalizedStrings_label;
static {
NLS.initializeMessages(BUNDLE_NAME, ELSeverityPreferencesMessages.class);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.properties 2011-02-24 12:25:40 UTC (rev 29309)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELSeverityPreferencesMessages.properties 2011-02-24 15:11:49 UTC (rev 29310)
@@ -20,6 +20,7 @@
JSFValidatorConfigurationBlock_pb_revalidateUnresolvedEl_label=Revalidate unresolved ELs automatically.
JSFValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label=Property cannot be resolved:
JSFValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label=Unpaired Getter/Setter:
+JSFValidatorConfigurationBlock_pb_non_externalizedStrings_label=Non-externalized strings:
JSF_VALIDATOR_CONFIGURATION_BLOCK_JSF_VALIDATOR_CONFIGURATION_BLOCK=JSFValidatorConfigurationBlock
JSF_VALIDATOR_PREFERENCE_PAGE_JSF_VALIDATOR=Expression Language Validator
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java 2011-02-24 12:25:40 UTC (rev 29309)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java 2011-02-24 15:11:49 UTC (rev 29310)
@@ -53,6 +53,7 @@
{ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, ELSeverityPreferencesMessages.JSFValidatorConfigurationBlock_pb_unknownElVariableName_label},
{ELSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, ELSeverityPreferencesMessages.JSFValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label},
{ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, ELSeverityPreferencesMessages.JSFValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label},
+ {ELSeverityPreferences.NON_EXTERNALIZED_STRINGS, ELSeverityPreferencesMessages.JSFValidatorConfigurationBlock_pb_non_externalizedStrings_label}
},
WebKbPlugin.PLUGIN_ID
);
13 years, 10 months
JBoss Tools SVN: r29309 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: mapping and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-02-24 07:25:40 -0500 (Thu, 24 Feb 2011)
New Revision: 29309
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual part
- created SelectionUtil.getNodeMappingsBySourceSelection and getFocusNodesBySourceSelection to support one-to-many linking between source selection and visual nodes.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-02-24 12:03:57 UTC (rev 29308)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-02-24 12:25:40 UTC (rev 29309)
@@ -1466,22 +1466,6 @@
node.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
}
- public nsIDOMNode getOriginalTargetNode(nsIDOMEvent event) {
- nsIDOMNode targetNode = VisualDomUtil.getTargetNode(event);
- if (HTML.TAG_INPUT.equalsIgnoreCase(targetNode.getNodeName())) {
- return targetNode;
- }
- nsIDOMNSEvent nsEvent = queryInterface(event, nsIDOMNSEvent.class);
- // TODO Sergey Vasilyev figure out with TmpRealOriginalTarget
-// nsIDOMEventTarget target = nsEvent.getTmpRealOriginalTarget();
- nsIDOMEventTarget target = nsEvent.getOriginalTarget();
- nsIDOMNode originalNode = queryInterface(target, nsIDOMNode.class);
- if (VpeVisualDomBuilder.isAnonElement(originalNode)) {
- originalNode = getLastSelectedElement();
- }
- return originalNode;
- }
-
public nsIDOMText getOutputTextNode(Attr attr) {
Element sourceElement = attr.getOwnerElement();
VpeElementMapping elementMapping = domMapping
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java 2011-02-24 12:03:57 UTC (rev 29308)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java 2011-02-24 12:25:40 UTC (rev 29309)
@@ -19,6 +19,7 @@
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -125,20 +126,12 @@
public VpeNodeMapping getNearNodeMappingAtSourceNode(Node sourceNode) {
VpeNodeMapping nodeMapping = getNodeMappingAtSourceNode(sourceNode);
- if(nodeMapping!=null){
-
- if(sourceNode!=null && nodeMapping != null) {
-
- nsIDOMNode nearVisualNode = nodeMapping.getVisualNode();
- if(nearVisualNode instanceof nsIDOMElement){
-
- nsIDOMElement visualElement = (nsIDOMElement) nearVisualNode;
- visualElement.removeAttribute(XulRunnerEditor.VPE_INVISIBLE_ELEMENT);
- }
+ while (sourceNode != null && nodeMapping == null) {
+ if (sourceNode instanceof Attr) {
+ sourceNode = ((Attr) sourceNode).getOwnerElement();
+ } else {
+ sourceNode = sourceNode.getParentNode();
}
- }
- while (sourceNode != null && nodeMapping == null) {
- sourceNode = sourceNode.getParentNode();
nodeMapping = getNodeMappingAtSourceNode(sourceNode);
if(sourceNode!=null && nodeMapping != null) {
@@ -150,6 +143,15 @@
}
}
}
+
+ if(sourceNode!=null && nodeMapping != null) {
+ nsIDOMNode nearVisualNode = nodeMapping.getVisualNode();
+ if(nearVisualNode instanceof nsIDOMElement){
+ nsIDOMElement visualElement = (nsIDOMElement) nearVisualNode;
+ visualElement.removeAttribute(XulRunnerEditor.VPE_INVISIBLE_ELEMENT);
+ }
+ }
+
return nodeMapping;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-02-24 12:03:57 UTC (rev 29308)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-02-24 12:25:40 UTC (rev 29309)
@@ -11,8 +11,15 @@
package org.jboss.tools.vpe.editor.util;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -225,12 +232,37 @@
return sourceRange;
}
+
public static VpeNodeMapping getNodeMappingBySourceSelection(
StructuredTextEditor sourceEditor, VpeDomMapping domMapping) {
+ List<VpeNodeMapping> mappings
+ = getNodeMappingsBySourceSelection(sourceEditor, domMapping);
+ if (!mappings.isEmpty()) {
+ return mappings.get(0);
+ } else {
+ return null;
+ }
+ }
+ public static List<VpeNodeMapping> getNodeMappingsBySourceSelection(
+ StructuredTextEditor sourceEditor, VpeDomMapping domMapping) {
+ List<VpeNodeMapping> nodeMappings = new ArrayList<VpeNodeMapping>();
+ for (Node node : getFocusNodesBySourceSelection(sourceEditor, domMapping)) {
+ VpeNodeMapping nodeMapping = VpeNodesManagingUtil.getNodeMapping(domMapping, node);
+ if (nodeMapping != null) {
+ nodeMappings.add(nodeMapping);
+ }
+ }
+
+ return nodeMappings;
+ }
+
+ private static List<Node> getFocusNodesBySourceSelection(
+ StructuredTextEditor sourceEditor, VpeDomMapping domMapping) {
Point range = sourceEditor.getTextViewer().getSelectedRange();
IDocument document = sourceEditor.getTextViewer().getDocument();
+ List<Node> focusNodes = new ArrayList<Node>();
IStructuredModel model = null;
try {
// gets source model for read, model should be released see
@@ -240,12 +272,9 @@
//fix for JBIDE-3805, mareshkau
if(model == null) {
- return null;
+ return Collections.emptyList();
}
- int anchor = range.x;
- int focus = range.x + range.y;
-
/*
* implementation of IDOMModel's method getIndexedRegion(...) has
* one feature : if cursor is situated at the border of elements
@@ -255,39 +284,34 @@
* getIndexedRegion() return "h:outputText" element. So for focus
* position we choose smaller value
*/
- Node focusNode = null;
- if (anchor < focus) {
- int tmp = focus;
- focus = anchor;
- anchor = tmp;
- }
- if (anchor == focus) {
- // get source node by offset
- // see JBIDE-3163
- focusNode = getSourceNodeByPosition(model, focus);
+ int selectionStart = Math.min(range.x, range.x + range.y);
+ if (range.y == 0) {
+ /* if selection length is 0 (text cursor only), than use
+ * custom implementation to determine node. See JBIDE-3163. */
+ Node focusNode = getSourceNodeByPosition(model, selectionStart);
+ if (focusNode != null) {
+ focusNodes.add(focusNode);
+ }
} else {
// fixed JBIDE-3388: Incorrect selection after Copy/Cut actions
- IndexedRegion node = model.getIndexedRegion(focus);
- if (node != null) {
- focusNode = (Node) node;
+ ISelection selection = sourceEditor.getSelectionProvider().getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Iterator iterator = ((IStructuredSelection) selection).iterator();
+ while (iterator.hasNext()) {
+ Object selectionElement = iterator.next();
+ if (selectionElement instanceof Node) {
+ focusNodes.add((Node) selectionElement);
+ }
+ }
}
}
-
- // if focus node also contains anchor point (selected only 1
- // element)
- if (focusNode != null) {
- // if (NodesManagingUtil.isNodeContainsPosition(focusNode,
- // anchor)) {
- return VpeNodesManagingUtil.getNodeMapping(domMapping, focusNode);
- // }
- }
} finally {
if (model != null) {
model.releaseFromRead();
}
}
- return null;
+ return focusNodes;
}
public static Node getNodeBySourcePosition(
13 years, 10 months
JBoss Tools SVN: r29308 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-02-24 07:03:57 -0500 (Thu, 24 Feb 2011)
New Revision: 29308
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGenerator.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-8477
Highlight strategy element on error
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGenerator.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGenerator.java 2011-02-24 11:40:11 UTC (rev 29307)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGenerator.java 2011-02-24 12:03:57 UTC (rev 29308)
@@ -33,6 +33,8 @@
TextRange getNameTextRange(CompilationUnit astRoot);
+ TextRange getStrategyTextRange(CompilationUnit astRoot);
+
void initialize(GenericGeneratorAnnotation generator);
void update(GenericGeneratorAnnotation generator);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2011-02-24 11:40:11 UTC (rev 29307)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2011-02-24 12:03:57 UTC (rev 29308)
@@ -124,6 +124,10 @@
this.strategy = strategy;
firePropertyChanged(GENERIC_STRATEGY_PROPERTY, oldStrategy, strategy);
}
+
+ public TextRange getStrategyTextRange(CompilationUnit astRoot){
+ return this.generatorResource.getStrategyTextRange(astRoot);
+ }
protected String getCatalog() {
return null;
@@ -149,32 +153,33 @@
*/
protected void validateStrategy(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot){
if (strategy != null) {
- int lineNum = getValidationTextRange(astRoot) == null ? 0 : getValidationTextRange(astRoot).getLineNumber();
+ TextRange range = getStrategyTextRange(astRoot) == null ? TextRange.Empty.instance() : getStrategyTextRange(astRoot);
if (strategy.trim().length() == 0) {
- messages.add(creatErrorMessage(STRATEGY_CANT_BE_EMPTY, new String[]{}, lineNum));
+ messages.add(creatErrorMessage(STRATEGY_CANT_BE_EMPTY, new String[]{}, range));
} else if (!generatorClasses.contains(strategy)){
IType lwType = null;
try {
lwType = getJpaProject().getJavaProject().findType(strategy);
if (lwType == null || !lwType.isClass()){
- messages.add(creatErrorMessage(STRATEGY_CLASS_NOT_FOUND, new String[]{strategy}, lineNum));
+ messages.add(creatErrorMessage(STRATEGY_CLASS_NOT_FOUND, new String[]{strategy}, range));
} else {
if (!JpaUtil.isTypeImplementsInterface(getJpaProject().getJavaProject(), lwType, "org.hibernate.id.IdentifierGenerator")){//$NON-NLS-1$
- messages.add(creatErrorMessage(STRATEGY_INTERFACE, new String[]{strategy}, lineNum));
+ messages.add(creatErrorMessage(STRATEGY_INTERFACE, new String[]{strategy}, range));
}
}
} catch (JavaModelException e) {
// just ignore it!
}
-
}
}
}
- protected IMessage creatErrorMessage(String strmessage, String[] params, int lineNum){
+ protected IMessage creatErrorMessage(String strmessage, String[] params, TextRange range){
IMessage message = new LocalMessage(IMessage.HIGH_SEVERITY,
strmessage, params, getResource());
- message.setLineNo(lineNum);
+ message.setLineNo(range.getLineNumber());
+ message.setOffset(range.getOffset());
+ message.setLength(range.getLength());
return message;
}
13 years, 10 months
JBoss Tools SVN: r29307 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test: editor/tags and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-02-24 06:40:11 -0500 (Thu, 24 Feb 2011)
New Revision: 29307
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PanelMenuTagTest.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/editor/tags/PickListTagTest.java
Log:
Added PanelMenuTagTest and fixed html text for PickListTagTest.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-02-24 06:18:39 UTC (rev 29306)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-02-24 11:40:11 UTC (rev 29307)
@@ -40,6 +40,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.InplaceInputTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.InplaceSelectInputTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.JSFTagsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.PanelMenuTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.PickListTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ProgressTagTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
@@ -113,6 +114,7 @@
suite.addTestSuite(InplaceSelectInputTagTest.class);
suite.addTestSuite(PickListTagTest.class);
suite.addTestSuite(ProgressTagTest.class);
+ suite.addTestSuite(PanelMenuTagTest.class);
suite.addTestSuite(XhtmlFilePerformanceTest.class);
return new TestSetup(suite);
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PanelMenuTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PanelMenuTagTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PanelMenuTagTest.java 2011-02-24 11:40:11 UTC (rev 29307)
@@ -0,0 +1,184 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+
+/**
+ * Tests Rich Faces PanelMenu Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class PanelMenuTagTest extends RichFacesTagsTest{
+
+ private static String getSubGroupLabel (final int groupIndex , final int subGroupIndex){
+ StringBuffer sb = new StringBuffer();
+ sb.append(groupIndex);
+ sb.append(":");
+ sb.append(subGroupIndex);
+ sb.append(":");
+ sb.append("Subgroup");
+ return sb.toString();
+ }
+
+ private static String getGroupLabel (final int groupIndex){
+ StringBuffer sb = new StringBuffer();
+ sb.append(groupIndex);
+ sb.append(":");
+ sb.append("Group");
+ return sb.toString();
+ }
+
+ private static String getGroupItemLabel (final int groupIndex ,final int itemIndex){
+ StringBuffer sb = new StringBuffer();
+ sb.append(groupIndex);
+ sb.append(":");
+ sb.append(itemIndex);
+ sb.append(":");
+ sb.append("Item");
+ return sb.toString();
+ }
+
+ private static String getSubGroupItemLabel (final int groupIndex , final int subGroupIndex, final int itemIndex){
+ StringBuffer sb = new StringBuffer();
+ sb.append(groupIndex);
+ sb.append(":");
+ sb.append(subGroupIndex);
+ sb.append(":");
+ sb.append(itemIndex);
+ sb.append(":");
+ sb.append("Item");
+ return sb.toString();
+ }
+
+ @Override
+ protected void initPageContent() {
+ xhtmlEditor.setText("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
+ " xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n" +
+ " xmlns:h=\"http://java.sun.com/jsf/html\"\n" +
+ " xmlns:f=\"http://java.sun.com/jsf/core\"\n" +
+ " xmlns:rich=\"http://richfaces.org/rich\"\n" +
+ " xmlns:a4j=\"http://richfaces.org/a4j\">\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <rich:panelMenu style=\"text-align:center;color:Black;font-style:italic;font-size:large;width:200px;border-style:dashed;background-color:Orchid;border-color:Cornsilk;text-decoration:overline;font-family:Arial Rounded MT Bold;font-weight:bolder;\" mode=\"ajax\" >\n" +
+ " <rich:panelMenuGroup label=\"" + PanelMenuTagTest.getGroupLabel(0) +"\">\n" +
+ " <rich:panelMenuItem label=\"" + PanelMenuTagTest.getGroupItemLabel(0,0) + "\">\n" +
+ " </rich:panelMenuItem>\n" +
+ " </rich:panelMenuGroup>\n" +
+ " <rich:panelMenuGroup label=\"" + PanelMenuTagTest.getGroupLabel(1) +"\">\n" +
+ " <rich:panelMenuItem label=\"" + PanelMenuTagTest.getGroupItemLabel(1, 0) + "\">\n" +
+ " </rich:panelMenuItem>\n" +
+ " <rich:panelMenuGroup label=\"" + PanelMenuTagTest.getSubGroupLabel(1,0) +"\">\n" +
+ " <rich:panelMenuItem label=\"" + PanelMenuTagTest.getSubGroupItemLabel(1, 0 , 0) + "\">\n" +
+ " </rich:panelMenuItem>\n" + "" +
+ " </rich:panelMenuGroup>\n" +
+ " <rich:panelMenuItem label=\"" + PanelMenuTagTest.getGroupItemLabel(1, 1) + "\">\n" +
+ " </rich:panelMenuItem>\n" +
+ " </rich:panelMenuGroup>\n" +
+ " <rich:panelMenuGroup label=\"" + PanelMenuTagTest.getGroupLabel(2) +"\">\n" +
+ " <rich:panelMenuItem label=\"" + PanelMenuTagTest.getGroupItemLabel(2, 0) + "\">\n" +
+ " </rich:panelMenuItem>\n" +
+ " </rich:panelMenuGroup>\n" +
+ " </rich:panelMenu>\n" +
+ " </f:view>\n" +
+ " </body>\n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "TD",
+ new String[]{"class"},
+ new String[]{"rich-pmenu-top-group-self-label"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "TD",
+ new String[]{"class"},
+ new String[]{"rich-pmenu-group-self-icon rich-pmenu-top-group-self-icon"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "TABLE",
+ new String[]{"class"},
+ new String[]{"dr-pmenu-top-group rich-pmenu-group"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ PanelMenuTagTest.getGroupLabel(0),
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ PanelMenuTagTest.getGroupLabel(1),
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ PanelMenuTagTest.getGroupLabel(2),
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorNotContainNodeWithValue(xhtmlWebBrowser,
+ PanelMenuTagTest.getGroupItemLabel(0, 0),
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ // check tag selection
+ xhtmlWebBrowser.selectDomNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",4), 0);
+ bot.sleep(Timing.time3S());
+ String selectedText = xhtmlEditor.getSelection();
+ String hasToStartWith = "<rich:panelMenu ";
+ assertTrue("Selected text in Source Pane has to start with '" + hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasToEndWith = "</rich:panelMenu>";
+ assertTrue("Selected text in Source Pane has to end with '" + hasToEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasToEndWith));
+ // select and expand second group
+ xhtmlWebBrowser.selectDomNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",6), 0);
+ bot.sleep(Timing.time1S());
+ xhtmlWebBrowser.mouseClickOnNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",6));
+ bot.sleep(Timing.time3S());
+ selectedText = xhtmlEditor.getSelection();
+ hasToStartWith = "<rich:panelMenuGroup label=\"" + PanelMenuTagTest.getGroupLabel(1);
+ assertTrue("Selected text in Source Pane has to start with '" + hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ hasToEndWith = "</rich:panelMenuGroup>";
+ assertTrue("Selected text in Source Pane has to end with '" + hasToEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasToEndWith));
+ // select and expand subgroup
+ xhtmlWebBrowser.selectDomNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",8), 0);
+ bot.sleep(Timing.time1S());
+ xhtmlWebBrowser.mouseClickOnNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",8));
+ bot.sleep(Timing.time3S());
+ // select subgroup item
+ xhtmlWebBrowser.selectDomNode(xhtmlWebBrowser.getDomNodeByTagName("DIV",9), 0);
+ bot.sleep(Timing.time3S());
+ bot.sleep(Timing.time3S());
+ selectedText = xhtmlEditor.getSelection();
+ hasToStartWith = "<rich:panelMenuItem label=\"" + PanelMenuTagTest.getSubGroupItemLabel(1, 0, 0) + "\"";
+ assertTrue("Selected text in Source Pane has to start with '" + hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ hasToEndWith = "</rich:panelMenuItem>";
+ assertTrue("Selected text in Source Pane has to end with '" + hasToEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasToEndWith));
+ assertVisualEditorContainsNodeWithValue(xhtmlWebBrowser,
+ PanelMenuTagTest.getSubGroupItemLabel(1, 0, 0),
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ assertVisualEditorContains(xhtmlWebBrowser,
+ "TD",
+ new String[]{"class"},
+ new String[]{"rich-pmenu-item-label"},
+ RichFacesTagsTest.TEST_PAGE_NAME_XHTML);
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PanelMenuTagTest.java
___________________________________________________________________
Added: 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/tags/PickListTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PickListTagTest.java 2011-02-24 06:18:39 UTC (rev 29306)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/PickListTagTest.java 2011-02-24 11:40:11 UTC (rev 29307)
@@ -36,12 +36,11 @@
index++;
}
xhtmlEditor.setText("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
- "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
" xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n" +
" xmlns:f=\"http://java.sun.com/jsf/core\"\n" +
" xmlns:rich=\"http://richfaces.org/rich\"\n" +
" xmlns:a4j=\"http://richfaces.org/a4j\">\n" +
- "<html>\n" +
" <head>\n" +
" </head>\n" +
" <body>\n" +
@@ -51,8 +50,7 @@
" </rich:pickList>\n" +
" </f:view>\n" +
" </body>\n" +
- "</html>\n" +
- "</ui:composition>");
+ "</html>");
}
@Override
13 years, 10 months
JBoss Tools SVN: r29306 - branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-24 01:18:39 -0500 (Thu, 24 Feb 2011)
New Revision: 29306
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
Log:
JBIDE-8093 to maintenance branch
Modified: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
===================================================================
--- branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-02-24 06:05:34 UTC (rev 29305)
+++ branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-02-24 06:18:39 UTC (rev 29306)
@@ -248,17 +248,25 @@
private void verifyPageComplete() {
boolean complete = true;
+ String error = null;
if( createServer.getSelection()) {
if( deployOnlyRadio.getSelection()) {
complete = !deployFolderText.getText().equals("");
+ if( !complete )
+ error = "The deploy folder must not be empty";
} else if( autoScanCheck.getSelection()) {
int index = autoLocalRuntimeCombo.getSelectionIndex();
complete = index != -1 && !remoteDetailsLoc.getText().equals("");
+ if( !complete )
+ error = "Please select a local runtime. The created server will be of the same version as the local runtime.";
} else if( hardCodeServerDetails.getSelection()) {
int index = localRuntimeCombo.getSelectionIndex();
complete = index != -1 && !serverHomeText.getText().equals("") && !serverConfigText.getText().equals("");
+ if( !complete )
+ error = "Please select a local runtime. The created server will be of the same version as the local runtime.";
}
}
+ setErrorMessage(error);
setPageComplete(complete);
}
13 years, 10 months
JBoss Tools SVN: r29305 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-24 01:05:34 -0500 (Thu, 24 Feb 2011)
New Revision: 29305
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
Log:
JBIDE-8300 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2011-02-24 06:02:52 UTC (rev 29304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2011-02-24 06:05:34 UTC (rev 29305)
@@ -496,7 +496,7 @@
}
});
- combo = new Combo(this, SWT.DEFAULT | SWT.READ_ONLY);
+ combo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
l.setLayoutData(UIUtil.createFormData2(0, 5, null, 0, 0, 0, null, 0));
combo.setLayoutData(UIUtil.createFormData2(0, 0, null, 0, l, 5, newHost, -5));
refreshConnections();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2011-02-24 06:02:52 UTC (rev 29304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2011-02-24 06:05:34 UTC (rev 29305)
@@ -47,7 +47,7 @@
loadDeployTypeData();
FormToolkit toolkit2 = new FormToolkit(parent.getDisplay());
setLayout(new FormLayout());
- deployTypeCombo = new Combo(this, SWT.DEFAULT);
+ deployTypeCombo = new Combo(this, SWT.READ_ONLY);
FormData fd = UIUtil.createFormData2(0, 5, null, 0, 0, 5, 50, -5);
deployTypeCombo.setLayoutData(fd);
13 years, 10 months