JBoss Tools SVN: r38609 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-10 11:03:17 -0500 (Fri, 10 Feb 2012)
New Revision: 38609
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java
Log:
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java 2012-02-10 16:01:29 UTC (rev 38608)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java 2012-02-10 16:03:17 UTC (rev 38609)
@@ -70,8 +70,7 @@
* @see #getRepositoryPath()
*/
protected File cloneRepository(IApplication application, String remoteName, File destination,
- boolean addToRepoView,
- IProgressMonitor monitor)
+ boolean addToRepoView, IProgressMonitor monitor)
throws OpenShiftException, InvocationTargetException, InterruptedException, URISyntaxException {
monitor.subTask(NLS.bind("Cloning repository for application {0}...", application.getName()));
EGitUIUtils.ensureEgitUIIsStarted();
14 years, 1 month
JBoss Tools SVN: r38608 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-10 11:01:29 -0500 (Fri, 10 Feb 2012)
New Revision: 38608
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
Log:
[JBIDE-10847] disabling / enabling widgets according to whether "use existing app" is checked or not
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java 2012-02-10 15:25:18 UTC (rev 38607)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java 2012-02-10 16:01:29 UTC (rev 38608)
@@ -20,6 +20,7 @@
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Text;
@@ -42,54 +43,76 @@
});
}
-
+
/**
- * Register a {@link ContributionManager}. The contribution manager gets unregistered on control disposal
+ * Register a {@link ContributionManager}. The contribution manager gets
+ * unregistered on control disposal
*
- * @param id the id
- * @param contributionManager the contribution manager
- * @param control the control
+ * @param id
+ * the id
+ * @param contributionManager
+ * the contribution manager
+ * @param control
+ * the control
*
* @see ContributionManager
* @see IMenuService
* @see DisposeListener
*/
- public static void registerContributionManager( final String id, final IContributionManager contributionManager,
- final Control control )
+ public static void registerContributionManager(final String id, final IContributionManager contributionManager,
+ final Control control)
{
- Assert.isNotNull( id );
- Assert.isNotNull( contributionManager );
- Assert.isTrue( control != null && !control.isDisposed() );
+ Assert.isNotNull(id);
+ Assert.isNotNull(contributionManager);
+ Assert.isTrue(control != null && !control.isDisposed());
- final IMenuService menuService = ( IMenuService ) PlatformUI.getWorkbench().getService( IMenuService.class );
- menuService.populateContributionManager( ( ContributionManager ) contributionManager, id );
- contributionManager.update( true );
- control.addDisposeListener( new DisposeListener()
+ final IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getService(IMenuService.class);
+ menuService.populateContributionManager((ContributionManager) contributionManager, id);
+ contributionManager.update(true);
+ control.addDisposeListener(new DisposeListener()
{
- public void widgetDisposed( DisposeEvent e )
+ public void widgetDisposed(DisposeEvent e)
{
- menuService.releaseContributions( ( ContributionManager ) contributionManager );
+ menuService.releaseContributions((ContributionManager) contributionManager);
}
- } );
+ });
}
/**
* Creates context menu to a given control.
*
- * @param control the control
+ * @param control
+ * the control
*
* @return the i menu manager
*/
- public static IMenuManager createContextMenu( final Control control )
+ public static IMenuManager createContextMenu(final Control control)
{
- Assert.isTrue( control != null && !control.isDisposed() );
+ Assert.isTrue(control != null && !control.isDisposed());
MenuManager menuManager = new MenuManager();
- menuManager.add( new GroupMarker( IWorkbenchActionConstants.MB_ADDITIONS ) );
+ menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- Menu menu = menuManager.createContextMenu( control );
- control.setMenu( menu );
+ Menu menu = menuManager.createContextMenu(control);
+ control.setMenu(menu);
return menuManager;
}
-
+
+ public static void doForAllChildren(IWidgetVisitor visitor, Composite composite) {
+ if (composite == null
+ || composite.isDisposed()) {
+ return;
+ }
+ for (Control control : composite.getChildren()) {
+ if (control instanceof Composite) {
+ doForAllChildren(visitor, (Composite) control);
+ }
+ visitor.visit(control);
+ }
+ }
+
+ public static interface IWidgetVisitor {
+ public void visit(Control control);
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-10 15:25:18 UTC (rev 38607)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-10 16:01:29 UTC (rev 38608)
@@ -21,6 +21,8 @@
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.list.WritableList;
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.databinding.validation.MultiValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -62,6 +64,7 @@
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.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
@@ -92,7 +95,9 @@
private CheckboxTableViewer viewer;
private ApplicationConfigurationWizardPageModel pageModel;
- private Button useExistingAppBtn = null;
+ private Button useExistingAppBtn;
+ private Text existingAppNameText;
+ private Button browseAppsButton;
public ApplicationConfigurationWizardPage(IWizard wizard, OpenShiftExpressApplicationWizardModel wizardModel) {
super("Application Configuration", "Configure the application you want\nto create or import.",
@@ -128,7 +133,7 @@
dbc.bindValue(useExistingAppBtnSelection, useExistingAppObservable);
// existing app name
- final Text existingAppNameText = new Text(existingAppSelectionGroup, SWT.BORDER);
+ this.existingAppNameText = new Text(existingAppSelectionGroup, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false)
.applyTo(existingAppNameText);
final IObservableValue existingAppNameModelObservable = BeanProperties.value(
@@ -139,10 +144,6 @@
if (pageModel.getExistingApplicationName() != null) {
existingAppNameText.setText(pageModel.getExistingApplicationName());
}
- // enable the app name text when the model state is set to 'use existing
- // app'
- ValueBindingBuilder.bind(WidgetProperties.enabled().observe(existingAppNameText))
- .notUpdating(useExistingAppObservable).in(dbc);
// move focus to the project name text control when choosing the 'Use an
// existing project' option.
useExistingAppBtn.addSelectionListener(new SelectionAdapter() {
@@ -154,14 +155,13 @@
});
createContentAssist(existingAppNameText);
- Button browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
+ this.browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
browseAppsButton.setText("Browse");
browseAppsButton.addSelectionListener(onBrowseApps());
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).span(1, 1).grab(false, false)
.applyTo(browseAppsButton);
- ValueBindingBuilder.bind(WidgetProperties.enabled().observe(browseAppsButton))
- .notUpdating(useExistingAppObservable).in(dbc);
- // observe the list of application, get notified once they have been loaded
+ // observe the list of application, get notified once they have been
+ // loaded
final IObservableValue existingAppsObservable = BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATIONS).observe(pageModel);
@@ -229,6 +229,13 @@
GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(container);
GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(container);
+ IObservableValue useExistingApplication =
+ BeanProperties.value(ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION)
+ .observe(pageModel);
+ enableApplicationWidgets(pageModel.isUseExistingApplication(), container, existingAppNameText, browseAppsButton);
+ useExistingApplication.addValueChangeListener(
+ onUseExistingApplication(container, existingAppNameText, browseAppsButton));
+
Label applicationNameLabel = new Label(container, SWT.NONE);
applicationNameLabel.setText("Name:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(applicationNameLabel);
@@ -242,8 +249,6 @@
dbc.bindValue(applicationNameTextObservable, applicationNameModelObservable);
IObservableValue useExistingObservable = BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION).observe(pageModel);
- ValueBindingBuilder.bind(WidgetProperties.enabled().observe(applicationNameText))
- .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
Label applicationTypeLabel = new Label(container, SWT.NONE);
applicationTypeLabel.setText("Type:");
@@ -261,15 +266,18 @@
ValueBindingBuilder.bind(WidgetProperties.enabled().observe(cartridgesCombo))
.notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
final ISWTObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
-
- final ApplicationToCreateInputValidator applicationInputValidator = new ApplicationToCreateInputValidator(useExistingAppBtnSelection,
+
+ final ApplicationToCreateInputValidator applicationInputValidator = new ApplicationToCreateInputValidator(
+ useExistingAppBtnSelection,
applicationNameTextObservable, cartridgesComboObservable);
dbc.addValidationStatusProvider(applicationInputValidator);
/*
- * final ApplicationToSelectNameValidator applicationNameValidator = new ApplicationToSelectNameValidator(us
- * applicationNameStatusObservable, applicationNameTextObservable);
+ * final ApplicationToSelectNameValidator applicationNameValidator = new
+ * ApplicationToSelectNameValidator(us applicationNameStatusObservable,
+ * applicationNameTextObservable);
* dbc.addValidationStatusProvider(applicationNameValidator);
- * ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT | SWT.TOP);
+ * ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT |
+ * SWT.TOP);
*/
// embeddable cartridges
Group cartridgesGroup = new Group(container, SWT.NONE);
@@ -281,39 +289,60 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 2).hint(400, 250)
.applyTo(tableContainer);
this.viewer = createTable(tableContainer);
- ValueBindingBuilder.bind(WidgetProperties.enabled().observe(viewer.getTable()))
- .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
+
Button checkAllButton = new Button(cartridgesGroup, SWT.PUSH);
checkAllButton.setText("&Select All");
GridDataFactory.fillDefaults().hint(110, SWT.DEFAULT).grab(false, false).align(SWT.FILL, SWT.TOP)
.applyTo(checkAllButton);
checkAllButton.addSelectionListener(onCheckAll());
- ValueBindingBuilder.bind(WidgetProperties.enabled().observe(checkAllButton)).notUpdating(useExistingObservable)
- .converting(new InvertingBooleanConverter()).in(dbc);
Button uncheckAllButton = new Button(cartridgesGroup, SWT.PUSH);
uncheckAllButton.setText("&Deselect All");
GridDataFactory.fillDefaults().hint(110, SWT.DEFAULT).grab(false, true).align(SWT.FILL, SWT.TOP)
.applyTo(uncheckAllButton);
uncheckAllButton.addSelectionListener(onUncheckAll());
- ValueBindingBuilder.bind(WidgetProperties.enabled().observe(uncheckAllButton))
- .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
+
// bottom filler
Composite spacer = new Composite(container, SWT.NONE);
GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(spacer);
+ }
- // enabling the group if the 'use existing application' checkbox state
- // is 'false' (unchecked)
- final ISWTObservableValue useExistinAppBtnObservable = WidgetProperties.selection().observe(
- this.useExistingAppBtn);
+ private IValueChangeListener onUseExistingApplication(final Group applicationConfigurationGroup,
+ final Text applicationNameText, final Button applicationBrowseButton) {
+ return new IValueChangeListener() {
- final ISWTObservableValue createApplicationGroupEnabled = WidgetProperties.enabled().observe(container);
- ValueBindingBuilder.bind(createApplicationGroupEnabled).notUpdatingParticipant().to(useExistinAppBtnObservable)
- .converting(new InvertingBooleanConverter()).in(dbc);
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ Object newValue = event.diff.getNewValue();
+ if (newValue instanceof Boolean) {
+ Boolean useExisting = (Boolean) newValue;
+ enableApplicationWidgets(
+ useExisting, applicationConfigurationGroup, applicationNameText, applicationBrowseButton);
+ }
+ }
+ };
+ }
- // dbc.bindValue(useExistinAppBtnObservable,
- // createApplicationGroupEnabled);
+ /**
+ * Enables/disables the given widgets based on the flag to use an existing
+ * app or create a new application.
+ *
+ * @param useExisting
+ * @param applicationConfigurationGroup
+ * @param applicationNameText
+ * @param applicationBrowseButton
+ */
+ private void enableApplicationWidgets(final Boolean useExisting, final Group applicationConfigurationGroup,
+ final Text applicationNameText, final Button applicationBrowseButton) {
+ applicationNameText.setEnabled(useExisting);
+ applicationBrowseButton.setEnabled(useExisting);
+ UIUtils.doForAllChildren(new UIUtils.IWidgetVisitor() {
+ @Override
+ public void visit(Control control) {
+ control.setEnabled(!useExisting);
+ }
+ }, applicationConfigurationGroup);
}
private void fillCartridgesCombo(DataBindingContext dbc, Combo cartridgesCombo) {
@@ -561,11 +590,12 @@
}
/**
- * Viewer element comparer based on #equals(). The default implementation in CheckboxTableViewer compares elements
- * based on instance identity.
+ * Viewer element comparer based on #equals(). The default implementation in
+ * CheckboxTableViewer compares elements based on instance identity.
* <p>
- * We need this since the available cartridges (item listed in the viewer) are not the same instance as the ones in
- * the embedded application (items to check in the viewer).
+ * We need this since the available cartridges (item listed in the viewer)
+ * are not the same instance as the ones in the embedded application (items
+ * to check in the viewer).
*/
private static class EqualityComparer implements IElementComparer {
@@ -684,17 +714,18 @@
}
}
return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "The application '" + appName + "' does not exist.");
+ "The application '" + appName + "' does not exist.");
}
return new Status(IStatus.CANCEL, OpenShiftUIActivator.PLUGIN_ID,
"Select an existing OpenShift application.");
-
}
/*
* (non-Javadoc)
- * @see org.eclipse.core.databinding.validation.MultiValidator#getTargets()
+ *
+ * @see
+ * org.eclipse.core.databinding.validation.MultiValidator#getTargets()
*/
@Override
public IObservableList getTargets() {
@@ -741,7 +772,9 @@
/*
* (non-Javadoc)
- * @see org.eclipse.core.databinding.validation.MultiValidator#getTargets()
+ *
+ * @see
+ * org.eclipse.core.databinding.validation.MultiValidator#getTargets()
*/
@Override
public IObservableList getTargets() {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-10 15:25:18 UTC (rev 38607)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-10 16:01:29 UTC (rev 38608)
@@ -76,7 +76,7 @@
return user.getApplications();
}
- public boolean getUseExistingApplication() {
+ public boolean isUseExistingApplication() {
return this.useExistingApplication;
}
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-10 15:25:18 UTC (rev 38607)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-10 16:01:29 UTC (rev 38608)
@@ -67,8 +67,8 @@
@Override
public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
URISyntaxException, InvocationTargetException {
- List<IProject> importedProjects = new ImportNewProject(getProjectName(), getApplication(), getRemoteName(),
- getRepositoryFile()).execute(monitor);
+ List<IProject> importedProjects =
+ new ImportNewProject(getProjectName(), getApplication(), getRemoteName(), getRepositoryFile()).execute(monitor);
createServerAdapter(monitor, importedProjects);
}
14 years, 1 month
JBoss Tools SVN: r38607 - in trunk/maven/plugins: org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 10:25:18 -0500 (Fri, 10 Feb 2012)
New Revision: 38607
Removed:
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties
Modified:
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java
Log:
Clean up
Deleted: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,34 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.tools.maven.profiles.core;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @author snjeza
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.maven.core.messages"; //$NON-NLS-1$
- public static String MavenFacetInstallDelegate_Internal_Error_creating_JBoss_Maven_Facet;
- public static String MavenFacetInstallPage_The_artifactId_field_is_required;
- public static String MavenFacetInstallPage_The_groupId_field_is_required;
- public static String MavenFacetInstallPage_The_packaging_field_is_required;
- public static String MavenFacetInstallPage_The_version_field_is_required;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,6 +0,0 @@
-MavenFacetInstallDelegate_Internal_Error_creating_JBoss_Maven_Facet=Internal Error creating JBoss Maven Facet. Missing configuration
-MavenFacetInstallPage_The_artifactId_field_is_required=The artifactId field is required.
-MavenFacetInstallPage_The_groupId_field_is_required=The groupId field is required.
-MavenFacetInstallPage_The_packaging_field_is_required=The packaging field is required.
-MavenFacetInstallPage_The_version_field_is_required=The version field is required.
-
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.profiles.core.profiles;
import java.util.List;
@@ -16,6 +26,13 @@
*/
public interface IProfileManager {
+ /**
+ * Returns a List of ProfileStatus for the given mavenProjectFacade
+ * @param mavenProjectFacade a facade of the maven project
+ * @param monitor a progress monitor
+ * @return a List of ProfileStatus for the given mavenProjectFacade.
+ * @throws CoreException
+ */
List<ProfileStatus> getProfilesStatuses(IMavenProjectFacade mavenProjectFacade, IProgressMonitor monitor) throws CoreException;
/**
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.profiles.core.profiles;
public enum ProfileState {
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.profiles.core.profiles;
public class ProfileStatus {
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -31,7 +31,6 @@
public static ImageDescriptor icon = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/maven-profiles.png");
-
public ActiveMavenProfilesNode(List<Profile> profiles) {
ids = getProfileIds(profiles);
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.profiles.ui.internal;
import java.util.List;
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java 2012-02-10 15:24:40 UTC (rev 38606)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java 2012-02-10 15:25:18 UTC (rev 38607)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.profiles.ui.internal;
import java.util.Collection;
@@ -13,7 +23,7 @@
if(profiles != null && !profiles.isEmpty()) {
boolean addComma = false;
for (ProfileSelection ps : profiles) {
- if (Boolean.TRUE.equals(ps.getSelected())) {
+ if (ps !=null && Boolean.TRUE.equals(ps.getSelected())) {
if (addComma) {
sb.append(COMMA);
}
@@ -24,4 +34,5 @@
}
return sb.toString();
}
+
}
14 years, 1 month
JBoss Tools SVN: r38606 - trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 10:24:40 -0500 (Fri, 10 Feb 2012)
New Revision: 38606
Modified:
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java
Log:
JBIDE-10362 : Make Maven profile selection compatible with m2e 1.1
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java 2012-02-10 15:18:37 UTC (rev 38605)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java 2012-02-10 15:24:40 UTC (rev 38606)
@@ -52,11 +52,13 @@
final ResolverConfiguration configuration =configurationManager.getResolverConfiguration(project);
final String profilesAsString = getAsString(profiles);
+ //TODO : replace with resolverConfiguration.getSelectedProfiles() when m2e 1.1 is the default requirement
if (profilesAsString.equals(configuration.getActiveProfiles())) {
//Nothing changed
return;
}
+ //TODO : replace with resolverConfiguration.setSelectedProfiles(profilesAsString) when m2e 1.1 is the default requirement
configuration.setActiveProfiles(profilesAsString);
boolean isSet = configurationManager.setResolverConfiguration(project, configuration);
if (isSet) {
@@ -126,7 +128,8 @@
ResolverConfiguration resolverConfiguration = MavenPlugin.getProjectConfigurationManager()
.getResolverConfiguration(facade.getProject());
- List<String> configuredProfiles = resolverConfiguration.getActiveProfileList();
+ //TODO : replace with resolverConfiguration.getSelectedProfiles() when m2e 1.1 is the default requirement
+ List<String> configuredProfiles = toList(resolverConfiguration.getActiveProfiles());
MavenProject mavenProject = facade.getMavenProject(monitor);
@@ -184,6 +187,20 @@
return Collections.unmodifiableList(statuses);
}
+ private List<String> toList(String profilesAsText) {
+ List<String> profiles;
+ if (profilesAsText != null && profilesAsText.trim().length() > 0) {
+ String[] profilesArray = profilesAsText.split("[,\\s\\|]");
+ profiles = new ArrayList<String>(profilesArray.length);
+ for (String profile : profilesArray) {
+ profiles.add(profile);
+ }
+ } else {
+ profiles = new ArrayList<String>(0);
+ }
+ return profiles;
+ }
+
private String findSource(Profile profile, List<Model> modelHierarchy) {
if (profile != null) {
if ("settings.xml".equals(profile.getSource())) { //$NON-NLS-1$
14 years, 1 month
JBoss Tools SVN: r38605 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-10 10:18:37 -0500 (Fri, 10 Feb 2012)
New Revision: 38605
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
Log:
https://issues.jboss.org/browse/JBIDE-8701 - junit was updated.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 15:12:09 UTC (rev 38604)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 15:18:37 UTC (rev 38605)
@@ -72,11 +72,6 @@
nsIDOMWindowInternal windowInternal = org.jboss.tools.vpe.xulrunner.util.XPCOM
.queryInterface(domWindow, nsIDOMWindowInternal.class);
/*
- * Set property to enable scroll correlation
- */
- JspEditorPlugin.getDefault().getPreferenceStore().setValue(
- IVpePreferencesPage.SYNCHRONIZE_SCROLLING_BETWEEN_SOURCE_VISUAL_PANES, true);
- /*
* Set source position -- visual part should be scrolled.
*/
int scrollY = windowInternal.getScrollY();
@@ -154,4 +149,26 @@
keyReleased.type = SWT.KeyUp;
display.post(keyReleased);
}
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ /*
+ * Set property to enable scroll correlation
+ */
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(
+ IVpePreferencesPage.SYNCHRONIZE_SCROLLING_BETWEEN_SOURCE_VISUAL_PANES, true);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ /*
+ * Disable scroll correlation at the end
+ */
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(
+ IVpePreferencesPage.SYNCHRONIZE_SCROLLING_BETWEEN_SOURCE_VISUAL_PANES, false);
+ }
+
+
}
\ No newline at end of file
14 years, 1 month
JBoss Tools SVN: r38604 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-10 10:12:09 -0500 (Fri, 10 Feb 2012)
New Revision: 38604
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
Log:
https://issues.jboss.org/browse/JBIDE-8701 - junit was updated.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 14:59:45 UTC (rev 38603)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 15:12:09 UTC (rev 38604)
@@ -107,11 +107,11 @@
domWindow.scrollTo(0,0);
TestUtil.delay(DELAY_1S);
int topIndex = sourceEditor.getTextViewer().getTopIndex();
- assertTrue("Top source line is wrong", topIndex < 100); //$NON-NLS-1$
+ assertTrue("Top source line is wrong, top line is " + topIndex + ", but should be less than 100", topIndex < 100); //$NON-NLS-1$ //$NON-NLS-2$
domWindow.scrollTo(0, halfHeight);
TestUtil.delay(DELAY_1S);
topIndex = sourceEditor.getTextViewer().getTopIndex();
- assertTrue("Top source line for the middle position is wrong", topIndex < 700); //$NON-NLS-1$
+ assertTrue("Top source line for the middle position is wrong, top line is " + topIndex + ", but should be less than 700", topIndex < 700); //$NON-NLS-1$ //$NON-NLS-2$
testFinished = true;
}
}
14 years, 1 month
JBoss Tools SVN: r38603 - 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-10 09:59:45 -0500 (Fri, 10 Feb 2012)
New Revision: 38603
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
Log:
OPEN - issue JBIDE-10528: Improve OpenShift UI
https://issues.jboss.org/browse/JBIDE-10528
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-10 14:45:55 UTC (rev 38602)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-10 14:59:45 UTC (rev 38603)
@@ -95,7 +95,7 @@
private Button useExistingAppBtn = null;
public ApplicationConfigurationWizardPage(IWizard wizard, OpenShiftExpressApplicationWizardModel wizardModel) {
- super("Application Configuration", "Configure the application you want to create.",
+ super("Application Configuration", "Configure the application you want\nto create or import.",
"Application configuration", wizard);
this.pageModel = new ApplicationConfigurationWizardPageModel(wizardModel);
}
@@ -111,19 +111,17 @@
private Composite createApplicationSelectionGroup(Composite container, DataBindingContext dbc) {
Composite existingAppSelectionGroup = new Composite(container, SWT.NONE);
// projectGroup.setText("Project");
- GridDataFactory.fillDefaults()
- .align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.CENTER).grab(true, false)
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.CENTER).grab(true, false)
.applyTo(existingAppSelectionGroup);
- GridLayoutFactory.fillDefaults()
- .numColumns(3).margins(6, 6).applyTo(existingAppSelectionGroup);
+ GridLayoutFactory.fillDefaults().numColumns(3).margins(6, 6).applyTo(existingAppSelectionGroup);
// existing app checkbox
useExistingAppBtn = new Button(existingAppSelectionGroup, SWT.CHECK);
- useExistingAppBtn.setText("Use the existing application");
+ useExistingAppBtn.setText("Use existing application");
useExistingAppBtn.setToolTipText("Select an existing application or uncheck to create a new one.");
useExistingAppBtn.setFocus();
- GridDataFactory.fillDefaults()
- .span(1, 1).align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(useExistingAppBtn);
+ GridDataFactory.fillDefaults().span(1, 1).align(SWT.FILL, SWT.CENTER).grab(false, false)
+ .applyTo(useExistingAppBtn);
final IObservableValue useExistingAppObservable = BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION).observe(pageModel);
final ISWTObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
@@ -131,22 +129,20 @@
// existing app name
final Text existingAppNameText = new Text(existingAppSelectionGroup, SWT.BORDER);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(existingAppNameText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false)
+ .applyTo(existingAppNameText);
final IObservableValue existingAppNameModelObservable = BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
- final ISWTObservableValue existingAppNameTextObservable =
- WidgetProperties.text(SWT.Modify).observe(existingAppNameText);
+ final ISWTObservableValue existingAppNameTextObservable = WidgetProperties.text(SWT.Modify).observe(
+ existingAppNameText);
ValueBindingBuilder.bind(existingAppNameTextObservable).to(existingAppNameModelObservable).in(dbc);
if (pageModel.getExistingApplicationName() != null) {
existingAppNameText.setText(pageModel.getExistingApplicationName());
}
// enable the app name text when the model state is set to 'use existing
// app'
- ValueBindingBuilder
- .bind(WidgetProperties.enabled().observe(existingAppNameText))
- .notUpdating(useExistingAppObservable)
- .in(dbc);
+ ValueBindingBuilder.bind(WidgetProperties.enabled().observe(existingAppNameText))
+ .notUpdating(useExistingAppObservable).in(dbc);
// move focus to the project name text control when choosing the 'Use an
// existing project' option.
useExistingAppBtn.addSelectionListener(new SelectionAdapter() {
@@ -165,12 +161,12 @@
.applyTo(browseAppsButton);
ValueBindingBuilder.bind(WidgetProperties.enabled().observe(browseAppsButton))
.notUpdating(useExistingAppObservable).in(dbc);
- final IObservableValue existingAppValidityObservable = BeanProperties.value(
- ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
+ // observe the list of application, get notified once they have been loaded
+ final IObservableValue existingAppsObservable = BeanProperties.value(
+ ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATIONS).observe(pageModel);
- final ApplicationToSelectNameValidator existingProjectValidator =
- new ApplicationToSelectNameValidator(
- existingAppValidityObservable, existingAppNameTextObservable, existingAppNameModelObservable);
+ final ApplicationToSelectNameValidator existingProjectValidator = new ApplicationToSelectNameValidator(
+ useExistingAppBtnSelection, existingAppNameTextObservable, existingAppsObservable);
dbc.addValidationStatusProvider(existingProjectValidator);
ControlDecorationSupport.create(existingProjectValidator, SWT.LEFT | SWT.TOP);
@@ -179,14 +175,14 @@
private void createContentAssist(final Text existingAppNameText) {
ControlDecoration dec = new ControlDecoration(existingAppNameText, SWT.TOP | SWT.LEFT);
- FieldDecoration contentProposalFieldIndicator =
- FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+ FieldDecoration contentProposalFieldIndicator = FieldDecorationRegistry.getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
dec.setImage(contentProposalFieldIndicator.getImage());
dec.setDescriptionText("Auto-completion is enabled when you start typing a project name.");
dec.setShowOnlyOnFocus(true);
- AutoCompleteField adapter =
- new AutoCompleteField(existingAppNameText, new TextContentAdapter(), new String[] {});
+ AutoCompleteField adapter = new AutoCompleteField(existingAppNameText, new TextContentAdapter(),
+ new String[] {});
adapter.setProposals(getApplicationNames());
}
@@ -237,33 +233,24 @@
applicationNameLabel.setText("Name:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(applicationNameLabel);
Text applicationNameText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults()
- .grab(true, false).align(SWT.FILL, SWT.FILL).applyTo(applicationNameText);
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.FILL).applyTo(applicationNameText);
UIUtils.selectAllOnFocus(applicationNameText);
final IObservableValue applicationNameModelObservable = BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_APPLICATION_NAME).observe(pageModel);
final ISWTObservableValue applicationNameTextObservable = WidgetProperties.text(SWT.Modify).observe(
applicationNameText);
dbc.bindValue(applicationNameTextObservable, applicationNameModelObservable);
- IObservableValue useExistingObservable =
- BeanProperties.value(ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION)
- .observe(pageModel);
- ValueBindingBuilder
- .bind(WidgetProperties.enabled().observe(applicationNameText))
- .notUpdating(useExistingObservable)
- .converting(new InvertingBooleanConverter())
- .in(dbc);
+ IObservableValue useExistingObservable = BeanProperties.value(
+ ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION).observe(pageModel);
+ ValueBindingBuilder.bind(WidgetProperties.enabled().observe(applicationNameText))
+ .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
- final IObservableValue applicationNameStatusObservable = BeanProperties.value(
- ApplicationConfigurationWizardPageModel.PROPERTY_APPLICATION_NAME_STATUS).observe(pageModel);
-
Label applicationTypeLabel = new Label(container, SWT.NONE);
applicationTypeLabel.setText("Type:");
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).span(1, 1).applyTo(applicationTypeLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).applyTo(applicationTypeLabel);
Combo cartridgesCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(cartridgesCombo);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false)
+ .applyTo(cartridgesCombo);
fillCartridgesCombo(dbc, cartridgesCombo);
final ISWTObservableValue cartridgesComboObservable = WidgetProperties.selection().observe(cartridgesCombo);
final IObservableValue selectedCartridgeModelObservable = BeanProperties.value(
@@ -271,65 +258,49 @@
dbc.bindValue(cartridgesComboObservable, selectedCartridgeModelObservable,
new UpdateValueStrategy().setConverter(new StringToCartridgeConverter()),
new UpdateValueStrategy().setConverter(new CartridgeToStringConverter()));
- ValueBindingBuilder
- .bind(WidgetProperties.enabled().observe(cartridgesCombo))
- .notUpdating(useExistingObservable)
- .converting(new InvertingBooleanConverter())
- .in(dbc);
-
- final ApplicationToCreateInputValidator applicationInputValidator =
- new ApplicationToCreateInputValidator(applicationNameTextObservable, cartridgesComboObservable);
+ ValueBindingBuilder.bind(WidgetProperties.enabled().observe(cartridgesCombo))
+ .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
+ final ISWTObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
+
+ final ApplicationToCreateInputValidator applicationInputValidator = new ApplicationToCreateInputValidator(useExistingAppBtnSelection,
+ applicationNameTextObservable, cartridgesComboObservable);
dbc.addValidationStatusProvider(applicationInputValidator);
/*
- * final ApplicationToSelectNameValidator applicationNameValidator = new
- * ApplicationToSelectNameValidator(us applicationNameStatusObservable,
- * applicationNameTextObservable);
+ * final ApplicationToSelectNameValidator applicationNameValidator = new ApplicationToSelectNameValidator(us
+ * applicationNameStatusObservable, applicationNameTextObservable);
* dbc.addValidationStatusProvider(applicationNameValidator);
- * ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT |
- * SWT.TOP);
+ * ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT | SWT.TOP);
*/
// embeddable cartridges
Group cartridgesGroup = new Group(container, SWT.NONE);
cartridgesGroup.setText("Embeddable Cartridges");
- GridDataFactory.fillDefaults()
- .grab(true, true).align(SWT.FILL, SWT.FILL).span(2, 1).applyTo(cartridgesGroup);
- GridLayoutFactory.fillDefaults()
- .numColumns(2).margins(6, 6).applyTo(cartridgesGroup);
+ GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).span(2, 1).applyTo(cartridgesGroup);
+ GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(cartridgesGroup);
Composite tableContainer = new Composite(cartridgesGroup, SWT.NONE);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 2).hint(400, 250).applyTo(tableContainer);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 2).hint(400, 250)
+ .applyTo(tableContainer);
this.viewer = createTable(tableContainer);
- ValueBindingBuilder
- .bind(WidgetProperties.enabled().observe(viewer.getTable()))
- .notUpdating(useExistingObservable)
- .converting(new InvertingBooleanConverter())
- .in(dbc);
+ ValueBindingBuilder.bind(WidgetProperties.enabled().observe(viewer.getTable()))
+ .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
Button checkAllButton = new Button(cartridgesGroup, SWT.PUSH);
checkAllButton.setText("&Select All");
- GridDataFactory.fillDefaults()
- .hint(110, SWT.DEFAULT).grab(false, false).align(SWT.FILL, SWT.TOP).applyTo(checkAllButton);
+ GridDataFactory.fillDefaults().hint(110, SWT.DEFAULT).grab(false, false).align(SWT.FILL, SWT.TOP)
+ .applyTo(checkAllButton);
checkAllButton.addSelectionListener(onCheckAll());
- ValueBindingBuilder
- .bind(WidgetProperties.enabled().observe(checkAllButton))
- .notUpdating(useExistingObservable)
- .converting(new InvertingBooleanConverter())
- .in(dbc);
+ ValueBindingBuilder.bind(WidgetProperties.enabled().observe(checkAllButton)).notUpdating(useExistingObservable)
+ .converting(new InvertingBooleanConverter()).in(dbc);
Button uncheckAllButton = new Button(cartridgesGroup, SWT.PUSH);
uncheckAllButton.setText("&Deselect All");
- GridDataFactory.fillDefaults()
- .hint(110, SWT.DEFAULT).grab(false, true).align(SWT.FILL, SWT.TOP).applyTo(uncheckAllButton);
+ GridDataFactory.fillDefaults().hint(110, SWT.DEFAULT).grab(false, true).align(SWT.FILL, SWT.TOP)
+ .applyTo(uncheckAllButton);
uncheckAllButton.addSelectionListener(onUncheckAll());
- ValueBindingBuilder
- .bind(WidgetProperties.enabled().observe(uncheckAllButton))
- .notUpdating(useExistingObservable)
- .converting(new InvertingBooleanConverter())
- .in(dbc);
+ ValueBindingBuilder.bind(WidgetProperties.enabled().observe(uncheckAllButton))
+ .notUpdating(useExistingObservable).converting(new InvertingBooleanConverter()).in(dbc);
// bottom filler
Composite spacer = new Composite(container, SWT.NONE);
- GridDataFactory.fillDefaults()
- .span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(spacer);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(spacer);
// enabling the group if the 'use existing application' checkbox state
// is 'false' (unchecked)
@@ -337,9 +308,7 @@
this.useExistingAppBtn);
final ISWTObservableValue createApplicationGroupEnabled = WidgetProperties.enabled().observe(container);
- ValueBindingBuilder
- .bind(createApplicationGroupEnabled).notUpdatingParticipant()
- .to(useExistinAppBtnObservable)
+ ValueBindingBuilder.bind(createApplicationGroupEnabled).notUpdatingParticipant().to(useExistinAppBtnObservable)
.converting(new InvertingBooleanConverter()).in(dbc);
// dbc.bindValue(useExistinAppBtnObservable,
@@ -592,12 +561,11 @@
}
/**
- * Viewer element comparer based on #equals(). The default implementation in
- * CheckboxTableViewer compares elements based on instance identity.
+ * Viewer element comparer based on #equals(). The default implementation in CheckboxTableViewer compares elements
+ * based on instance identity.
* <p>
- * We need this since the available cartridges (item listed in the viewer)
- * are not the same instance as the ones in the embedded application (items
- * to check in the viewer).
+ * We need this since the available cartridges (item listed in the viewer) are not the same instance as the ones in
+ * the embedded application (items to check in the viewer).
*/
private static class EqualityComparer implements IElementComparer {
@@ -623,11 +591,11 @@
@Override
protected void onPageActivated(final DataBindingContext dbc) {
- // This is needed for some strange freezing issues when
+ // This is needed for some strange freezing issues when
// launching the wizard from the console view. The UI seems to freeze
new Thread() {
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().asyncExec(new Runnable() {
public void run() {
onPageActivated2(dbc);
}
@@ -635,6 +603,7 @@
}
}.start();
}
+
protected void onPageActivated2(final DataBindingContext dbc) {
try {
WizardUtils.runInWizard(new Job("Loading existing applications...") {
@@ -688,32 +657,44 @@
class ApplicationToSelectNameValidator extends MultiValidator {
- private final IObservableValue existingAppValidityObservable;
+ private final ISWTObservableValue useExistingAppBtnbservable;
private final ISWTObservableValue existingAppNameTextObservable;
- private final IObservableValue existingAppNameModelObservable;
+ private final IObservableValue existingAppsObservable;
- public ApplicationToSelectNameValidator(IObservableValue existingAppValidityObservable,
- ISWTObservableValue existingAppNameTextObservable, IObservableValue existingAppNameModelObservable) {
- this.existingAppValidityObservable = existingAppValidityObservable;
+ public ApplicationToSelectNameValidator(ISWTObservableValue useExistingAppBtnbservable,
+ ISWTObservableValue existingAppNameTextObservable, IObservableValue existingAppsObservable) {
+ this.useExistingAppBtnbservable = useExistingAppBtnbservable;
this.existingAppNameTextObservable = existingAppNameTextObservable;
- this.existingAppNameModelObservable = existingAppNameModelObservable;
+ this.existingAppsObservable = existingAppsObservable;
}
@Override
protected IStatus validate() {
- /*
- * final IStatus applicationNameStatus = (IStatus)
- * applicationNameStatusObservable.getValue(); if
- * (applicationNameStatus != null) { return applicationNameStatus; }
- */
- return ValidationStatus.ok();
+ final boolean useExistingApp = (Boolean) useExistingAppBtnbservable.getValue();
+ final String appName = (String) existingAppNameTextObservable.getValue();
+ @SuppressWarnings("unchecked")
+ final List<IApplication> existingApps = (List<IApplication>) existingAppsObservable.getValue();
+ if (!useExistingApp) {
+ return ValidationStatus.ok();
+ }
+ if (existingApps != null) {
+ for (IApplication application : pageModel.getExistingApplications()) {
+ if (application.getName().equalsIgnoreCase(appName)) {
+ return ValidationStatus.ok();
+ }
+ }
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "The application '" + appName + "' does not exist.");
+ }
+ return new Status(IStatus.CANCEL, OpenShiftUIActivator.PLUGIN_ID,
+ "Select an existing OpenShift application.");
+
+
}
/*
* (non-Javadoc)
- *
- * @see
- * org.eclipse.core.databinding.validation.MultiValidator#getTargets()
+ * @see org.eclipse.core.databinding.validation.MultiValidator#getTargets()
*/
@Override
public IObservableList getTargets() {
@@ -726,23 +707,33 @@
class ApplicationToCreateInputValidator extends MultiValidator {
- private final ISWTObservableValue applicationNameTextObservable, cartridgesComboObservable;
+ private final ISWTObservableValue useExistingAppBtnbservable;
+ private final ISWTObservableValue applicationNameTextObservable;
+ private final ISWTObservableValue cartridgesComboObservable;
- public ApplicationToCreateInputValidator(ISWTObservableValue applicationNameTextObservable,
+ public ApplicationToCreateInputValidator(ISWTObservableValue useExistingAppBtnbservable,
+ ISWTObservableValue applicationNameTextObservable,
ISWTObservableValue cartridgesComboObservable) {
+ this.useExistingAppBtnbservable = useExistingAppBtnbservable;
this.applicationNameTextObservable = applicationNameTextObservable;
this.cartridgesComboObservable = cartridgesComboObservable;
}
@Override
protected IStatus validate() {
- if (!pageModel.getUseExistingApplication()) {
- final String applicationName = (String) applicationNameTextObservable.getValue();
- final String applicationType = (String) cartridgesComboObservable.getValue();
- if (applicationName == null || applicationName.isEmpty() || applicationType == null
- || applicationType.isEmpty()) {
- return ValidationStatus
- .cancel("Please enter a name and select a type for the OpenShift application you want to create.");
+ final String applicationName = (String) applicationNameTextObservable.getValue();
+ final boolean useExistingApp = (Boolean) useExistingAppBtnbservable.getValue();
+ if (useExistingApp) {
+ return ValidationStatus.ok();
+ }
+ if (!applicationName.matches("\\S+")) {
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "The application name must not contain spaces.");
+ }
+ for (IApplication application : pageModel.getExistingApplications()) {
+ if (application.getName().equalsIgnoreCase(applicationName)) {
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "An application with the same name already exists on OpenShift.");
}
}
return ValidationStatus.ok();
@@ -750,9 +741,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.eclipse.core.databinding.validation.MultiValidator#getTargets()
+ * @see org.eclipse.core.databinding.validation.MultiValidator#getTargets()
*/
@Override
public IObservableList getTargets() {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-10 14:45:55 UTC (rev 38602)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-10 14:59:45 UTC (rev 38603)
@@ -15,8 +15,6 @@
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
@@ -34,21 +32,20 @@
public class ApplicationConfigurationWizardPageModel extends ObservableUIPojo {
public static final String PROPERTY_USE_EXISTING_APPLICATION = "useExistingApplication";
- public static final String PROPERTY_EXISTING_APPLICATION_NAME = "existingApplication";
+ public static final String PROPERTY_EXISTING_APPLICATION_NAME = "existingApplicationName";
public static final String PROPERTY_CARTRIDGES = "cartridges";
public static final String PROPERTY_EMBEDDABLE_CARTRIDGES = "embeddableCartridges";
public static final String PROPERTY_SELECTED_CARTRIDGE = "selectedCartridge";
public static final String PROPERTY_APPLICATION_NAME = "applicationName";
- public static final String PROPERTY_APPLICATION_NAME_STATUS = "applicationNameStatus";
+ public static final String PROPERTY_EXISTING_APPLICATIONS = "existingApplications";
-
private final OpenShiftExpressApplicationWizardModel wizardModel;
- private List<IApplication> existingApplications = new ArrayList<IApplication>();
+ // start with a null value as a marker of non-initialized state (used during first pass validation)
+ private List<IApplication> existingApplications = null;
private List<ICartridge> cartridges = new ArrayList<ICartridge>();
private List<IEmbeddableCartridge> embeddableCartridges = new ArrayList<IEmbeddableCartridge>();
private String applicationName;
- private IStatus applicationNameStatus;
private ICartridge selectedCartridge;
private String selectedApplicationName;
private boolean useExistingApplication;
@@ -56,9 +53,9 @@
public ApplicationConfigurationWizardPageModel(OpenShiftExpressApplicationWizardModel wizardModel) {
this.wizardModel = wizardModel;
setUseExistingApplication(wizardModel.isExistingApplication());
- setExistingApplicationName(wizardModel.getApplication() != null ? wizardModel.getApplication().getName() : null);
+ setExistingApplicationName(wizardModel.getApplication() != null ? wizardModel.getApplication().getName() : null);
}
-
+
/**
* @return the wizardModel
*/
@@ -67,10 +64,10 @@
}
public IUser getUser() {
-// return wizardModel.getUser();
+ // return wizardModel.getUser();
return OpenShiftUIActivator.getDefault().getUser();
}
-
+
public List<IApplication> getApplications() throws OpenShiftException {
IUser user = getUser();
if (user == null) {
@@ -78,38 +75,33 @@
}
return user.getApplications();
}
-
+
public boolean getUseExistingApplication() {
return this.useExistingApplication;
}
-
+
public void setUseExistingApplication(boolean useExistingApplication) {
wizardModel.setUseExistingApplication(useExistingApplication);
- firePropertyChange(PROPERTY_USE_EXISTING_APPLICATION, this.useExistingApplication, this.useExistingApplication = useExistingApplication);
+ firePropertyChange(PROPERTY_USE_EXISTING_APPLICATION, this.useExistingApplication,
+ this.useExistingApplication = useExistingApplication);
}
-
public String getExistingApplicationName() {
return selectedApplicationName;
}
public void setExistingApplicationName(String applicationName) {
- for(IApplication application : getExistingApplications()) {
- if(application.getName().equals(applicationName)) {
- wizardModel.setApplication(application);
- }
- }
- firePropertyChange(PROPERTY_EXISTING_APPLICATION_NAME, this.selectedApplicationName, this.selectedApplicationName = applicationName);
+ firePropertyChange(PROPERTY_EXISTING_APPLICATION_NAME, this.selectedApplicationName,
+ this.selectedApplicationName = applicationName);
}
-
public void loadExistingApplications() throws OpenShiftException {
IUser user = getUser();
if (user != null) {
setExistingApplications(user.getApplications());
}
}
-
+
/**
* @return the existingApplications
*/
@@ -118,14 +110,16 @@
}
/**
- * @param existingApplications the existingApplications to set
+ * @param existingApplications
+ * the existingApplications to set
*/
public void setExistingApplications(List<IApplication> existingApplications) {
- this.existingApplications = existingApplications;
+ firePropertyChange(PROPERTY_EXISTING_APPLICATIONS, this.existingApplications,
+ this.existingApplications = existingApplications);
}
public void loadCartridges() throws OpenShiftException {
-// setCartridges(wizardModel.getUser().getCartridges());
+ // setCartridges(wizardModel.getUser().getCartridges());
setCartridges(OpenShiftUIActivator.getDefault().getUser().getCartridges());
}
@@ -144,11 +138,11 @@
public void setSelectedCartridge(ICartridge cartridge) {
wizardModel.setApplicationCartridge(cartridge);
firePropertyChange(PROPERTY_SELECTED_CARTRIDGE, selectedCartridge, this.selectedCartridge = cartridge);
- //validateApplicationName();
+ // validateApplicationName();
}
public List<IEmbeddableCartridge> loadEmbeddableCartridges() throws OpenShiftException {
-// List<IEmbeddableCartridge> cartridges = wizardModel.getUser().getEmbeddableCartridges();
+ // List<IEmbeddableCartridge> cartridges = wizardModel.getUser().getEmbeddableCartridges();
List<IEmbeddableCartridge> cartridges = OpenShiftUIActivator.getDefault().getUser().getEmbeddableCartridges();
setEmbeddableCartridges(cartridges);
return cartridges;
@@ -157,39 +151,12 @@
public void setApplicationName(String applicationName) {
wizardModel.setApplicationName(applicationName);
firePropertyChange(PROPERTY_APPLICATION_NAME, this.applicationName, this.applicationName = applicationName);
- validateApplicationName();
}
public String getApplicationName() {
return this.applicationName;
}
- public void setApplicationNameStatus(IStatus applicationNameStatus) {
- firePropertyChange(PROPERTY_APPLICATION_NAME_STATUS, this.applicationNameStatus,
- this.applicationNameStatus = applicationNameStatus);
- }
-
- public IStatus getApplicationNameStatus() {
- return this.applicationNameStatus;
- }
-
- public IStatus validateApplicationName() {
- IStatus status = Status.OK_STATUS;
- final String applicationName = getApplicationName();
- if (!applicationName.matches("\\S+")) {
- status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "The application name must not contain spaces.");
- }
- for(IApplication application : getExistingApplications()) {
- if(application.getName().equalsIgnoreCase(applicationName)) {
- status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "An application with the same name already exists on OpenShift.");
- }
- }
- setApplicationNameStatus(status);
- return status;
- }
-
public void setEmbeddableCartridges(List<IEmbeddableCartridge> cartridges) {
firePropertyChange(PROPERTY_EMBEDDABLE_CARTRIDGES, this.embeddableCartridges,
this.embeddableCartridges = cartridges);
@@ -205,7 +172,7 @@
public boolean hasApplication(ICartridge cartridge) {
try {
-// return wizardModel.getUser().hasApplication(cartridge);
+ // return wizardModel.getUser().hasApplication(cartridge);
return getUser().hasApplication(cartridge);
} catch (OpenShiftException e) {
OpenShiftUIActivator.log(OpenShiftUIActivator
14 years, 1 month
JBoss Tools SVN: r38602 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-10 09:45:55 -0500 (Fri, 10 Feb 2012)
New Revision: 38602
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
Log:
https://issues.jboss.org/browse/JBIDE-8701 - junit was updated.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 14:41:48 UTC (rev 38601)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 14:45:55 UTC (rev 38602)
@@ -41,7 +41,7 @@
super(name);
}
- public void _testScrolling_Jbide8701() throws Throwable {
+ public void testScrolling_Jbide8701() throws Throwable {
boolean testFinished = false;
IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME,
VpeUiTests.IMPORT_PROJECT_NAME);
@@ -79,37 +79,71 @@
/*
* Set source position -- visual part should be scrolled.
*/
- int scrollX = windowInternal.getScrollX();
int scrollY = windowInternal.getScrollY();
- assertEquals("Initital visual position is wrong", 0, scrollX); //$NON-NLS-1$
+ int halfHeight = windowInternal.getScrollMaxY()/2;
assertEquals("Initital visual position is wrong", 0, scrollY); //$NON-NLS-1$
sourceEditor.setFocus();
- for (int i = 0; i < 15; i++) {
- pressKeyCode(PlatformUI.getWorkbench().getDisplay(), SWT.PAGE_DOWN);
+ TestUtil.delay(DELAY_1S);
+ /*
+ * Press CTRL+END to get to the end of the page
+ */
+ pressCtrlEnd(PlatformUI.getWorkbench().getDisplay());
+ TestUtil.delay(DELAY_1S);
+ /*
+ * Press ARROW_UP several times to select element at the bottom
+ */
+ for (int i = 0; i < 5; i++) {
+ pressKeyCode(PlatformUI.getWorkbench().getDisplay(), SWT.ARROW_UP);
}
TestUtil.delay(DELAY_1S);
- scrollX = windowInternal.getScrollX();
scrollY = windowInternal.getScrollY();
- assertEquals("After 15x PG_DOWN presses visual position is wrong", 23, scrollX); //$NON-NLS-1$
- assertEquals("After 15x PG_DOWN presses visual position is wrong", 658, scrollY); //$NON-NLS-1$
+ assertTrue("Visual scrolling should be at the bottom of the page", scrollY > halfHeight); //$NON-NLS-1$
/*
* Set visual position -- source part should be scrolled.
*/
+ visualEditor.setFocus();
+ pressKeyCode(PlatformUI.getWorkbench().getDisplay(), SWT.ARROW_UP);
domWindow.scrollTo(0,0);
TestUtil.delay(DELAY_1S);
int topIndex = sourceEditor.getTextViewer().getTopIndex();
- assertEquals("Top source line is wrong", 74, topIndex); //$NON-NLS-1$
- domWindow.scrollTo(0, windowInternal.getScrollMaxY()/2);
+ assertTrue("Top source line is wrong", topIndex < 100); //$NON-NLS-1$
+ domWindow.scrollTo(0, halfHeight);
TestUtil.delay(DELAY_1S);
topIndex = sourceEditor.getTextViewer().getTopIndex();
- assertEquals("Top source line for the middle position is wrong", 638, topIndex); //$NON-NLS-1$
+ assertTrue("Top source line for the middle position is wrong", topIndex < 700); //$NON-NLS-1$
testFinished = true;
}
}
assertTrue("Test hasn't passed all steps", testFinished); //$NON-NLS-1$
}
+ public static void pressCtrlEnd(Display display) {
+ Event keyPressed = new Event();
+ keyPressed.keyCode = SWT.CTRL;
+ keyPressed.display = display;
+ keyPressed.type = SWT.KeyDown;
+ display.post(keyPressed);
+
+ keyPressed = new Event();
+ keyPressed.keyCode = SWT.END;
+ keyPressed.display = display;
+ keyPressed.type = SWT.KeyDown;
+ display.post(keyPressed);
+
+ Event keyReleased = new Event();
+ keyReleased.keyCode = SWT.END;
+ keyPressed.display = display;
+ keyReleased.type = SWT.KeyUp;
+
+ keyReleased = new Event();
+ keyReleased.keyCode = SWT.CTRL;
+ keyPressed.display = display;
+ keyReleased.type = SWT.KeyUp;
+
+ display.post(keyReleased);
+ }
+
public static void pressKeyCode(Display display, int keyCode) {
Event keyPressed = new Event();
keyPressed.keyCode = keyCode;
14 years, 1 month
JBoss Tools SVN: r38601 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-10 09:41:48 -0500 (Fri, 10 Feb 2012)
New Revision: 38601
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
Log:
More functionality (still ugly code) to pre-load combo
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-10 14:31:02 UTC (rev 38600)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-10 14:41:48 UTC (rev 38601)
@@ -128,12 +128,31 @@
remoteText.setText(IOpenShiftWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT);
String n = ExpressServerUtils.getExpressUsername(server);
+ String[] appNames = null;
+ if( n == null ) {
+ // We're in a new server wizard
+ IUser user = UserModel.getDefault().getRecentUser();
+ if( user == null && UserModel.getDefault().getUsers().length > 0 ) {
+ user = UserModel.getDefault().getUsers()[0];
+ }
+ if( user != null )
+ try {
+ n = user.getRhlogin();
+ List<IApplication> allApps = user.getApplications();
+ appNames = getAppNamesAsStrings(allApps);
+ } catch(Exception e) { /* ignore */ }
+ }
String p = UserModel.getDefault().getPasswordFromSecureStorage(n);
String remote = ExpressServerUtils.getExpressRemoteName(server);
if( n != null ) userText.setText(n);
if( p != null ) passText.setText(p);
if( remote != null ) remoteText.setText(remote);
+ if( appNames != null ) {
+ appListNames = appNames;
+ appNameCombo.setItems(appListNames);
+ }
+
if( showVerify ) {
verifyButton = new Button(composite, SWT.PUSH);
verifyButton.setText("Verify...");
14 years, 1 month
JBoss Tools SVN: r38600 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/behaviour and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-10 09:31:02 -0500 (Fri, 10 Feb 2012)
New Revision: 38600
Added:
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/ui/console/ExpressConsoleView.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RemoveConnectionActionProvider.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.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/behaviour/ExpressDetailsComposite.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
Log:
Added delete connection action, updated user model to allow listeners, added viewer refresh after model change, Updated error messaging in new server composite
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-10 12:01:37 UTC (rev 38599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-10 14:31:02 UTC (rev 38600)
@@ -297,7 +297,7 @@
</view-->
<view
category="org.jboss.tools.common.model.ui.views"
- class="org.eclipse.ui.navigator.CommonNavigator"
+ class="org.jboss.tools.openshift.express.internal.ui.console.ExpressConsoleView"
icon="icons/openshift-logo-white-icon.png"
id="org.jboss.tools.openshift.express.ui.viewer.expressConsoleView"
name="OpenShift Express Console">
@@ -370,6 +370,17 @@
</enablement>
</actionProvider>
<actionProvider
+ class="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.RemoveConnectionActionProvider"
+ id="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.RemoveConnectionActionProvider">
+ <enablement>
+ <and>
+ <instanceof
+ value="com.openshift.express.client.IUser">
+ </instanceof>
+ </and>
+ </enablement>
+ </actionProvider>
+ <actionProvider
class="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.CreateApplicationActionProvider"
id="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.createApplicationActionProvider">
<enablement>
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-10 12:01:37 UTC (rev 38599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -10,8 +10,14 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.core.behaviour;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jgit.transport.URIish;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerAttributes;
@@ -26,8 +32,7 @@
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerCreationUtils;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IUser;
@@ -320,5 +325,38 @@
return false;
}
-
+ public static IApplication findApplicationForProject(IProject p, List<IApplication> applications)
+ throws OpenShiftException, CoreException {
+ List<URIish> uris = EGitUtils.getRemoteURIs(p);
+ Iterator<IApplication> i = applications.iterator();
+ while(i.hasNext()) {
+ IApplication a = i.next();
+ String gitUri = a.getGitUri();
+ Iterator<URIish> j = uris.iterator();
+ while(j.hasNext()) {
+ String projUri = j.next().toPrivateString();
+ if( projUri.equals(gitUri)) {
+ return a;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static IProject findProjectForApplication(IApplication application)
+ throws OpenShiftException, CoreException {
+ String gitUri = application.getGitUri();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for( int i = 0; i < projects.length; i++ ) {
+ List<URIish> uris = EGitUtils.getRemoteURIs(projects[i]);
+ Iterator<URIish> it = uris.iterator();
+ while(it.hasNext()) {
+ String projURI = it.next().toPrivateString();
+ if( projURI.equals(gitUri))
+ return projects[i];
+ }
+ }
+ return null;
+ }
+
}
Added: 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 (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/IUserModelListener.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -0,0 +1,9 @@
+package org.jboss.tools.openshift.express.internal.core.console;
+
+import com.openshift.express.client.IUser;
+
+public interface IUserModelListener {
+ public void userAdded(IUser user);
+ public void userRemoved(IUser user);
+ public void userChanged(IUser user);
+}
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-10 12:01:37 UTC (rev 38599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -11,6 +11,7 @@
package org.jboss.tools.openshift.express.internal.core.console;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -40,11 +41,20 @@
/** The most recent user connected on OpenShift. */
private IUser recentUser = null;
private HashMap<String, IUser> allUsers = new HashMap<String,IUser>();
+ private ArrayList<IUserModelListener> listeners = new ArrayList<IUserModelListener>();
public UserModel() {
load();
}
+ public void addListener(IUserModelListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(IUserModelListener listener) {
+ listeners.remove(listener);
+ }
+
/**
* Create a user for temporary external use
*
@@ -60,14 +70,51 @@
return u;
}
+ private static final int ADDED = 0;
+ private static final int REMOVED = 1;
+ private static final int CHANGED = 2;
+
public void addUser(IUser user) {
try {
allUsers.put(user.getRhlogin(), user);
this.recentUser = user;
+ fireModelChange(user, ADDED);
} catch(OpenShiftException ose ) {
// TODO
}
}
+
+ public void removeUser(IUser user) {
+ try {
+ allUsers.remove(user.getRhlogin());
+ if( this.recentUser == user )
+ this.recentUser = null;
+ fireModelChange(user, REMOVED);
+ } catch(OpenShiftException ose ) {
+ // TODO
+ }
+ }
+
+ private void fireModelChange(IUser user, int type) {
+ Iterator<IUserModelListener> i = listeners.iterator();
+ while(i.hasNext()) {
+ IUserModelListener l = i.next();
+ switch (type) {
+ case ADDED:
+ l.userAdded(user);
+ break;
+ case REMOVED:
+ l.userRemoved(user);
+ break;
+ case CHANGED:
+ l.userChanged(user);
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
public IUser getRecentUser() {
return recentUser;
@@ -177,6 +224,9 @@
* null if platform not found, or password not stored
*/
public String getPasswordFromSecureStorage(final String rhLogin) {
+ if( rhLogin == null )
+ return null;
+
SecurePasswordStore store = getSecureStore(rhLogin);
if( store != null && rhLogin != null && !rhLogin.isEmpty() ) {
try {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-10 12:01:37 UTC (rev 38599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -12,7 +12,6 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IFolder;
@@ -24,7 +23,6 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jgit.transport.URIish;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -42,8 +40,8 @@
import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI.IServerModeUICallback;
import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyComboCommand;
import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyCommand;
-import org.jboss.tools.openshift.egit.core.EGitUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftWizardModel;
@@ -63,9 +61,9 @@
protected IServerModeUICallback callback;
private ModifyListener nameModifyListener, remoteModifyListener,
appModifyListener, deployProjectModifyListener;
-// private ModifyListener passModifyListener;
+ private ModifyListener passModifyListener;
protected Text userText, remoteText;
-// protected Text passText;
+ protected Text passText;
protected Combo appNameCombo, deployProjectCombo;
protected Button verifyButton;
protected boolean showVerify;
@@ -91,18 +89,14 @@
return composite;
}
- public String getPassword() {
- return pass;
- }
-
private void fillSection(Composite composite) {
composite.setLayout(new GridLayout(2, false));
Label userLabel = new Label(composite, SWT.NONE);
userText = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(userText);
Label passLabel = new Label(composite, SWT.NONE);
-// passText = new Text(composite, SWT.PASSWORD | SWT.BORDER);
-// GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(passText);
+ passText = new Text(composite, SWT.PASSWORD | SWT.BORDER);
+ GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(passText);
if( mode.equals(ExpressServerUtils.EXPRESS_SOURCE_MODE) ) {
Label appNameLabel = new Label(composite, SWT.NONE);
@@ -134,9 +128,10 @@
remoteText.setText(IOpenShiftWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT);
String n = ExpressServerUtils.getExpressUsername(server);
+ String p = UserModel.getDefault().getPasswordFromSecureStorage(n);
String remote = ExpressServerUtils.getExpressRemoteName(server);
if( n != null ) userText.setText(n);
-// if( p != null ) passText.setText(p);
+ if( p != null ) passText.setText(p);
if( remote != null ) remoteText.setText(remote);
if( showVerify ) {
@@ -169,18 +164,21 @@
nameModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
user = userText.getText();
+ String storedPass = UserModel.getDefault().getPasswordFromSecureStorage(user);
+ if( storedPass != null && !storedPass.equals(""))
+ passText.setText(storedPass);
callback.execute(new SetUserCommand(server));
}
};
userText.addModifyListener(nameModifyListener);
-// passModifyListener = new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// //pass = passText.getText();
-// callback.execute(new SetPassCommand(server));
-// }
-// };
-// passText.addModifyListener(passModifyListener);
+ passModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ //pass = passText.getText();
+ callback.execute(new SetPassCommand(server));
+ }
+ };
+ passText.addModifyListener(passModifyListener);
remoteModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -283,32 +281,31 @@
}
}
-// public class SetPassCommand extends ServerWorkingCopyPropertyCommand {
-// public SetPassCommand(IServerWorkingCopy server) {
-// super(server, Messages.EditorChangePasswordCommandName, passText, passText.getText(),
-// IJBossToolingConstants.SERVER_PASSWORD, passModifyListener);
-// oldVal = passText.getText();
-// }
-//
-// public void execute() {
-// pass = newVal;
-// }
-//
-// public void undo() {
-// pass = oldVal;
-// text.removeModifyListener(listener);
-// text.setText(oldVal);
-// text.addModifyListener(listener);
-// }
-// }
+ public class SetPassCommand extends ServerWorkingCopyPropertyCommand {
+ public SetPassCommand(IServerWorkingCopy server) {
+ super(server, Messages.EditorChangePasswordCommandName, passText, passText.getText(),
+ null, passModifyListener);
+ oldVal = passText.getText();
+ }
+
+ public void execute() {
+ pass = newVal;
+ }
+
+ public void undo() {
+ pass = oldVal;
+ text.removeModifyListener(listener);
+ text.setText(oldVal);
+ text.addModifyListener(listener);
+ }
+ }
private Runnable getVerifyingCredentialsJob(final CredentialsWizardPageModel model) {
return new Runnable() {
public void run() {
final IStatus s = model.validateCredentials();
- String error = null;
if( !s.isOK() ) {
- error = "Credentials Failed";
+ ExpressDetailsComposite.this.error = "Credentials Failed";
} else {
if( mode.equals(ExpressServerUtils.EXPRESS_SOURCE_MODE) ) {
@@ -317,28 +314,11 @@
verifyApplicationBinaryMode(model);
}
}
- ExpressDetailsComposite.this.error = error;
}
};
}
- private IApplication findApplicationForProject(IProject p, List<IApplication> applications)
- throws OpenShiftException, CoreException {
- List<URIish> uris = EGitUtils.getRemoteURIs(p);
- Iterator<IApplication> i = applications.iterator();
- while(i.hasNext()) {
- IApplication a = i.next();
- String gitUri = a.getGitUri();
- Iterator<URIish> j = uris.iterator();
- while(j.hasNext()) {
- String projUri = j.next().toPrivateString();
- if( projUri.equals(gitUri)) {
- return a;
- }
- }
- }
- return null;
- }
+
private void verifyApplicationBinaryMode(CredentialsWizardPageModel model) {
System.out.println(deployProject);
@@ -346,7 +326,7 @@
try {
fuser = OpenShiftUIActivator.getDefault().getUser();
final List<IApplication> allApps = fuser.getApplications();
- fapplication = findApplicationForProject(p, allApps);
+ fapplication = ExpressServerUtils.findApplicationForProject(p, allApps);
if( fapplication == null ) {
error = "Application for project \"" + p.getName() + "\" not found";
@@ -366,6 +346,7 @@
}
private void verifyApplicationSourceMode(CredentialsWizardPageModel model) {
+ error = null;
// now check the app name and cartridge
String[] appNames = new String[]{};
try {
@@ -406,5 +387,27 @@
return appNames;
}
+ public String getUsername() {
+ return user;
+ }
+
+ public String getPassword() {
+ return pass;
+ }
+
+ public String getApplicationName() {
+ return app;
+ }
+ public IUser getUser() {
+ return fuser;
+ }
+
+ public IApplication getApplication() {
+ return fapplication;
+ }
+
+ public String getRemote() {
+ return remote;
+ }
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-02-10 12:01:37 UTC (rev 38599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.behaviour;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
@@ -22,7 +23,12 @@
import org.jboss.ide.eclipse.as.ui.editor.DeploymentTypeUIUtil.NewServerWizardBehaviourCallback;
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
public class ExpressWizardFragment extends WizardFragment implements ICompletable {
private IWizardHandle handle;
private ExpressDetailsComposite composite;
@@ -66,6 +72,19 @@
public void performFinish(IProgressMonitor monitor) throws CoreException {
super.performFinish(monitor);
-// ExpressServerUtils.setExpressPassword(callback.getServer(), composite.getPassword());
+ IUser user = composite.getUser();
+ UserModel.getDefault().addUser(user);
+ IApplication app = composite.getApplication();
+ try {
+ // Only clone and import if there's no project already in existence
+ IProject p = ExpressServerUtils.findProjectForApplication(app);
+ if( p == null ) {
+ // clone and import
+
+ // If we had to clone and import, we also need to add the module ??
+ }
+ } catch(OpenShiftException ose ) {
+
+ }
}
}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -0,0 +1,48 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.jboss.tools.openshift.express.internal.core.console.IUserModelListener;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+
+import com.openshift.express.client.IUser;
+
+public class ExpressConsoleView extends CommonNavigator implements IUserModelListener {
+ protected Object getInitialInput() {
+ return UserModel.getDefault();
+ }
+ protected CommonViewer createCommonViewer(Composite aParent) {
+ CommonViewer v = super.createCommonViewer(aParent);
+ UserModel.getDefault().addListener(this);
+ return v;
+ }
+ public void dispose() {
+ UserModel.getDefault().removeListener(this);
+ super.dispose();
+ }
+
+ private void refreshViewer() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ getCommonViewer().refresh();
+ }
+ });
+ }
+ public void userAdded(IUser user) {
+ if( getCommonViewer() != null && !getCommonViewer().getTree().isDisposed()) {
+ refreshViewer();
+ }
+ }
+ public void userRemoved(IUser user) {
+ if( getCommonViewer() != null && !getCommonViewer().getTree().isDisposed()) {
+ refreshViewer();
+ }
+ }
+ public void userChanged(IUser user) {
+ if( getCommonViewer() != null && !getCommonViewer().getTree().isDisposed()) {
+ refreshViewer();
+ }
+ }
+}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2012-02-10 12:01:37 UTC (rev 38599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -1,5 +1,6 @@
package org.jboss.tools.openshift.express.internal.ui.console;
+import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.navigator.CommonActionProvider;
@@ -9,12 +10,15 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.CommonActionProviderUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.action.TailServerLogAction;
+import com.openshift.express.client.IUser;
+
public class TailServerLogActionProvider extends CommonActionProvider {
private TailServerLogAction action;
-
+
private ICommonActionExtensionSite actionExtensionSite;
public void init(ICommonActionExtensionSite actionExtensionSite) {
@@ -24,7 +28,6 @@
if (site instanceof ICommonViewerWorkbenchSite) {
action = new TailServerLogAction();
action.setSelection(actionExtensionSite.getStructuredViewer().getSelection());
- actionExtensionSite.getStructuredViewer().addSelectionChangedListener(action);
}
}
@@ -34,7 +37,6 @@
if( sel instanceof IServer ) {
IServer server = (IServer)sel;
if (ExpressServerUtils.isOpenShiftRuntime(server) || ExpressServerUtils.isInOpenshiftBehaviourMode(server)) {
- //menu.insertBefore(ServerActionProvider.CONTROL_SERVER_SECTION_END_SEPARATOR, action);
CommonActionProviderUtils.addToShowInQuickSubMenu(action, menu, actionExtensionSite);
}
}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RemoveConnectionActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RemoveConnectionActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RemoveConnectionActionProvider.java 2012-02-10 14:31:02 UTC (rev 38600)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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.viewer.actionProvider;
+
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import org.jboss.tools.openshift.express.internal.ui.action.AbstractAction;
+
+import com.openshift.express.client.IUser;
+
+/**
+ * @author Rob Stryker
+ */
+public class RemoveConnectionActionProvider extends AbstractActionProvider {
+
+
+
+ public RemoveConnectionActionProvider() {
+ super(new DeleteConnectionAction(), "group.edition");
+ }
+
+
+ public static class DeleteConnectionAction extends AbstractAction {
+
+ public DeleteConnectionAction() {
+ super("Delete Connection");
+ }
+
+ @Override
+ public void run() {
+ final ITreeSelection treeSelection = (ITreeSelection)selection;
+ if (selection != null && selection instanceof ITreeSelection && treeSelection.getFirstElement() instanceof IUser) {
+ final IUser user = (IUser) treeSelection.getFirstElement();
+ UserModel.getDefault().removeUser(user);
+ }
+ }
+
+
+ }
+
+}
14 years, 1 month