JBoss Tools SVN: r37179 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-09 11:49:58 -0500 (Fri, 09 Dec 2011)
New Revision: 37179
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
Log:
[JBIDE-10432] added control decoration for project name text field if its empty
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java 2011-12-09 16:49:34 UTC (rev 37178)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java 2011-12-09 16:49:58 UTC (rev 37179)
@@ -18,7 +18,6 @@
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Control;
@@ -34,8 +33,8 @@
this.validationStatus = provider.getValidationStatus();
}
- public void showFor(Control control) {
- ControlDecoration decoration = createDecoration(control);
+ public void showFor(Control control, int position) {
+ ControlDecoration decoration = createDecoration(control, position);
IValueChangeListener validationStatusListener = onValidationStatusChanged(decoration);
validationStatus.addValueChangeListener(validationStatusListener);
@@ -43,8 +42,8 @@
}
- private ControlDecoration createDecoration(Control control) {
- ControlDecoration controlDecoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP);
+ private ControlDecoration createDecoration(Control control, int position) {
+ ControlDecoration controlDecoration = new ControlDecoration(control, position);
FieldDecoration fieldDecoration =
FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
controlDecoration.setImage(fieldDecoration.getImage());
14 years, 4 months
JBoss Tools SVN: r37178 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-09 11:49:34 -0500 (Fri, 09 Dec 2011)
New Revision: 37178
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
Log:
[JBIDE-10432] added control decoration for project name text field if its empty
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-12-09 16:45:54 UTC (rev 37177)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-12-09 16:49:34 UTC (rev 37178)
@@ -153,7 +153,7 @@
.in(dbc);
MultiValidator newProjectValidator = new NewProjectValidator(newProjectObservable, newProjectNameObservable);
dbc.addValidationStatusProvider(newProjectValidator);
- new ValidationStatusControlDecoration(newProjectValidator).showFor(newProjectText);
+ new ValidationStatusControlDecoration(newProjectValidator).showFor(newProjectText, SWT.TOP | SWT.LEFT);
Button browseProjectsButton = new Button(projectGroup, SWT.NONE);
browseProjectsButton.setText("Browse");
14 years, 4 months
JBoss Tools SVN: r37177 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-09 11:45:54 -0500 (Fri, 09 Dec 2011)
New Revision: 37177
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
Log:
[JBIDE-10432] added control decoration for project name text field if its empty
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-12-09 16:45:41 UTC (rev 37176)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-12-09 16:45:54 UTC (rev 37177)
@@ -50,6 +50,7 @@
import org.jboss.tools.common.ui.ssh.SshPrivateKeysPreferences;
import org.jboss.tools.openshift.express.client.OpenShiftException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.ValidationStatusControlDecoration;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ImportProjectWizard;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ImportProjectWizardModel;
@@ -109,7 +110,7 @@
projectGroup.setText("Project");
GridDataFactory.fillDefaults()
.align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(projectGroup);
- GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(3).applyTo(projectGroup);
+ GridLayoutFactory.fillDefaults().numColumns(3).margins(6, 6).applyTo(projectGroup);
Button newProjectCheckbox = new Button(projectGroup, SWT.CHECK);
newProjectCheckbox.setText("Create new Project");
@@ -133,6 +134,7 @@
.notUpdating(newProjectObservable)
.converting(new InvertingBooleanConverter())
.in(dbc);
+
Text newProjectText = new Text(projectGroup, SWT.BORDER);
newProjectText.setEditable(false);
GridDataFactory.fillDefaults()
@@ -149,8 +151,9 @@
.notUpdating(newProjectObservable)
.converting(new InvertingBooleanConverter())
.in(dbc);
- dbc.addValidationStatusProvider(
- new NewProjectValidator(newProjectObservable, newProjectNameObservable));
+ MultiValidator newProjectValidator = new NewProjectValidator(newProjectObservable, newProjectNameObservable);
+ dbc.addValidationStatusProvider(newProjectValidator);
+ new ValidationStatusControlDecoration(newProjectValidator).showFor(newProjectText);
Button browseProjectsButton = new Button(projectGroup, SWT.NONE);
browseProjectsButton.setText("Browse");
@@ -547,4 +550,5 @@
// return ValidationStatus.ok();
// }
// }
+
}
14 years, 4 months
JBoss Tools SVN: r37176 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-09 11:45:41 -0500 (Fri, 09 Dec 2011)
New Revision: 37176
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
Log:
[JBIDE-10432] added control decoration for project name text field if its empty
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java 2011-12-09 16:45:41 UTC (rev 37176)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui;
+
+import org.eclipse.core.databinding.ValidationStatusProvider;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.observable.value.IValueChangeListener;
+import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author André Dietisheim
+ */
+public class ValidationStatusControlDecoration {
+
+ private IObservableValue validationStatus;
+
+ public ValidationStatusControlDecoration(ValidationStatusProvider provider) {
+ this.validationStatus = provider.getValidationStatus();
+ }
+
+ public void showFor(Control control) {
+ ControlDecoration decoration = createDecoration(control);
+ IValueChangeListener validationStatusListener = onValidationStatusChanged(decoration);
+
+ validationStatus.addValueChangeListener(validationStatusListener);
+ control.addDisposeListener(onControlDisposed(validationStatusListener));
+
+ }
+
+ private ControlDecoration createDecoration(Control control) {
+ ControlDecoration controlDecoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP);
+ FieldDecoration fieldDecoration =
+ FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
+ controlDecoration.setImage(fieldDecoration.getImage());
+ if (validationStatus.getValue() instanceof IStatus) {
+ showDecoration(controlDecoration, (IStatus) validationStatus.getValue());
+ }
+ return controlDecoration;
+ }
+
+ private DisposeListener onControlDisposed(final IValueChangeListener validationStatusListener) {
+ return new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ validationStatus.removeValueChangeListener(validationStatusListener);
+ }
+ };
+ }
+
+ private IValueChangeListener onValidationStatusChanged(final ControlDecoration controlDecoration) {
+ return new IValueChangeListener() {
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ if (!(event.diff.getNewValue() instanceof IStatus)) {
+ return;
+ }
+ IStatus validationStatus = (IStatus) event.diff.getNewValue();
+ showDecoration(controlDecoration, validationStatus);
+ }
+ };
+ }
+
+ private void showDecoration(final ControlDecoration controlDecoration, IStatus validationStatus) {
+ if (validationStatus.isOK()) {
+ controlDecoration.hide();
+ } else {
+ controlDecoration.show();
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 4 months
JBoss Tools SVN: r37175 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-12-09 11:11:58 -0500 (Fri, 09 Dec 2011)
New Revision: 37175
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/IVpeUpdateListener.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
https://issues.jboss.org/browse/JBIDE-10357 : Add listeners in VpeController to support full/partial VPE refresh monitoring.
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/IVpeUpdateListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/IVpeUpdateListener.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/IVpeUpdateListener.java 2011-12-09 16:11:58 UTC (rev 37175)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor;
+
+/**
+ * Fired at the end of the VPE update/refresh jobs.
+ *
+ * @since 3.3
+ * @author Maxim Shmidov
+ */
+public interface IVpeUpdateListener {
+ void vpeUpdated();
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-12-09 16:09:09 UTC (rev 37174)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-12-09 16:11:58 UTC (rev 37175)
@@ -24,6 +24,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.MenuManager;
@@ -241,6 +242,8 @@
// contains vpe update delau time in miliseconds
private int vpeUpdateDelayTime;
+ private ListenerList updateListeners = new ListenerList();
+
public VpeController(VpeEditorPart editPart) {
this.editPart = editPart;
@@ -1403,6 +1406,7 @@
visualRefreshImpl();
monitor.done();
setSynced(true);
+ notifyVpeUpdateListeners();
return Status.OK_STATUS;
}
};
@@ -1596,6 +1600,7 @@
switcher.stopActiveEditor();
}
monitor.done();
+ notifyVpeUpdateListeners();
return Status.OK_STATUS;
}
@@ -2245,5 +2250,26 @@
public VpeDropWindow getDropWindow() {
return dropWindow;
}
-
+
+ /**
+ * Adds an event listener which is notified at the end
+ * of VPE update/refresh jobs. This allows clients to know when
+ * changing of the visual part is completed.
+ *
+ * @since 3.3
+ */
+ public void addVpeRefreshListener(final IVpeUpdateListener listener) {
+ updateListeners.add(listener);
+ }
+
+ /** @since 3.3 */
+ public void removeVpeRefreshListener(final IVpeUpdateListener listener) {
+ updateListeners.remove(listener);
+ }
+
+ private void notifyVpeUpdateListeners() {
+ for (Object listener : updateListeners.getListeners()) {
+ ((IVpeUpdateListener) listener).vpeUpdated();
+ }
+ }
}
14 years, 4 months
JBoss Tools SVN: r37174 - trunk/central.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-12-09 11:09:09 -0500 (Fri, 09 Dec 2011)
New Revision: 37174
Added:
trunk/central/README.milestone.testing.txt
Log:
add readme for milestone testing (alternate URL for discovery's directory.xml via cmdline)
Added: trunk/central/README.milestone.testing.txt
===================================================================
--- trunk/central/README.milestone.testing.txt (rev 0)
+++ trunk/central/README.milestone.testing.txt 2011-12-09 16:09:09 UTC (rev 37174)
@@ -0,0 +1,21 @@
+JBoss Central has a "software/update" page which gets its content from a hardcoded URL, set in the org.jboss.tools.central plugin.
+
+The published (current) milestone release URL is
+
+ http://download.jboss.org/jbosstools/updates/development/indigo/jbosstool...
+
+The stable branch (upcoming milestone) URL is
+
+ http://download.jboss.org/jbosstools/updates/nightly/core/3.3.indigo/jbos...
+
+The unstable trunk URL is
+
+ http://download.jboss.org/jbosstools/updates/nightly/core/trunk/jbosstool...
+
+The same as used for all milestone releases of JBoss Tools; should you want to pull the list of available updates from a NEWER directory file (eg., during a QE cycle when there's a milestone candidate available, but the published milestone site still contains the PREVIOUS milestone), you can do so using a commmandline flag.
+
+Thus, when running Eclipse or JBDS, simply pass in an alternate URL like this:
+
+./jbdevstudio -vmargs -Djboss.discovery.directory.url=http://download.jboss.org/jbosstools/updates/nightly/core/3.3.indigo/jbosstools-directory.xml
+./eclipse -vmargs -Djboss.discovery.directory.url=http://download.jboss.org/jbosstools/updates/nightly/core/3.3.indigo/jbosstools-directory.xml
+
14 years, 4 months
JBoss Tools SVN: r37173 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-12-09 10:45:01 -0500 (Fri, 09 Dec 2011)
New Revision: 37173
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java
Log:
changed checkFulfilled() method so that more than one seam version per run is supported
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java 2011-12-09 15:44:10 UTC (rev 37172)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java 2011-12-09 15:45:01 UTC (rev 37173)
@@ -7,7 +7,8 @@
@Override
public boolean checkFulfilled() {
- return SWTTestExt.configuredState.getSeam().isConfiured;
+ return SWTTestExt.configuredState.getSeam().isConfiured
+ && SWTTestExt.configuredState.getSeam().version.equals(TestConfigurator.currentConfig.getSeam().version);
}
@Override
14 years, 4 months
JBoss Tools SVN: r37172 - in trunk: jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2 and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-12-09 10:44:10 -0500 (Fri, 09 Dec 2011)
New Revision: 37172
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/CreateJSF2CompositeComponentMenuTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
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/FileHelper.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
Log:
Fixes for MacOs.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -6,6 +6,7 @@
import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3579Test;
import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3920Test;
import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE4391Test;
+import org.jboss.tools.jsf.ui.bot.test.jsf2.CreateJSF2CompositeComponentMenuTest;
import org.jboss.tools.jsf.ui.bot.test.jsf2.refactor.JSF2AttributeRenameTest;
import org.jboss.tools.jsf.ui.bot.test.jsf2.refactor.JSF2MoveParticipantTest;
import org.jboss.tools.jsf.ui.bot.test.jsf2.refactor.JSF2RenameParticipantTest;
@@ -54,7 +55,8 @@
MarkersTest.class,
WebXmlEditorTest.class,
CreateNewTemplateFromJSFProject.class,
- PropertiesEditorTest.class
+ PropertiesEditorTest.class,
+ CreateJSF2CompositeComponentMenuTest.class
})
public class JSFAllBotTests{
}
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/CreateJSF2CompositeComponentMenuTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/CreateJSF2CompositeComponentMenuTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/CreateJSF2CompositeComponentMenuTest.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.bot.test.jsf2;
+
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.Assertions;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.helper.FileHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+/** Tests Functionality of Create JSF2 Composite Component Menu Item of Context Menu
+ * @author Vladimir Pakan
+ *
+ */
+public class CreateJSF2CompositeComponentMenuTest extends JSFAutoTestCase{
+ private static final String CC_NAME_SPACE = "ccNameSpace";
+ private static final String CC_NAME = "ccName";
+ private static final String CC_FILE_NAME = CC_NAME + ".xhtml";
+ private SWTBotEditor jsf2editor = null;
+ private String originalContent = null;
+ /**
+ * Test if menu is working correctly
+ */
+ public void testMenuFunctionality(){
+ eclipse.closeAllEditors();
+ createJSF2Project(JSF2_TEST_PROJECT_NAME);
+ openPage(JSF2_TEST_PAGE, JSF2_TEST_PROJECT_NAME);
+ jsf2editor = SWTTestExt.bot.swtBotEditorExtByTitle(JSF2_TEST_PAGE);
+ originalContent = jsf2editor.toTextEditor().getText();
+ SWTJBTExt.selectTextInSourcePane(new SWTBotExt(),
+ JSF2_TEST_PAGE,
+ "<ui:define ",
+ 0,
+ 0,
+ 0);
+ jsf2editor.toTextEditor().insertText("\n");
+ ContextMenuHelper.clickContextMenu(jsf2editor, IDELabel.Menu.CREATE_JSF2_COMPOSITE);
+ bot.shell(IDELabel.Shell.CREATING_COMPOSITE_COMPONENT).activate();
+ bot.text().setText(CC_NAME_SPACE + ":" + CC_NAME);
+ bot.button(IDELabel.Button.OK).click();
+ bot.sleep(Timing.time2S());
+ jsf2editor.save();
+ bot.sleep(Timing.time2S());
+ final String activeEditorTitle = bot.activeEditor().getTitle();
+ assertTrue(activeEditorTitle.equals(CC_FILE_NAME));
+ Assertions.assertFileExistsInWorkspace(CC_FILE_NAME, JSF2_TEST_PROJECT_NAME,"WebContent","resources",CC_NAME_SPACE);
+ final String editorText = jsf2editor.toTextEditor().getText();
+ Assertions.assertSourceEditorContains(editorText.replaceAll(" ", ""),
+ "<" + CreateJSF2CompositeComponentMenuTest.CC_NAME_SPACE + ":" + CreateJSF2CompositeComponentMenuTest.CC_NAME + ">" +
+ "</" + CreateJSF2CompositeComponentMenuTest.CC_NAME_SPACE + ":" + CreateJSF2CompositeComponentMenuTest.CC_NAME + ">",
+ JSF2_TEST_PROJECT_NAME);
+ Assertions.assertSourceEditorContains(editorText,
+ "xmlns:" + CreateJSF2CompositeComponentMenuTest.CC_NAME_SPACE +
+ "=\"http://java.sun.com/jsf/composite/" + CreateJSF2CompositeComponentMenuTest.CC_NAME_SPACE + "\"",
+ JSF2_TEST_PROJECT_NAME);
+ }
+ /**
+ * Tests if Menu is Not present for JSF project version 1.2
+ */
+ public void testMenuNotPresentForJSF12Project(){
+ // Test default JSF 1.2 Project
+ openPage(VPEAutoTestCase.TEST_PAGE,VPEAutoTestCase.JBT_TEST_PROJECT_NAME);
+ try{
+ ContextMenuHelper.clickContextMenu(SWTTestExt.bot.swtBotEditorExtByTitle(VPEAutoTestCase.TEST_PAGE),
+ IDELabel.Menu.CREATE_JSF2_COMPOSITE);
+ assertTrue("Menu Item has to be disabled but is not" , false);
+ } catch (RuntimeException re){
+ if (!(re.getCause() instanceof NotEnabledException)){
+ throw re;
+ }
+ }
+ // Test JSF 1.2 Project with Facelets
+ openPage(VPEAutoTestCase.FACELETS_TEST_PAGE,VPEAutoTestCase.FACELETS_TEST_PROJECT_NAME);
+ try{
+ ContextMenuHelper.clickContextMenu(SWTTestExt.bot.swtBotEditorExtByTitle(VPEAutoTestCase.FACELETS_TEST_PAGE),
+ IDELabel.Menu.CREATE_JSF2_COMPOSITE);
+ assertTrue("Menu Item has to be disabled but is not" , false);
+ } catch (RuntimeException re){
+ if (!(re.getCause() instanceof NotEnabledException)){
+ throw re;
+ }
+ }
+ }
+ @Override
+ public void tearDown() throws Exception {
+ if (jsf2editor != null) {
+ jsf2editor.toTextEditor().setText(originalContent);
+ jsf2editor.saveAndClose();
+ bot.sleep(Timing.time1S());
+ }
+ if (FileHelper.isExistingFileWithinWorkspace(CC_NAME_SPACE, JSF2_TEST_PROJECT_NAME,"WebContent","resources")){
+ eclipse.deleteFile(JSF2_TEST_PROJECT_NAME,"WebContent","resources",CC_NAME_SPACE);
+ }
+ super.tearDown();
+ }
+}
+
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/CreateJSF2CompositeComponentMenuTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -4,10 +4,9 @@
import java.util.Arrays;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.jboss.tools.ui.bot.ext.helper.MarkerHelper;
+import org.jboss.tools.ui.bot.ext.helper.FileHelper;
public class Assertions {
/**
@@ -35,7 +34,7 @@
*/
public static void assertFileExistsInWorkspace (String fileName , String... pathWithinWorkspace){
assertTrue("File " + fileName + " does not exist.",
- isExistingFileWithinWorkspace (fileName, pathWithinWorkspace));
+ FileHelper.isExistingFileWithinWorkspace (fileName, pathWithinWorkspace));
}
/**
* Asserts that given file does not exists
@@ -44,20 +43,8 @@
*/
public static void assertFileNotExistsInWorkspace (String fileName , String... pathWithinWorkspace){
assertTrue("File " + fileName + " does exist but it has to be deleted.",
- !isExistingFileWithinWorkspace (fileName, pathWithinWorkspace));
+ !FileHelper.isExistingFileWithinWorkspace (fileName, pathWithinWorkspace));
}
- /**
- * Returns true when specified file exists on the path within workspace
- * @param fileName
- * @param pathWithinWorkspace
- * @return
- */
- private static boolean isExistingFileWithinWorkspace(String fileName , String... pathWithinWorkspace){
- return ResourcesPlugin
- .getWorkspace()
- .getRoot()
- .findMember(MarkerHelper.getPathToResource(fileName, pathWithinWorkspace)) != null;
- }
/**
* Asserts if sourceEditorText of file with fileName contains textToContain
* @param sourceEditorText
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -315,6 +315,16 @@
public SWTBotEditor openFile(String projectName, String... path) {
return SWTEclipseExt.openFile(bot, projectName, path);
}
+
+ /**
+ * Delete File in Package Explorer
+ *
+ * @param projectName
+ * @param path
+ */
+ public void deleteFile(String projectName, String... path) {
+ SWTEclipseExt.deleteFile(bot, projectName, path);
+ }
// ------------------------------------------------------------
// Navigation related
@@ -1493,4 +1503,36 @@
bot.button(IDELabel.Button.OK).click();
util.waitForNonIgnoredJobs();
}
+
+ /**
+ * Deletes file from Package Explorer static version
+ * @param bot
+ * @param path
+ * @return SWTBotEditor
+ */
+ public static void deleteFile(SWTBotExt bot, String projectName, String... path) {
+ SWTBot viewBot = bot.viewByTitle(IDELabel.View.PACKAGE_EXPLORER).bot();
+ bot.viewByTitle(IDELabel.View.PACKAGE_EXPLORER).show();
+ bot.viewByTitle(IDELabel.View.PACKAGE_EXPLORER).setFocus();
+ SWTBotTree tree = viewBot.tree();
+ SWTBotTreeItem item = tree.expandNode(projectName);
+ StringBuilder builder = new StringBuilder(projectName);
+
+ // Go through path
+ for (String nodeName : path) {
+ item = item.expandNode(nodeName);
+ builder.append("/" + nodeName);
+ }
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.DELETE, false)).click();
+
+ bot.shell(IDELabel.Shell.CONFIRM_DELETE).activate();
+ bot.button(IDELabel.Button.OK).click();
+ new SWTUtilExt(bot).waitForNonIgnoredJobs();
+
+ log.info("File Deleted: " + builder.toString());
+
+ }
}
\ No newline at end of file
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 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -21,11 +21,13 @@
import java.util.Vector;
import org.apache.log4j.Logger;
+import org.eclipse.core.commands.NotEnabledException;
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.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
@@ -268,15 +270,20 @@
throw new WidgetNotFoundException("Could not find menu: "
+ Arrays.asList(texts));
}
+ // hide on MacOs
+ if (SWTJBTExt.isRunningOnMacOs()) {
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_ESCAPE);
+ }
// click
click(menuItem);
- // hide
- UIThreadRunnable.syncExec(new VoidResult() {
- public void run() {
- hide(menuItem.getParent());
- }
- });
-
+ // hide on other systems
+ if (!SWTJBTExt.isRunningOnMacOs()) {
+ UIThreadRunnable.syncExec(new VoidResult() {
+ public void run() {
+ hide(menuItem.getParent());
+ }
+ });
+ }
}
/**
@@ -361,13 +368,25 @@
event.widget = menuItem;
event.display = menuItem.getDisplay();
event.type = SWT.Selection;
-
- UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
- public void run() {
- log.info("Click on menu item: " + menuItem.getText());
- menuItem.notifyListeners(SWT.Selection, event);
+
+ final boolean isEnabled = UIThreadRunnable.syncExec(new Result<Boolean>() {
+ public Boolean run() {
+ return menuItem.getEnabled();
}
});
+
+ if (isEnabled){
+ UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
+ public void run() {
+ log.info("Click on menu item: " + menuItem.getText());
+ menuItem.notifyListeners(SWT.Selection, event);
+ }
+ });
+ }
+ else{
+ throw new RuntimeException(new NotEnabledException("Menu item is not enabled"));
+ }
+
}
/**
@@ -383,13 +402,21 @@
return UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
public Menu run() {
Menu result = null;
- Composite parent = tree.getParent();
- while (!(parent instanceof Decorations)) {
- parent = parent.getParent();
+ Object menusHolder = null;
+ if (SWTJBTExt.isRunningOnMacOs()){
+ menusHolder = tree.getDisplay();
}
+ else{
+ Composite parent = (Composite)tree.getParent();
+ while (!(parent instanceof Decorations)){
+ parent = parent.getParent();
+ }
+ menusHolder = parent;
+ }
+
try {
- Menu[] menus = ReflectionsHelper.getPrivateFieldValue(
- Decorations.class, "menus", parent, Menu[].class);
+ Menu[] menus = ReflectionsHelper.getPrivateFieldValue(SWTJBTExt.isRunningOnMacOs() ? Display.class : Decorations.class,
+ "menus", menusHolder, Menu[].class);
if (menus != null) {
MenuItem topMenuItem = null;
int index = menus.length - 1;
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileHelper.java 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileHelper.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -24,6 +24,7 @@
import java.util.zip.ZipFile;
import org.apache.log4j.Logger;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -120,7 +121,18 @@
propertiesBot.button(IDELabel.Button.OK).click();
return projectLocation;
}
-
+ /**
+ * Returns true when specified file exists on the path within workspace
+ * @param fileName
+ * @param pathWithinWorkspace
+ * @return
+ */
+ public static boolean isExistingFileWithinWorkspace(String fileName , String... pathWithinWorkspace){
+ return ResourcesPlugin
+ .getWorkspace()
+ .getRoot()
+ .findMember(MarkerHelper.getPathToResource(fileName, pathWithinWorkspace)) != null;
+ }
public static void unzipArchive(File archive, File outputDir)
throws Exception {
log.info("Unzipping " + archive.getCanonicalPath() + " to "
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -30,9 +30,8 @@
}
public void testGlobalELVariables() throws Throwable{
- bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
- bot.shell(IDELabel.Shell.PREFERENCES).activate();
- SWTBotTree preferenceTree = this.bot.tree();
+ open.preferenceOpen(ActionItem.Preference.JBossTools.LABEL);
+ SWTBotTree preferenceTree = this.bot.tree();
preferenceTree
.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS)
.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB)
@@ -87,7 +86,7 @@
@Override
public void tearDown() throws Exception {
- bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ open.preferenceOpen(ActionItem.Preference.JBossTools.LABEL);
SWTBotTree preferenceTree = this.bot.tree();
preferenceTree.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS)
.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB)
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2011-12-09 15:34:27 UTC (rev 37171)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2011-12-09 15:44:10 UTC (rev 37172)
@@ -33,7 +33,7 @@
public class ExternalizeStringsDialogTest extends VPEAutoTestCase {
private final String ENABLED_TEST_TEXT = "<html>Externalize Text</html>"; //$NON-NLS-1$
- private final String TOOL_TIP = (SWTJBTExt.isRunningOnMacOs() ? "Externalize Strings... (⌘7)" : "Externalize selected string... (Ctrl+7)"); //$NON-NLS-1$
+ private final String TOOL_TIP = (SWTJBTExt.isRunningOnMacOs() ? "Externalize selected string... (⌘7)" : "Externalize selected string... (Ctrl+7)"); //$NON-NLS-1$
private final String FOLDER_TEXT_LABEL = "Enter or select the parent folder:"; //$NON-NLS-1$
private final String INCORRECT_TABLE_VALUE = "Table value is incorrect"; //$NON-NLS-1$
private final String TOOLBAR_ICON_ENABLED = "Toolbar button should be enabled"; //$NON-NLS-1$
14 years, 4 months
JBoss Tools SVN: r37171 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-12-09 10:34:27 -0500 (Fri, 09 Dec 2011)
New Revision: 37171
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Added new Shell Titles
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-12-09 15:11:40 UTC (rev 37170)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-12-09 15:34:27 UTC (rev 37171)
@@ -87,6 +87,7 @@
public static final String AUTO_LAYOUT = "Auto Layout";
public static final String CDI_REFACTOR = "CDI Refactor";
public static final String CLEAN = "Clean...";
+ public static final String CREATE_JSF2_COMPOSITE = "Create JSF2 composite...";
}
public class Button {
@@ -193,6 +194,7 @@
public static final String CLASSPATH_VARIABLES_CHANGED = "Classpath Variables Changed";
public static final String CLEAN = "Clean";
public static final String SELECT_CLASS = "Select Class";
+ public static final String CREATING_COMPOSITE_COMPONENT = "Creating composite component";
}
public class EntityGroup {
14 years, 4 months