JBoss Tools SVN: r38870 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-17 08:29:35 -0500 (Fri, 17 Feb 2012)
New Revision: 38870
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8701 - junit was disabled
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2012-02-17 13:22:08 UTC (rev 38869)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2012-02-17 13:29:35 UTC (rev 38870)
@@ -37,7 +37,7 @@
// suite.addTestSuite(VpePopupMenuTest.class);
suite.addTestSuite(VpeEditAnyDialogTest.class);
suite.addTestSuite(MultipleSelectionTest.class);
- suite.addTestSuite(ScrollingTest_Jbide8701.class);
+// suite.addTestSuite(ScrollingTest_Jbide8701.class);
return new VpeTestSetup(suite);
}
}
14 years, 1 month
JBoss Tools SVN: r38869 - in trunk: openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-17 08:22:08 -0500 (Fri, 17 Feb 2012)
New Revision: 38869
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
Log:
patch for the recurring 'already publishing' error
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2012-02-17 13:17:15 UTC (rev 38868)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2012-02-17 13:22:08 UTC (rev 38869)
@@ -84,10 +84,13 @@
protected void publishFinish(IProgressMonitor monitor) throws CoreException {
if( method == null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Not publishing")); //$NON-NLS-1$
- int result = method.publishFinish(this, monitor);
- setServerPublishState(result);
- publishTaskModel = null;
- method = null;
+ try {
+ int result = method.publishFinish(this, monitor);
+ setServerPublishState(result);
+ } finally {
+ publishTaskModel = null;
+ method = null;
+ }
}
protected void setPublishData(String key, Object val) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2012-02-17 13:17:15 UTC (rev 38868)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2012-02-17 13:22:08 UTC (rev 38869)
@@ -137,6 +137,9 @@
}
} catch(CoreException ce) {
// Comes if either commit or push has failed
+ if( ce.getMessage().contains("UP_TO_DATE"))
+ return null;
+
try {
result = EGitUtils.pushForce(remoteName, repository, new SubProgressMonitor(monitor, 100));
monitor.done();
14 years, 1 month
JBoss Tools SVN: r38868 - trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-02-17 08:17:15 -0500 (Fri, 17 Feb 2012)
New Revision: 38868
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java
Log:
https://issues.jboss.org/browse/JBIDE-10943 BrowserSim: the browser area is transparent
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java 2012-02-17 13:15:28 UTC (rev 38867)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java 2012-02-17 13:17:15 UTC (rev 38868)
@@ -1,5 +1,7 @@
package org.jboss.tools.vpe.browsersim.ui.skin.ios;
+import java.util.Arrays;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
@@ -21,13 +23,15 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.vpe.browsersim.browser.BrowserSimBrowser;
import org.jboss.tools.vpe.browsersim.browser.IBrowserSimBrowserFactory;
-import org.jboss.tools.vpe.browsersim.model.Device;
import org.jboss.tools.vpe.browsersim.model.DeviceOrientation;
import org.jboss.tools.vpe.browsersim.ui.ControlHandler;
+import org.jboss.tools.vpe.browsersim.ui.skin.AppleIPhone3Skin;
import org.jboss.tools.vpe.browsersim.ui.skin.BrowserSimSkin;
public class AppleIPhone3ResizableSkin implements BrowserSimSkin {
- private static final Point VERTICAL_BORDERS_SIZE = new Point(384 - 320, 727 - 480);
+ private static final Point NORMAL_SKREEN_SIZE = new Point(320, 480);
+ private static final Point NORMAL_SKIN_SIZE = new Point(384, 727);
+ private static final Point VERTICAL_BORDERS_SIZE = new Point(NORMAL_SKIN_SIZE.x - NORMAL_SKREEN_SIZE.x, NORMAL_SKIN_SIZE.y - NORMAL_SKREEN_SIZE.y);
private static final Point HORIZONTAL_BORDERS_SIZE = new Point(VERTICAL_BORDERS_SIZE.y, VERTICAL_BORDERS_SIZE.x);
private static final IPhoneSkinDescriptor VERTICAL_IPHONE3_DESCRIPTOR;
static {
@@ -125,32 +129,67 @@
}
private void setShellRegion() {
- shell.setRegion(null);
- display.asyncExec(new Runnable() {
-
- @Override
- public void run() {
- Region region = new Region();
-// shellRegion.add(AppleIPhone3Skin.VISIBLE_REGION[0]);
- GC gc = new GC(shell);
- final Image screenshot = new Image(display, shell.getBounds());
- gc.copyArea(screenshot, 0, 0);
- gc.dispose();
- ImageData imageData = screenshot.getImageData();
- region.add(0, 0, imageData.width, imageData.height);
- int firstPixel = imageData.getPixel(0, 0);
- for (int i = 0; i < imageData.height; i++) {
- for (int j = 0; j < imageData.width; j++) {
- if (imageData.getPixel(j, i) == firstPixel) {
- region.subtract(j, i, 1, 1);
- }
- }
- }
- screenshot.dispose();
- shell.setRegion(region);
- region.dispose();
+ int[] normalRegion;
+ if (vertical) {
+ normalRegion = AppleIPhone3Skin.VISIBLE_REGION[0];
+ } else {
+ normalRegion = AppleIPhone3Skin.VISIBLE_REGION[1];
+ }
+
+ Point normalRegionSize = new Point(0, 0);
+ for (int i = 0; i < normalRegion.length; i += 2) {
+ if (normalRegionSize.x < normalRegion[i]) {
+ normalRegionSize.x = normalRegion[i];
}
- });
+ if (normalRegionSize.y < normalRegion[i + 1]) {
+ normalRegionSize.y = normalRegion[i + 1];
+ }
+ }
+
+ Point normalRegionCenter = new Point(normalRegionSize.x / 2, normalRegionSize.y / 2);
+ Point shellSize = shell.getSize();
+ Point regionIncrement = new Point(shellSize.x - normalRegionSize.x, shellSize.y - normalRegionSize.y);
+
+ int[] shellRegion = Arrays.copyOf(normalRegion, normalRegion.length);
+ for (int i = 0; i < shellRegion.length; i += 2) {
+ if (shellRegion[i] > normalRegionCenter.x) {
+ shellRegion[i] += regionIncrement.x;
+ }
+ if (shellRegion[i + 1] > normalRegionCenter.y) {
+ shellRegion[i + 1] += regionIncrement.y;
+ }
+ }
+ Region region = new Region();
+ region.add(shellRegion);
+ shell.setRegion(region);
+ region.dispose();
+ ////////////////////////////////
+// shell.setRegion(null);
+// display.asyncExec(new Runnable() {
+//
+// @Override
+// public void run() {
+// Region region = new Region();
+//// shellRegion.add(AppleIPhone3Skin.VISIBLE_REGION[0]);
+// GC gc = new GC(shell);
+// final Image screenshot = new Image(display, shell.getBounds());
+// gc.copyArea(screenshot, 0, 0);
+// gc.dispose();
+// ImageData imageData = screenshot.getImageData();
+// region.add(0, 0, imageData.width, imageData.height);
+// int firstPixel = imageData.getPixel(0, 0);
+// for (int i = 0; i < imageData.height; i++) {
+// for (int j = 0; j < imageData.width; j++) {
+// if (imageData.getPixel(j, i) == firstPixel) {
+// region.subtract(j, i, 1, 1);
+// }
+// }
+// }
+// screenshot.dispose();
+// shell.setRegion(region);
+// region.dispose();
+// }
+// });
}
private void bindIPhoneCompositeControls() {
14 years, 1 month
JBoss Tools SVN: r38867 - trunk/maven/tests/org.jboss.tools.maven.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: rawagner
Date: 2012-02-17 08:15:28 -0500 (Fri, 17 Feb 2012)
New Revision: 38867
Modified:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml
Log:
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml 2012-02-17 12:57:08 UTC (rev 38866)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml 2012-02-17 13:15:28 UTC (rev 38867)
@@ -136,7 +136,7 @@
</dependency>
<dependency>
<type>p2-installable-unit</type>
- <artifactId>org.jboss.tools.maven.project.profiles.feature.feature.group</artifactId>
+ <artifactId>org.jboss.tools.maven.profiles.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
14 years, 1 month
JBoss Tools SVN: r38866 - 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: xcoulon
Date: 2012-02-17 07:57:08 -0500 (Fri, 17 Feb 2012)
New Revision: 38866
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java
Log:
Renaming the wizard (at the title bar level)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java 2012-02-17 12:37:39 UTC (rev 38865)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java 2012-02-17 12:57:08 UTC (rev 38866)
@@ -18,7 +18,7 @@
* Constructor
*/
public ImportOpenShiftExpressApplicationWizard() {
- super("Import OpenShift Express Application");
+ super("Import OpenShift Application");
}
/**
@@ -28,6 +28,6 @@
* @param application
*/
public ImportOpenShiftExpressApplicationWizard(IUser user, IProject project, IApplication application) {
- super(user, project, application, "Import OpenShift Express Application");
+ super(user, project, application, "Import OpenShift Application");
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java 2012-02-17 12:37:39 UTC (rev 38865)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java 2012-02-17 12:57:08 UTC (rev 38866)
@@ -15,10 +15,10 @@
* Constructor
*/
public NewOpenShiftExpressApplicationWizard() {
- super("New OpenShift Express Application");
+ super("New OpenShift Application");
}
public NewOpenShiftExpressApplicationWizard(IUser user) {
- super(user, null, null, "New OpenShift Express Application");
+ super(user, null, null, "New OpenShift Application");
}
}
14 years, 1 month
JBoss Tools SVN: r38865 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-02-17 07:37:39 -0500 (Fri, 17 Feb 2012)
New Revision: 38865
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
Log:
changed screenshots directory
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-02-17 12:32:37 UTC (rev 38864)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-02-17 12:37:39 UTC (rev 38865)
@@ -16,7 +16,7 @@
<jbosstools.test.jboss-gatein.home>${requirement.build.root}/GateIn-3.1.0-GA</jbosstools.test.jboss-gatein.home>
<jbosstools.test.jboss-seam.home>${requirement.build.root}/jboss-seam-2.2.1.CR2</jbosstools.test.jboss-seam.home> <!--TODO setup default path -->
<configurations.dir>resources/project_config_files</configurations.dir>
- <systemProperties>-Djbosstools.test.jboss-gatein.home=${jbosstools.test.jboss-gatein.home} -Djbosstools.test.jboss-seam.home=${jbosstools.test.jboss-seam.home} -Dtest.configurations.dir=${configurations.dir} -Dorg.eclipse.swtbot.screenshots.dir=${project.build.outputDirectory}/screenshots</systemProperties>
+ <systemProperties>-Djbosstools.test.jboss-gatein.home=${jbosstools.test.jboss-gatein.home} -Djbosstools.test.jboss-seam.home=${jbosstools.test.jboss-seam.home} -Dtest.configurations.dir=${configurations.dir} -Dorg.eclipse.swtbot.screenshots.dir=${project.build.directory}/screenshots</systemProperties>
<test.class>org.jboss.tools.portlet.ui.bot.test.AllTestsSuite</test.class>
</properties>
14 years, 1 month
JBoss Tools SVN: r38864 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard: appimport and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-17 07:32:37 -0500 (Fri, 17 Feb 2012)
New Revision: 38864
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
Log:
JBIDE-10511 - fixed it
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-17 10:34:22 UTC (rev 38863)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-17 12:32:37 UTC (rev 38864)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
@@ -81,8 +82,27 @@
, getRemoteName()
, getRepositoryFile())
.execute(monitor);
- createServerAdapter(monitor, importedProjects);
+ String appName = getApplication().getName();
+ String host = getApplication().getApplicationUrl();
+ IServer found = findServer(appName, host);
+ if( found == null )
+ createServerAdapter(monitor, importedProjects);
+ else {
+ new ServerAdapterFactory().addModules(found, importedProjects, monitor);
+ }
}
+
+ private IServer findServer(String appName, String host) {
+ IServer[] all = ServerCore.getServers();
+ for( int i = 0; i < all.length; i++ ) {
+ String host1 = all[i].getHost();
+ String app1 = ExpressServerUtils.getExpressApplicationName(all[i]);
+ if( (host.endsWith("/" + host1 + "/") || (host.endsWith("/" + host1)))
+ && appName.equals(app1))
+ return all[i];
+ }
+ return null;
+ }
/**
* Enables the user chosen, unshared project to be used on the chosen
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2012-02-17 10:34:22 UTC (rev 38863)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2012-02-17 12:32:37 UTC (rev 38864)
@@ -112,6 +112,10 @@
application.getName(), application.getUUID(), mode, remoteName);
return server;
}
+
+ public void addModules(IServer server, List<IProject> importedProjects, IProgressMonitor monitor) throws CoreException {
+ addModules(getModules(importedProjects), server, monitor);
+ }
private void addModules(List<IModule> modules, IServer server, IProgressMonitor monitor) throws CoreException {
if (modules == null
14 years, 1 month
JBoss Tools SVN: r38863 - 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: 2012-02-17 05:34:22 -0500 (Fri, 17 Feb 2012)
New Revision: 38863
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
Log:
increased timeout to 2 minutes
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-17 09:32:10 UTC (rev 38862)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-17 10:34:22 UTC (rev 38863)
@@ -39,7 +39,7 @@
protected HashMap<String, Object> dataModel = new HashMap<String, Object>();
- private static final int APP_CREATION_TIMEOUT = 60;
+ private static final int APP_CREATION_TIMEOUT = 120;
private static final String KEY_SELECTED_EMBEDDABLE_CARTRIDGES = "selectedEmbeddableCartridges";
public OpenShiftExpressApplicationWizardModel(IUser user) {
14 years, 1 month
JBoss Tools SVN: r38862 - in trunk: as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-17 04:32:10 -0500 (Fri, 17 Feb 2012)
New Revision: 38862
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IPasswordPrompter.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegator.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/UserPassCredentialProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IUserModelListener.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java
Log:
JBIDE-10908 - any user with an empty password should prompt for password before doing any operations.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java 2012-02-17 07:55:47 UTC (rev 38861)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -25,7 +25,6 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.UIUtil;
@@ -37,18 +36,28 @@
public static final int IGNORE_ID = IDialogConstants.CLIENT_ID | 3;
private String user, pass;
private boolean save;
- private JBossServer jbs;
-
- public RequiredCredentialsDialog(Shell parentShell, JBossServer jbs) {
+ private boolean canModifyUser = true;
+ private String description;
+ public RequiredCredentialsDialog(Shell parentShell, String initialUser, String initialPass) {
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE);
- this.jbs = jbs;
+ this.user = initialUser;
+ this.pass = initialPass;
+ this.description = Messages.credentials_warning;
}
+ public void setCanModifyUser(boolean val) {
+ canModifyUser = val;
+ }
+
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(Messages.RequiredCredentialsDialog_ShellText);
}
+
+ public void setDescription(String desc) {
+ this.description = desc;
+ }
protected Control createDialogArea(Composite parent) {
Composite c = (Composite) super.createDialogArea(parent);
@@ -74,7 +83,7 @@
passText.setLayoutData(u.createFormData(passLabel, 5, null, 0, 0,5, 100, -5));
saveCredentials.setLayoutData(u.createFormData(passText, 10, null, 0, 0,5, 100, -5));
- top.setText(Messages.credentials_warning);
+ top.setText(description);
userLabel.setText(Messages.swf_Username);
passLabel.setText(Messages.swf_Password);
saveCredentials.setText(Messages.credentials_save);
@@ -101,11 +110,13 @@
saveCredentials.addSelectionListener(listener2);
// defaults
- userText.setText(jbs.getUsername());
- userText.setSelection(0, jbs.getUsername() == null ? 0 : jbs.getUsername().length());
- passText.setText(jbs.getPassword());
+ userText.setText(user);
+ userText.setSelection(0, user == null ? 0 : user.length());
+ passText.setText(pass);
// save by default
saveCredentials.setSelection(true);
+
+ userText.setEnabled(canModifyUser);
return c;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/UserPassCredentialProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/UserPassCredentialProvider.java 2012-02-17 07:55:47 UTC (rev 38861)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/UserPassCredentialProvider.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -56,7 +56,10 @@
IServer server = inNeed.getServer();
IServerWorkingCopy copy = server.createWorkingCopy();
JBossServer jbs = ServerConverter.getJBossServer(copy);
- RequiredCredentialsDialog d = new RequiredCredentialsDialog(new Shell(), jbs);
+ String initialUser = jbs.getUsername();
+ String initialPass = jbs.getPassword();
+ RequiredCredentialsDialog d = new RequiredCredentialsDialog(
+ new Shell(), initialUser, initialPass);
if( d.open() == Window.OK) {
if( d.getSave() ) {
jbs.setPassword(d.getPass());
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IPasswordPrompter.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IPasswordPrompter.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IPasswordPrompter.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.console;
+
+import com.openshift.express.client.IUser;
+
+public interface IPasswordPrompter {
+ public String getPasswordFor(IUser user);
+}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IUserModelListener.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IUserModelListener.java 2012-02-17 07:55:47 UTC (rev 38861)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IUserModelListener.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.console;
import com.openshift.express.client.IUser;
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegator.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegator.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegator.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.console;
+
+import java.util.List;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.ICartridge;
+import com.openshift.express.client.IDomain;
+import com.openshift.express.client.IEmbeddableCartridge;
+import com.openshift.express.client.ISSHPublicKey;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+public class UserDelegator implements IUser {
+ private IUser delegate;
+ public UserDelegator(IUser user) {
+ this.delegate = user;
+ }
+
+ public String getRhlogin() {
+ return delegate.getRhlogin();
+ }
+ public String getPassword() {
+ return delegate.getPassword();
+ }
+ protected void checkForPassword() {
+ if( delegate.getPassword() == null || "".equals(delegate.getPassword())) {
+ try {
+ String newPw = UserModel.promptForPassword(this);
+ delegate = UserModel.getDefault().createUser(delegate.getRhlogin(), newPw);
+ } catch( Exception e ) {
+ // TODO log handle everything
+ }
+ }
+ }
+
+ public IApplication createApplication(String arg0, ICartridge arg1)
+ throws OpenShiftException {
+ checkForPassword();
+ return delegate.createApplication(arg0, arg1);
+ }
+
+ public IDomain createDomain(String arg0, ISSHPublicKey arg1)
+ throws OpenShiftException {
+ checkForPassword();
+ return delegate.createDomain(arg0, arg1);
+ }
+ public IApplication getApplicationByName(String arg0)
+ throws OpenShiftException {
+ checkForPassword();
+ return delegate.getApplicationByName(arg0);
+ }
+ public List<IApplication> getApplications() throws OpenShiftException {
+ checkForPassword();
+ return delegate.getApplications();
+ }
+ public List<IApplication> getApplicationsByCartridge(ICartridge arg0)
+ throws OpenShiftException {
+ checkForPassword();
+ return delegate.getApplicationsByCartridge(arg0);
+ }
+ public String getAuthIV() {
+ checkForPassword();
+ return delegate.getAuthIV();
+ }
+ public String getAuthKey() {
+ checkForPassword();
+ return delegate.getAuthKey();
+ }
+ public ICartridge getCartridgeByName(String arg0) throws OpenShiftException {
+ checkForPassword();
+ return delegate.getCartridgeByName(arg0);
+ }
+ public List<ICartridge> getCartridges() throws OpenShiftException {
+ checkForPassword();
+ return delegate.getCartridges();
+ }
+ public IDomain getDomain() throws OpenShiftException {
+ checkForPassword();
+ return delegate.getDomain();
+ }
+ public List<IEmbeddableCartridge> getEmbeddableCartridges()
+ throws OpenShiftException {
+ checkForPassword();
+ return delegate.getEmbeddableCartridges();
+ }
+ public ISSHPublicKey getSshKey() throws OpenShiftException {
+ checkForPassword();
+ return delegate.getSshKey();
+ }
+ public String getUUID() throws OpenShiftException {
+ checkForPassword();
+ return delegate.getUUID();
+ }
+ public boolean hasApplication(String arg0) throws OpenShiftException {
+ checkForPassword();
+ return delegate.hasApplication(arg0);
+ }
+ public boolean hasApplication(ICartridge arg0) throws OpenShiftException {
+ checkForPassword();
+ return delegate.hasApplication(arg0);
+ }
+ public boolean hasDomain() throws OpenShiftException {
+ checkForPassword();
+ return delegate.hasDomain();
+ }
+ public boolean isValid() throws OpenShiftException {
+ checkForPassword();
+ return delegate.isValid();
+ }
+ public void refresh() throws OpenShiftException {
+ checkForPassword();
+ delegate.refresh();
+ }
+}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-02-17 07:55:47 UTC (rev 38861)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -41,6 +41,14 @@
return model;
}
+ private static IPasswordPrompter prompter;
+ public static void setPasswordPrompt(IPasswordPrompter prompt) {
+ prompter =prompt;
+ }
+ public static String promptForPassword(IUser user) {
+ return prompter == null ? null : prompter.getPasswordFor(user);
+ }
+
/** The most recent user connected on OpenShift. */
private IUser recentUser = null;
private HashMap<String, IUser> allUsers = new HashMap<String, IUser>();
@@ -139,7 +147,7 @@
try {
String password = getPasswordFromSecureStorage(users[i]);
IUser u = createUser(users[i], password);
- addUser(u);
+ addUser(new UserDelegator(u));
} catch (OpenShiftException ose) {
// TODO
} catch (IOException ioe) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java 2012-02-17 07:55:47 UTC (rev 38861)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java 2012-02-17 09:32:10 UTC (rev 38862)
@@ -8,16 +8,23 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.ide.eclipse.as.ui.dialogs.RequiredCredentialsDialog;
+import org.jboss.tools.openshift.express.internal.core.console.IPasswordPrompter;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.osgi.framework.BundleContext;
+import com.openshift.express.client.IUser;
+
/**
* The activator class controls the plug-in life cycle
*/
-public class OpenShiftUIActivator extends AbstractUIPlugin {
+public class OpenShiftUIActivator extends AbstractUIPlugin implements IPasswordPrompter {
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.openshift.express.ui"; //$NON-NLS-1$
@@ -41,6 +48,7 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ UserModel.setPasswordPrompt(this);
}
/*
@@ -117,4 +125,21 @@
URL imageFileUrl = FileLocator.find(this.getBundle(), imageFilePath, null);
return ImageDescriptor.createFromURL(imageFileUrl);
}
+
+ public String getPasswordFor(final IUser user) {
+ final String[] val =new String[1];
+ val[0] = null;
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ Shell shell = Display.getDefault().getActiveShell();
+ RequiredCredentialsDialog d = new RequiredCredentialsDialog(shell, user.getRhlogin(), user.getPassword());
+ d.setCanModifyUser(false);
+ d.setDescription("Provide enter the password for your express server");
+ if( d.open() == Window.OK) {
+ val[0] = d.getPass();
+ }
+ }
+ });
+ return val[0];
+ }
}
14 years, 1 month
JBoss Tools SVN: r38861 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-17 02:55:47 -0500 (Fri, 17 Feb 2012)
New Revision: 38861
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
Log:
JBIDE-10733 and JBIDE-10734
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2012-02-17 07:06:33 UTC (rev 38860)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2012-02-17 07:55:47 UTC (rev 38861)
@@ -13,6 +13,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
+import java.util.ArrayList;
import java.util.HashMap;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -38,6 +39,7 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
@@ -72,6 +74,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
public class DeploymentModuleOptionCompositeAssistant implements PropertyChangeListener {
public static interface IDeploymentPageCallback {
@@ -132,6 +135,11 @@
return beh.openBrowseDialog(page, original);
}
+ // Combo strings - TODO extract to messages
+ private static final String ALL = "All";
+ private static final String DEPLOYED = "Deployed";
+ private static final String BY_MODNAME = "By Module Name";
+ private static final String BY_MODTYPE = "By Module Type";
protected static final String COLUMN_NAME = IJBossToolingConstants.LOCAL_DEPLOYMENT_NAME;
@@ -150,6 +158,11 @@
private Button zipDeployWTPProjects;
private String lastCustomDeploy, lastCustomTemp;
+ private Combo filterCombo;
+ private Text filterText;
+
+
+
private IServerWorkingCopy lastWC;
public DeploymentModuleOptionCompositeAssistant() {
@@ -735,21 +748,36 @@
public void widgetDefaultSelected(SelectionEvent e) {
}
});
- FormData linkData = new FormData();
- linkData.bottom = new FormAttachment(100,-5);
- linkData.left = new FormAttachment(0, 5);
+
+ FormData linkData = UIUtil.createFormData2(null, 0, 100,-10, 0,5,null,0);
link.setLayoutData(linkData);
- FormData treeData = new FormData();
- treeData.top = new FormAttachment(0, 5);
- treeData.bottom = new FormAttachment(link, -5);
- treeData.left = new FormAttachment(0, 5);
- treeData.right = new FormAttachment(100, -5);
+ FormData treeData = UIUtil.createFormData2(0, 5, link,-5, 0,5,100,-5);
viewer.getTree().setLayoutData(treeData);
+ // Newer stuff
+ Label comboLabel = new Label(root, SWT.NULL);
+ comboLabel.setText("Filter by:");
+ filterCombo = new Combo(root, SWT.READ_ONLY);
+ filterCombo.setItems(new String[]{ALL, DEPLOYED, BY_MODNAME});
+ filterCombo.select(0);
+
+ filterText = new Text(root, SWT.SINGLE |SWT.BORDER);
+
+ comboLabel.setLayoutData(UIUtil.createFormData2(null,0,100,-8,link,5,null,0));
+ filterCombo.setLayoutData(UIUtil.createFormData2(null,0,100,-3,comboLabel,5,null,0));
+ filterText.setLayoutData(UIUtil.createFormData2(null,0,100,-3,filterCombo,5,100,-5));
+
+ ModifyListener ml =new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ viewer.setInput("");
+ }
+ };
+ filterCombo.addModifyListener(ml);
+ filterText.addModifyListener(ml);
return root;
}
-
+
private void refreshViewer() {
page.refreshPossibleModules();
viewer.setInput(""); //$NON-NLS-1$
@@ -811,7 +839,7 @@
}
public Object[] getElements(Object inputElement) {
- return page.getPossibleModules();
+ return getFilteredModules();
}
public boolean hasChildren(Object element) {
@@ -827,6 +855,27 @@
}
}
+ private Object[] getFilteredModules(){
+ if( filterCombo == null )
+ return page.getPossibleModules();
+ if( filterCombo.getItem(filterCombo.getSelectionIndex()).equals(ALL))
+ return page.getPossibleModules();
+ if( filterCombo.getItem(filterCombo.getSelectionIndex()).equals(DEPLOYED))
+ return page.getServer().getModules();
+ if( filterCombo.getItem(filterCombo.getSelectionIndex()).equals(BY_MODNAME)) {
+ IModule[] mods = page.getPossibleModules();
+ String txt = filterText.getText();
+ ArrayList<IModule> result = new ArrayList<IModule>();
+ for( int i = 0; i < mods.length; i++) {
+ if( mods[i].getName().startsWith(txt)) {
+ result.add(mods[i]);
+ }
+ }
+ return result.toArray(new IModule[result.size()]);
+ }
+ return new Object[]{};
+ }
+
private class ModulePageLabelProvider implements ITableLabelProvider {
public Image getColumnImage(Object element, int columnIndex) {
if (element instanceof IModule && columnIndex == 0) {
14 years, 1 month