JBoss Tools SVN: r35341 - in trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui: src/org/jboss/ide/eclipse/as/openshift/ui/internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-04 18:25:30 -0400 (Tue, 04 Oct 2011)
New Revision: 35341
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/icons/openshift-logo-white-medium.png
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/OpenshiftImages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/AbstractOpenshiftWizardPage.java
Log:
[JBIDE-9793] implementing Application page (selection, create new, delete selected, etc.)
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/icons/openshift-logo-white-medium.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/icons/openshift-logo-white-medium.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/OpenshiftImages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/OpenshiftImages.java 2011-10-04 22:22:20 UTC (rev 35340)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/OpenshiftImages.java 2011-10-04 22:25:30 UTC (rev 35341)
@@ -22,6 +22,7 @@
public static final ImageDescriptor OPENSHIFT_LOGO_DARK = repo.create("openshift-logo-dark.png"); //$NON-NLS-1$
public static final ImageDescriptor OPENSHIFT_LOGO_WHITE = repo.create("openshift-logo-white.png"); //$NON-NLS-1$
+ public static final ImageDescriptor OPENSHIFT_LOGO_WHITE_MEDIUM = repo.create("openshift-logo-white-medium.png"); //$NON-NLS-1$
public static final ImageDescriptor OK = repo.create("ok.png"); //$NON-NLS-1$
public static final ImageDescriptor ERROR = repo.create("error.png"); //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/AbstractOpenshiftWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/AbstractOpenshiftWizardPage.java 2011-10-04 22:22:20 UTC (rev 35340)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/AbstractOpenshiftWizardPage.java 2011-10-04 22:25:30 UTC (rev 35341)
@@ -35,7 +35,7 @@
setWizard(wizard);
setTitle(title);
setDescription(description);
- setImageDescriptor(OpenshiftImages.OPENSHIFT_LOGO_WHITE);
+ setImageDescriptor(OpenshiftImages.OPENSHIFT_LOGO_WHITE_MEDIUM);
}
@Override
13 years, 5 months
JBoss Tools SVN: r35340 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-04 18:22:20 -0400 (Tue, 04 Oct 2011)
New Revision: 35340
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/CredentialsWizardPage.java
Log:
[JBIDE-9793] implementing Application page (selection, create new, delete selected, etc.)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java 2011-10-04 22:18:41 UTC (rev 35339)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java 2011-10-04 22:22:20 UTC (rev 35340)
@@ -106,12 +106,12 @@
Button newButton = new Button(container, SWT.PUSH);
newButton.setText("Ne&w");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(newButton);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, 30).applyTo(newButton);
newButton.addSelectionListener(onNew(dbc));
Button deleteButton = new Button(container, SWT.PUSH);
deleteButton.setText("&Delete");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(deleteButton);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, 30).applyTo(deleteButton);
DataBindingUtils.bindButtonEnablementToValidationStatus(deleteButton, dbc, selectedApplicationBinding);
deleteButton.addSelectionListener(onDelete(dbc));
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/CredentialsWizardPage.java 2011-10-04 22:18:41 UTC (rev 35339)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/CredentialsWizardPage.java 2011-10-04 22:22:20 UTC (rev 35340)
@@ -106,7 +106,7 @@
this.validateButton = new Button(container, SWT.NONE);
validateButton.setText("&Validate");
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).indent(0, 10).hint(100, 34).applyTo(validateButton);
+ GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).indent(0, 10).hint(100, 30).applyTo(validateButton);
DataBindingUtils.bindButtonEnablementToValidationStatus(
validateButton,
dbc,
13 years, 5 months
JBoss Tools SVN: r35339 - in trunk/as/plugins: org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-04 18:18:41 -0400 (Tue, 04 Oct 2011)
New Revision: 35339
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java
Log:
[JBIDE-9793] implementing Application page (selection, create new, delete selected, etc.)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-10-04 21:59:49 UTC (rev 35338)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-10-04 22:18:41 UTC (rev 35339)
@@ -44,6 +44,8 @@
public Collection<ICartridge> getCartridges() throws OpenshiftException;
+ public ICartridge getCartridgeByName(String name) throws OpenshiftException;
+
public IApplication createApplication(String name, ICartridge cartridge) throws OpenshiftException;
public Collection<IApplication> getApplications() throws OpenshiftException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-10-04 21:59:49 UTC (rev 35338)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-10-04 22:18:41 UTC (rev 35339)
@@ -142,6 +142,18 @@
}
@Override
+ public ICartridge getCartridgeByName(String name) throws OpenshiftException {
+ ICartridge matchingCartridge = null;
+ for(ICartridge cartridge : getCartridges()) {
+ if (name.equals(cartridge.getName())) {
+ matchingCartridge = cartridge;
+ break;
+ }
+ }
+ return matchingCartridge;
+ }
+
+ @Override
public IApplication createApplication(String name, ICartridge cartridge) throws OpenshiftException {
IApplication application = service.createApplication(name, cartridge, this);
add(application);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java 2011-10-04 21:59:49 UTC (rev 35338)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java 2011-10-04 22:18:41 UTC (rev 35339)
@@ -105,12 +105,12 @@
null);
Button newButton = new Button(container, SWT.PUSH);
- newButton.setText("New");
+ newButton.setText("Ne&w");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(newButton);
newButton.addSelectionListener(onNew(dbc));
Button deleteButton = new Button(container, SWT.PUSH);
- deleteButton.setText("Delete");
+ deleteButton.setText("&Delete");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(deleteButton);
DataBindingUtils.bindButtonEnablementToValidationStatus(deleteButton, dbc, selectedApplicationBinding);
deleteButton.addSelectionListener(onDelete(dbc));
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java 2011-10-04 21:59:49 UTC (rev 35338)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java 2011-10-04 22:18:41 UTC (rev 35339)
@@ -10,28 +10,58 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.ui.internal.wizard;
+import java.util.concurrent.ArrayBlockingQueue;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
+import org.jboss.tools.common.ui.WizardUtils;
/**
* @author André Dietisheim
*/
public class NewApplicationDialog extends Wizard {
- private IUser user;
+ private NewApplicationWizardPageModel newApplicationModel;
public NewApplicationDialog(IUser user) {
- this.user = user;
+ this.newApplicationModel = new NewApplicationWizardPageModel(user);
setNeedsProgressMonitor(true);
}
@Override
public boolean performFinish() {
- return true;
+ final ArrayBlockingQueue<Boolean> queue = new ArrayBlockingQueue<Boolean>(1);
+ try {
+ WizardUtils.runInWizard(new Job("Creating application") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ newApplicationModel.createApplication();
+ queue.offer(true);
+ } catch (OpenshiftException e) {
+ queue.offer(false);
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ NLS.bind("Could not create application \"{0}\"", newApplicationModel.getName()), e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getContainer());
+ } catch (Exception e) {
+ // ignore
+ }
+ return queue.poll();
}
@Override
public void addPages() {
- addPage(new NewApplicationWizardPage(new NewApplicationWizardPageModel(user), this));
+ addPage(new NewApplicationWizardPage(newApplicationModel, this));
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java 2011-10-04 21:59:49 UTC (rev 35338)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java 2011-10-04 22:18:41 UTC (rev 35339)
@@ -10,20 +10,30 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.ui.internal.wizard;
+import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.UpdateListStrategy;
+import org.eclipse.core.databinding.UpdateValueStrategy;
+import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
import org.jboss.tools.common.ui.WizardUtils;
@@ -33,8 +43,6 @@
*/
public class NewApplicationWizardPage extends AbstractOpenshiftWizardPage {
- private static final int NAME_MAXLENGTH = 13;
-
private NewApplicationWizardPageModel model;
public NewApplicationWizardPage(NewApplicationWizardPageModel model, IWizard wizard) {
@@ -48,22 +56,45 @@
GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).applyTo(parent);
Label nameLabel = new Label(parent, SWT.NONE);
- nameLabel.setText("Name");
+ nameLabel.setText("Na&me");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
Text nameText = new Text(parent, SWT.BORDER);
+ nameText.setTextLimit(13);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(nameText);
+ Binding nameBinding = dbc.bindValue(
+ WidgetProperties.text().observe(nameText)
+ , BeanProperties.value(NewApplicationWizardPageModel.PROPERTY_NAME).observe(model)
+ , new UpdateValueStrategy().setAfterGetValidator(new ApplicationNameValidator())
+ , null);
+ ControlDecorationSupport.create(nameBinding, SWT.LEFT | SWT.TOP);
Label cartridgeLabel = new Label(parent, SWT.WRAP);
- cartridgeLabel.setText("Cartridge");
+ cartridgeLabel.setText("&Cartridge");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(cartridgeLabel);
- Combo cartridgesCombo = new Combo(parent, SWT.BORDER);
+ Combo cartridgesCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
+ dbc.bindList(
+ WidgetProperties.items().observe(cartridgesCombo)
+ , BeanProperties.list(NewApplicationWizardPageModel.PROPERTY_CARTRIDGES).observe(model)
+ , new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER)
+ , new UpdateListStrategy().setConverter(new Converter(Object.class, String.class) {
+
+ @Override
+ public Object convert(Object fromObject) {
+ if (!(fromObject instanceof ICartridge)) {
+ return null;
+ }
+ return ((ICartridge) fromObject).getName();
+ }
+ }));
+ dbc.bindValue(WidgetProperties.selection().observe(cartridgesCombo)
+ , BeanProperties.value(NewApplicationWizardPageModel.PROPERTY_SELECTED_CARTRIDGE).observe(model));
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(cartridgesCombo);
}
@Override
protected void onPageActivated(DataBindingContext dbc) {
try {
- WizardUtils.runInWizard(new Job("Load cartridges") {
+ WizardUtils.runInWizard(new Job("Loading cartridges") {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -80,17 +111,18 @@
}
}
- private final class ApplicationNameValidator implements IInputValidator {
+ private class ApplicationNameValidator implements IValidator {
@Override
- public String isValid(String newText) {
- if (newText.length() > 0
- && newText.length() <= NAME_MAXLENGTH) {
- return null;
- } else {
- return "you have to provide a valid application name with less than 13 characters";
+ public IStatus validate(Object value) {
+ String name = (String) value;
+ if (name.length() == 0) {
+ return ValidationStatus.error("You have to provide a name");
+ } else if (model.hasApplication(name)) {
+ return ValidationStatus.error(NLS.bind(
+ "Names must be unique. You already have an application named \"{0}\"", name));
}
+ return ValidationStatus.ok();
}
- };
-
+ }
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java 2011-10-04 21:59:49 UTC (rev 35338)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java 2011-10-04 22:18:41 UTC (rev 35339)
@@ -15,22 +15,50 @@
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.common.ui.preferencevalue.StringPreferenceValue;
/**
* @author André Dietisheim
*/
public class NewApplicationWizardPageModel extends ObservableUIPojo {
- private static final String PROPERTY_CARTRIDGES = "cartridges";
+ public static final String PROPERTY_NAME = "name";
+ public static final String PROPERTY_CARTRIDGES = "cartridges";
+ public static final String PROPERTY_SELECTED_CARTRIDGE = "selectedCartridge";
+
+ private IUser user;
+ private String name;
- private IUser user;
private Collection<ICartridge> cartridges;
-
+ private String selectedCartridge;
+ private StringPreferenceValue selectedCartridgePreference;
+
public NewApplicationWizardPageModel(IUser user) {
this.user = user;
+ this.selectedCartridgePreference = new StringPreferenceValue(
+ "org.jboss.ide.eclipse.as.openshift.ui.internal.wizard.NewApplicationWizard.selectedCartridge", OpenshiftUIActivator.PLUGIN_ID);
+ initSelectedCartridge();
}
+ private void initSelectedCartridge() {
+ String selectedCartridge = selectedCartridgePreference.get();
+ if (selectedCartridge == null
+ || selectedCartridge.length() == 0) {
+ selectedCartridge = ICartridge.JBOSSAS_7.getName();
+ }
+ this.selectedCartridge = selectedCartridge;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
+ }
+
public void loadCartridges() throws OpenshiftException {
setCartridges(user.getCartridges());
}
@@ -38,4 +66,32 @@
public void setCartridges(Collection<ICartridge> cartridges) {
firePropertyChange(PROPERTY_CARTRIDGES, this.cartridges, this.cartridges = cartridges);
}
+
+ public Collection<ICartridge> getCartridges() {
+ return cartridges;
+ }
+
+ public String getSelectedCartridge() {
+ return selectedCartridge;
+ }
+
+ public void setSelectedCartridge(String name) {
+ selectedCartridgePreference.store(name);
+ firePropertyChange(PROPERTY_SELECTED_CARTRIDGE, selectedCartridge, this.selectedCartridge = name);
+ }
+
+ public void createApplication() throws OpenshiftException {
+ user.createApplication(name, user.getCartridgeByName(selectedCartridge));
+ }
+
+ public boolean hasApplication(String name) {
+ try {
+ return user.getApplicationByName(name) != null;
+ } catch (OpenshiftException e) {
+ // TODO proper logging
+ return false;
+ }
+ }
+
+
}
13 years, 5 months
JBoss Tools SVN: r35338 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-10-04 17:59:49 -0400 (Tue, 04 Oct 2011)
New Revision: 35338
Modified:
trunk/build/parent/pom.xml
Log:
fix for emma instrumentation. instead of instrumenting plugin into plugins/target dir, it now does it into test's target/instrumented classes dir, to be able to remove instrumented classes by clean goal.
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2011-10-04 21:57:44 UTC (rev 35337)
+++ trunk/build/parent/pom.xml 2011-10-04 21:59:49 UTC (rev 35338)
@@ -604,21 +604,21 @@
<then>
<echo>Process emma report...</echo>
<for list="${emma.instrument.bundles}" param="bundle">
- <sequential>
- <property name="@{bundle}-classes" location="${project.build.directory}/../../../plugins/@{bundle}" />
- <echo>instruments ${@{bundle}-classes}</echo>
- <emma enabled="true">
- <instr metadatafile="${project.build.directory}/emma/(a){bundle}-coverage.em"
- mode="copy" outdir="${project.build.directory}/../../../plugins/@{bundle}/target/instrumented-classes">
- <instrpath>
- <fileset dir="${@{bundle}-classes}" includes="*.jar"/>
- <fileset dir="${@{bundle}-classes}/target" includes="*.jar"/>
- </instrpath>
- </instr>
- </emma>
- </sequential>
+ <sequential>
+ <property name="@{bundle}-classes"
+ location="${project.build.directory}/../../../plugins/@{bundle}" />
+ <echo>instruments ${@{bundle}-classes}</echo>
+ <emma enabled="true">
+ <instr metadatafile="${project.build.directory}/emma/(a){bundle}-coverage.em"
+ mode="copy" outdir="${project.build.directory}/instrumented-classes/@{bundle}">
+ <instrpath>
+ <fileset dir="${@{bundle}-classes}" includes="*.jar" />
+ <fileset dir="${@{bundle}-classes}/target" includes="*.jar" />
+ </instrpath>
+ </instr>
+ </emma>
+ </sequential>
</for>
-
<emma enabled="true">
<report>
<infileset dir="${project.build.directory}/emma"
13 years, 5 months
JBoss Tools SVN: r35337 - branches/jbosstools-3.2.x/build/aggregate/webtools-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-04 17:57:44 -0400 (Tue, 04 Oct 2011)
New Revision: 35337
Modified:
branches/jbosstools-3.2.x/build/aggregate/webtools-site/index.html
Log:
regenerate index.html
Modified: branches/jbosstools-3.2.x/build/aggregate/webtools-site/index.html
===================================================================
--- branches/jbosstools-3.2.x/build/aggregate/webtools-site/index.html 2011-10-04 21:27:43 UTC (rev 35336)
+++ branches/jbosstools-3.2.x/build/aggregate/webtools-site/index.html 2011-10-04 21:57:44 UTC (rev 35337)
@@ -1,6 +1,6 @@
<html>
<head>
-<title>JBoss Tools - Web Tools - Stable Milestone Update Site: 3.3.99.M7.webtools.2011-09-19_19-10-45-H6969</title>
+<title>JBoss Tools - Web Tools - Nightly Build Update Site</title>
<style>
@import url("http://download.jboss.org/jbosstools/updates/web/site.css");
</style>
@@ -21,15 +21,15 @@
<tr>
<td>      </td>
<td>
- <h2 class="title">JBoss Tools - Web Tools - Stable Milestone Update Site</h2>
+ <h2 class="title">JBoss Tools - Web Tools - Nightly Build Update Site</h2>
<table width="100%">
<tr class="header">
- <td class="sub-header" width="100%"><span>Latest Build: 3.3.99.M7.webtools.2011-09-19_19-10-45-H6969</span></td>
+ <td class="sub-header" width="100%"><span>Latest Build</span></td>
</tr>
<tr class="light-row" style="height: 30px">
<td class="bodyText">
- <p class="bodyText">This is the <b>Stable Milestone</b>
+ <p class="bodyText">This is the <b>Nightly Build</b>
Update Site for JBoss Tools - Web Tools. See <a class="link"
href="http://www.jboss.org/tools/download/installation/update_3_2">Installation
Instructions</a>.</p>
@@ -78,25 +78,21 @@
</th>
</tr>
<tr style="background-color:
							#EEEEEE
						">
- <td class="rowLine"><a href="features/org.jboss.ide.eclipse.archives.feature_3.2.0.v20110920-0932-H182-CR1.jar" style="font-size:x-small">org.jboss.ide.eclipse.archives.feature</a></td>
- <td><span style="font-size:x-small">3.2.0.v20110920-0932-H182-CR1</span></td>
- <td><span style="font-size:x-small">
- |
- org.eclipse.wst.server.core.serverAdapter</span></td>
+ <td class="rowLine"><a href="features/org.jboss.ide.eclipse.archives.feature_3.2.0.v20110924-0653-H191-M2.jar" style="font-size:x-small">org.jboss.ide.eclipse.archives.feature</a></td>
+ <td><span style="font-size:x-small">3.2.0.v20110924-0653-H191-M2</span></td>
+ <td></td>
</tr>
<tr style="background-color:
							#FFFFFF
						">
- <td class="rowLine"><a href="features/org.jboss.ide.eclipse.as.feature_2.2.0.v20110920-0516-H242-CR1.jar" style="font-size:x-small">org.jboss.ide.eclipse.as.feature</a></td>
- <td><span style="font-size:x-small">2.2.0.v20110920-0516-H242-CR1</span></td>
+ <td class="rowLine"><a href="features/org.jboss.ide.eclipse.as.feature_2.2.0.v20110924-0748-H251-M2.jar" style="font-size:x-small">org.jboss.ide.eclipse.as.feature</a></td>
+ <td><span style="font-size:x-small">2.2.0.v20110924-0748-H251-M2</span></td>
<td><span style="font-size:x-small">
|
org.eclipse.wst.server.core.serverAdapter</span></td>
</tr>
<tr style="background-color:
							#EEEEEE
						">
- <td class="rowLine"><a href="features/org.jboss.tools.jmx.feature_1.1.0.v20110920-0921-H143-CR1.jar" style="font-size:x-small">org.jboss.tools.jmx.feature</a></td>
- <td><span style="font-size:x-small">1.1.0.v20110920-0921-H143-CR1</span></td>
- <td><span style="font-size:x-small">
- |
- org.eclipse.wst.server.core.serverAdapter</span></td>
+ <td class="rowLine"><a href="features/org.jboss.tools.jmx.feature_1.1.0.v20110924-0638-H150-M2.jar" style="font-size:x-small">org.jboss.tools.jmx.feature</a></td>
+ <td><span style="font-size:x-small">1.1.0.v20110924-0638-H150-M2</span></td>
+ <td></td>
</tr>
<tr style="background-color:#DDDDDD">
<th colspan="1" style="font-size:small">Metadata</th>
13 years, 5 months
JBoss Tools SVN: r35336 - in trunk/examples: plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-04 17:27:43 -0400 (Tue, 04 Oct 2011)
New Revision: 35336
Added:
trunk/examples/tests/org.jboss.tools.project.examples.test/resources/
trunk/examples/tests/org.jboss.tools.project.examples.test/resources/testRelativePath.zip
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project
trunk/examples/plugins/org.jboss.tools.project.examples/.project
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
trunk/examples/tests/org.jboss.tools.project.examples.test/.project
trunk/examples/tests/org.jboss.tools.project.examples.test/build.properties
trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/ProjectTest.java
trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java
Log:
JBIDE-9708 project examples should resolve its path relative to the location of the projectexample.xml file by default
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/.project
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/.project 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/.project 2011-10-04 21:27:43 UTC (rev 35336)
@@ -31,11 +31,4 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
- <linkedResources>
- <link>
- <name>lib-org.jboss.tools.jst.web.kb_3.3.0.v20110915-1635-H19-M3</name>
- <type>2</type>
- <location>E:/eclipse-3.7/plugins/org.jboss.tools.jst.web.kb_3.3.0.v20110915-1635-H19-M3</location>
- </link>
- </linkedResources>
</projectDescription>
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -82,16 +82,16 @@
private static String EXPERIMENTAL_EXT = "experimental"; //$NON-NLS-1$
- private static Set<ProjectExampleSite> pluginSites;
+ private static Set<IProjectExampleSite> pluginSites;
- private static HashSet<ProjectExampleSite> invalidSites = new HashSet<ProjectExampleSite>();
+ private static HashSet<IProjectExampleSite> invalidSites = new HashSet<IProjectExampleSite>();
private ProjectUtil() {
}
- public static Set<ProjectExampleSite> getPluginSites() {
+ public static Set<IProjectExampleSite> getPluginSites() {
if (pluginSites == null) {
- pluginSites = new HashSet<ProjectExampleSite>();
+ pluginSites = new HashSet<IProjectExampleSite>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry
.getExtensionPoint(PROJECT_EXAMPLES_XML_EXTENSION_ID);
@@ -100,7 +100,7 @@
IExtension extension = extensions[i];
IConfigurationElement[] configurationElements = extension
.getConfigurationElements();
- ProjectExampleSite site = new ProjectExampleSite();
+ IProjectExampleSite site = new ProjectExampleSite();
site.setName(extension.getLabel());
for (int j = 0; j < configurationElements.length; j++) {
IConfigurationElement configurationElement = configurationElements[j];
@@ -126,8 +126,8 @@
return pluginSites;
}
- public static Set<ProjectExampleSite> getUserSites() {
- Set<ProjectExampleSite> sites = new HashSet<ProjectExampleSite>();
+ public static Set<IProjectExampleSite> getUserSites() {
+ Set<IProjectExampleSite> sites = new HashSet<IProjectExampleSite>();
ProjectExampleSite site = getSite(getProjectExamplesXml());
if (site != null) {
sites.add(site);
@@ -172,8 +172,8 @@
return sites;
}
- private static Set<ProjectExampleSite> getSites() {
- Set<ProjectExampleSite> sites = new HashSet<ProjectExampleSite>();
+ private static Set<IProjectExampleSite> getSites() {
+ Set<IProjectExampleSite> sites = new HashSet<IProjectExampleSite>();
sites.addAll(getPluginSites());
sites.addAll(getUserSites());
return sites;
@@ -207,15 +207,19 @@
}
return null;
}
+
+ public static List<Category> getProjects(IProgressMonitor monitor) {
+ return getProjects(getSites(), monitor);
+ }
- public static List<Category> getProjects(IProgressMonitor monitor) {
+ public static List<Category> getProjects(Set<IProjectExampleSite> sites, IProgressMonitor monitor) {
monitor.setTaskName(Messages.ProjectUtil_Parsing_project_description_files);
- Set<ProjectExampleSite> sites = getSites();
+
List<Category> list = new ArrayList<Category>();
invalidSites.clear();
Category other = Category.OTHER;
try {
- for (ProjectExampleSite site : sites) {
+ for (IProjectExampleSite site : sites) {
boolean showExperimentalSites = ProjectExamplesActivator.getDefault().getPreferenceStore().getBoolean(ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES);
if (!showExperimentalSites && site.isExperimental()) {
continue;
@@ -535,7 +539,7 @@
return doc;
}
- public static String getAsXML(Set<ProjectExampleSite> sites)
+ public static String getAsXML(Set<IProjectExampleSite> sites)
throws ParserConfigurationException, TransformerException,
UnsupportedEncodingException {
if (sites == null || sites.size() == 0) {
@@ -544,7 +548,7 @@
Document doc = getDocument();
Element sitesElement = doc.createElement(SITES);
doc.appendChild(sitesElement);
- for (ProjectExampleSite site : sites) {
+ for (IProjectExampleSite site : sites) {
Element siteElement = doc.createElement(SITE);
siteElement.setAttribute(NAME, site.getName());
siteElement.setAttribute(URL, site.getUrl().toString());
@@ -583,7 +587,7 @@
return root;
}
- public static HashSet<ProjectExampleSite> getInvalidSites() {
+ public static HashSet<IProjectExampleSite> getInvalidSites() {
return invalidSites;
}
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -21,7 +21,7 @@
public class SiteCategory implements IProjectExampleSite {
private String name;
- private Set<ProjectExampleSite> sites;
+ private Set<IProjectExampleSite> sites;
public SiteCategory(String name) {
this.name = name;
@@ -31,11 +31,11 @@
return name;
}
- public Set<ProjectExampleSite> getSites() {
+ public Set<IProjectExampleSite> getSites() {
return sites;
}
- public void setSites(Set<ProjectExampleSite> sites) {
+ public void setSites(Set<IProjectExampleSite> sites) {
this.sites = sites;
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -175,7 +175,7 @@
setErrorMessage(Messages.SiteDialog_The_name_field_is_required);
return updateButton(false);
}
- Set<ProjectExampleSite> siteList = sites.getSites();
+ Set<IProjectExampleSite> siteList = sites.getSites();
for(IProjectExampleSite site:siteList) {
if (site != selectedSite && nameText.getText().equals(site.getName())) {
setErrorMessage(Messages.SiteDialog_The_site_already_exists);
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -27,20 +27,20 @@
public class Sites {
private SiteCategory[] siteCategories;
private SiteCategory userSite;
- private Set<ProjectExampleSite> sites;
+ private Set<IProjectExampleSite> sites;
public SiteCategory[] getSiteCategories() {
if (siteCategories == null) {
siteCategories = new SiteCategory[2];
userSite = new SiteCategory(Messages.Sites_User_sites);
- Set<ProjectExampleSite> userSites = ProjectUtil.getUserSites();
+ Set<IProjectExampleSite> userSites = ProjectUtil.getUserSites();
userSite.setSites(userSites);
siteCategories[0]=userSite;
SiteCategory pluginSite = new SiteCategory(Messages.Sites_Plugin_provided_sites);
- Set<ProjectExampleSite> pluginSites = ProjectUtil.getPluginSites();
+ Set<IProjectExampleSite> pluginSites = ProjectUtil.getPluginSites();
pluginSite.setSites(pluginSites);
siteCategories[1]=pluginSite;
- sites = new HashSet<ProjectExampleSite>();
+ sites = new HashSet<IProjectExampleSite>();
sites.addAll(pluginSites);
sites.addAll(userSites);
}
@@ -57,11 +57,11 @@
sites.add(site);
}
- public Set<ProjectExampleSite> getSites() {
+ public Set<IProjectExampleSite> getSites() {
return sites;
}
- public Set<ProjectExampleSite> getUserSites() {
+ public Set<IProjectExampleSite> getUserSites() {
return userSite.getSites();
}
}
\ No newline at end of file
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -59,13 +59,10 @@
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.dialog.FixDialog;
-import org.jboss.tools.project.examples.fixes.PluginFix;
-import org.jboss.tools.project.examples.fixes.SeamRuntimeFix;
-import org.jboss.tools.project.examples.fixes.WTPRuntimeFix;
import org.jboss.tools.project.examples.model.Category;
import org.jboss.tools.project.examples.model.IImportProjectExample;
+import org.jboss.tools.project.examples.model.IProjectExampleSite;
import org.jboss.tools.project.examples.model.Project;
-import org.jboss.tools.project.examples.model.ProjectExampleSite;
import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.project.examples.model.ProjectUtil;
@@ -419,11 +416,11 @@
} catch (Exception e) {
ProjectExamplesActivator.log(e);
}
- HashSet<ProjectExampleSite> invalidSites = ProjectUtil.getInvalidSites();
+ HashSet<IProjectExampleSite> invalidSites = ProjectUtil.getInvalidSites();
boolean showInvalidSites = ProjectExamplesActivator.getDefault().getPreferenceStore().getBoolean(ProjectExamplesActivator.SHOW_INVALID_SITES);
if (invalidSites.size() > 0 && showInvalidSites && show) {
String message = Messages.NewProjectExamplesWizardPage_Cannot_access_the_following_sites;
- for (ProjectExampleSite site:invalidSites) {
+ for (IProjectExampleSite site:invalidSites) {
message = message + site.getName() + "\n"; //$NON-NLS-1$
ProjectExamplesActivator.log(NLS.bind(Messages.InvalideSite, new Object[] {site.getName(), site.getUrl()} ));
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project 2011-10-04 21:27:43 UTC (rev 35336)
@@ -33,21 +33,6 @@
</natures>
<linkedResources>
<link>
- <name>lib-org.jboss.tools.common.text.ext_3.3.0.v20111001-0437-H476-M4</name>
- <type>2</type>
- <location>E:/eclipse-3.7.1/plugins/org.jboss.tools.common.text.ext_3.3.0.v20111001-0437-H476-M4</location>
- </link>
- <link>
- <name>lib-org.jboss.tools.common.text.xml_3.3.0.v20111001-0437-H476-M4</name>
- <type>2</type>
- <location>E:/eclipse-3.7.1/plugins/org.jboss.tools.common.text.xml_3.3.0.v20111001-0437-H476-M4</location>
- </link>
- <link>
- <name>lib-org.jboss.tools.common_3.3.0.v20111001-0437-H476-M4</name>
- <type>2</type>
- <location>E:/eclipse-3.7.1/plugins/org.jboss.tools.common_3.3.0.v20111001-0437-H476-M4</location>
- </link>
- <link>
<name>lib-org.jboss.tools.jst.jsp_3.3.0.v20111001-0515-H542-M4</name>
<type>2</type>
<location>E:/eclipse-3.7.1/plugins/org.jboss.tools.jst.jsp_3.3.0.v20111001-0515-H542-M4</location>
Modified: trunk/examples/tests/org.jboss.tools.project.examples.test/.project
===================================================================
--- trunk/examples/tests/org.jboss.tools.project.examples.test/.project 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/tests/org.jboss.tools.project.examples.test/.project 2011-10-04 21:27:43 UTC (rev 35336)
@@ -33,11 +33,6 @@
</natures>
<linkedResources>
<link>
- <name>lib-org.jboss.tools.jsf.vpe.seam_3.3.0.v20111001-0617-H456-M4</name>
- <type>2</type>
- <location>E:/eclipse-3.7.1/plugins/org.jboss.tools.jsf.vpe.seam_3.3.0.v20111001-0617-H456-M4</location>
- </link>
- <link>
<name>lib-org.jboss.tools.jst.web.kb_3.3.0.v20111001-0515-H542-M4</name>
<type>2</type>
<location>E:/eclipse-3.7.1/plugins/org.jboss.tools.jst.web.kb_3.3.0.v20111001-0515-H542-M4</location>
Modified: trunk/examples/tests/org.jboss.tools.project.examples.test/build.properties
===================================================================
--- trunk/examples/tests/org.jboss.tools.project.examples.test/build.properties 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/tests/org.jboss.tools.project.examples.test/build.properties 2011-10-04 21:27:43 UTC (rev 35336)
@@ -2,4 +2,5 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.properties
+ plugin.properties,\
+ resources/
Added: trunk/examples/tests/org.jboss.tools.project.examples.test/resources/testRelativePath.zip
===================================================================
(Binary files differ)
Property changes on: trunk/examples/tests/org.jboss.tools.project.examples.test/resources/testRelativePath.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/ProjectTest.java
===================================================================
--- trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/ProjectTest.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/ProjectTest.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -14,31 +14,46 @@
import static org.junit.Assert.assertTrue;
import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Category;
import org.jboss.tools.project.examples.model.IImportProjectExample;
+import org.jboss.tools.project.examples.model.IProjectExampleSite;
import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectExampleSite;
import org.jboss.tools.project.examples.model.ProjectUtil;
import org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard;
import org.jboss.tools.test.util.JobUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.osgi.framework.Bundle;
/**
*
@@ -58,6 +73,60 @@
}
@Test
+ public void testRelativePath() throws Exception {
+ Bundle bundle = Platform.getBundle("org.jboss.tools.project.examples.test");
+ URL entry = bundle.getEntry("/resources/testRelativePath.zip");
+
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ File rootLocation = root.getLocation().toFile();
+ File destination = new File(rootLocation,"testRelativePath");
+ destination.mkdirs();
+ File file = new File(destination, "testRelativePath.zip");
+ InputStream is = null;
+ OutputStream os = null;
+ try {
+ is = entry.openStream();
+ os = new FileOutputStream(file);
+ copy(is,os);
+ ProjectExamplesActivator.extractZipFile(file, destination, new NullProgressMonitor());
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ is = null;
+ }
+ if (os != null) {
+ try {
+ os.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ IProjectExampleSite site = new ProjectExampleSite();
+ site.setExperimental(false);
+ site.setName("Test Relative Path");
+ File projectExamplesFile = new File(destination, "test-examples.xml");
+ URL url = projectExamplesFile.toURI().toURL();
+ site.setUrl(url);
+ Set<IProjectExampleSite> sites = new HashSet<IProjectExampleSite>();
+ sites.add(site);
+ List<Category> categories = ProjectUtil.getProjects(sites , new NullProgressMonitor());
+ Category category = categories.get(0);
+ assertTrue("Test".equals(category.getName()));
+ Project project = category.getProjects().get(0);
+ String urlString = project.getUrl();
+ assertTrue(urlString.startsWith("file:"));
+ url = new URL(urlString);
+ is = url.openStream();
+ assertTrue(is != null);
+ is.close();
+ }
+
+ @Test
public void importNumberguess() throws Exception {
WorkspaceJob workspaceJob = new WorkspaceJob(Messages.NewProjectExamplesWizard_Downloading) {
@@ -149,4 +218,13 @@
}
assertTrue("The '" + projectName + "' contains " + markers.size() + " error(s).", markers.size() == 0);
}
+
+
+ public static void copy(InputStream in, OutputStream out) throws IOException {
+ byte[] buffer = new byte[16 * 1024];
+ int len;
+ while ((len = in.read(buffer)) >= 0) {
+ out.write(buffer, 0, len);
+ }
+ }
}
Modified: trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java
===================================================================
--- trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java 2011-10-04 19:45:52 UTC (rev 35335)
+++ trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java 2011-10-04 21:27:43 UTC (rev 35336)
@@ -16,6 +16,7 @@
import java.util.Set;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.project.examples.model.IProjectExampleSite;
import org.jboss.tools.project.examples.model.ProjectExampleSite;
import org.jboss.tools.project.examples.model.ProjectUtil;
import org.junit.Test;
@@ -29,7 +30,7 @@
@Test
public void sitesPresent() {
- Set<ProjectExampleSite> sites = new HashSet<ProjectExampleSite>();
+ Set<IProjectExampleSite> sites = new HashSet<IProjectExampleSite>();
sites.addAll(ProjectUtil.getPluginSites());
sites.addAll(ProjectUtil.getUserSites());
assertTrue(sites.size() > 0);
@@ -38,7 +39,7 @@
@Test
public void testInvalidSites() {
ProjectUtil.getProjects(new NullProgressMonitor());
- HashSet<ProjectExampleSite> invalidSites = ProjectUtil.getInvalidSites();
+ HashSet<IProjectExampleSite> invalidSites = ProjectUtil.getInvalidSites();
assertTrue(invalidSites.size() <= 0);
}
13 years, 5 months
JBoss Tools SVN: r35335 - branches/jbosstools-3.2.x/build/aggregate/webtools-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-04 15:45:52 -0400 (Tue, 04 Oct 2011)
New Revision: 35335
Modified:
branches/jbosstools-3.2.x/build/aggregate/webtools-site/site.xml
Log:
hide child features from site's categories
Modified: branches/jbosstools-3.2.x/build/aggregate/webtools-site/site.xml
===================================================================
--- branches/jbosstools-3.2.x/build/aggregate/webtools-site/site.xml 2011-10-04 19:18:59 UTC (rev 35334)
+++ branches/jbosstools-3.2.x/build/aggregate/webtools-site/site.xml 2011-10-04 19:45:52 UTC (rev 35335)
@@ -3,10 +3,8 @@
<category-def label="JBoss Application Server Adapters" name="org.eclipse.wst.server.core.serverAdapter">
</category-def>
<feature url="features/org.jboss.tools.jmx.feature_0.0.0.jar" id="org.jboss.tools.jmx.feature" version="0.0.0">
- <category name="org.eclipse.wst.server.core.serverAdapter"/>
</feature>
<feature url="features/org.jboss.ide.eclipse.archives.feature_0.0.0.jar" id="org.jboss.ide.eclipse.archives.feature" version="0.0.0">
- <category name="org.eclipse.wst.server.core.serverAdapter"/>
</feature>
<feature url="features/org.jboss.ide.eclipse.as.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.feature" version="0.0.0">
<category name="org.eclipse.wst.server.core.serverAdapter"/>
13 years, 5 months
JBoss Tools SVN: r35334 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-04 15:18:59 -0400 (Tue, 04 Oct 2011)
New Revision: 35334
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java
Log:
[JBIDE-9793] implementing Application page (selection, create new, delete selected, etc.)
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java 2011-10-04 19:18:39 UTC (rev 35333)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java 2011-10-04 19:18:59 UTC (rev 35334)
@@ -118,9 +118,9 @@
}
}
- public static void openWizardDialog(IWizard wizard, Shell shell) {
+ public static int openWizardDialog(IWizard wizard, Shell shell) {
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
- dialog.open();
+ return dialog.open();
}
}
13 years, 5 months
JBoss Tools SVN: r35333 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-04 15:18:39 -0400 (Tue, 04 Oct 2011)
New Revision: 35333
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPageModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPageModel.java
Log:
[JBIDE-9793] implementing Application page (selection, create new, delete selected, etc.)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java 2011-10-04 18:20:34 UTC (rev 35332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPage.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -12,30 +12,51 @@
import java.util.Collection;
+import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.databinding.viewers.ViewerSupport;
+import org.eclipse.jface.databinding.viewers.ViewerProperties;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellLabelProvider;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PlatformUI;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
+import org.jboss.tools.common.ui.BrowserUtil;
import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.common.ui.databinding.DataBindingUtils;
/**
* @author André Dietisheim
@@ -46,29 +67,149 @@
private ApplicationWizardPageModel model;
protected ApplicationWizardPage(IWizard wizard, ServerAdapterWizardModel wizardModel) {
- super("Application selection", "Please select an Openshift Express application to use",
+ super("Application selection", "Please select an Openshift Express application",
"Application selection", wizard);
this.model = new ApplicationWizardPageModel(wizardModel);
}
@Override
protected void doCreateControls(Composite container, DataBindingContext dbc) {
- GridLayoutFactory.fillDefaults().numColumns(1).margins(10, 10).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(3).margins(10, 10).spacing(4, 4).applyTo(container);
Group group = new Group(container, SWT.BORDER);
group.setText("Available applications");
- GridDataFactory.fillDefaults().hint(600, 300).applyTo(group);
+ GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).span(3, 1).applyTo(group);
FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
- fillLayout.marginHeight = 10;
- fillLayout.marginWidth = 10;
+ fillLayout.marginHeight = 6;
+ fillLayout.marginWidth = 6;
group.setLayout(fillLayout);
-
- Table table = new Table(group, SWT.BORDER | SWT.V_SCROLL);
+
+ this.viewer = createApplicationTable(group);
+ viewer.addDoubleClickListener(onApplicationDoubleClick());
+
+ Binding selectedApplicationBinding = dbc.bindValue(
+ ViewerProperties.singleSelection().observe(viewer),
+ BeanProperties.value(ApplicationWizardPageModel.PROPERTY_SELECTED_APPLICATION).observe(model),
+ new UpdateValueStrategy().setAfterGetValidator(new IValidator() {
+
+ @Override
+ public IStatus validate(Object value) {
+ if (value != null) {
+ return ValidationStatus.ok();
+ }
+ else {
+ return ValidationStatus.info("You have to select an application...");
+ }
+ }
+ }),
+ null);
+
+ Button newButton = new Button(container, SWT.PUSH);
+ newButton.setText("New");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(newButton);
+ newButton.addSelectionListener(onNew(dbc));
+
+ Button deleteButton = new Button(container, SWT.PUSH);
+ deleteButton.setText("Delete");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(deleteButton);
+ DataBindingUtils.bindButtonEnablementToValidationStatus(deleteButton, dbc, selectedApplicationBinding);
+ deleteButton.addSelectionListener(onDelete(dbc));
+ }
+
+ protected IDoubleClickListener onApplicationDoubleClick() {
+ return new IDoubleClickListener() {
+
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ try {
+ ISelection selection = event.getSelection();
+ if (selection instanceof StructuredSelection) {
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if (firstElement instanceof IApplication) {
+ String url = ((IApplication) firstElement).getApplicationUrl();
+ BrowserUtil.checkedCreateExternalBrowser(url, OpenshiftUIActivator.PLUGIN_ID,
+ OpenshiftUIActivator.getDefault().getLog());
+ }
+ }
+ } catch (OpenshiftException e) {
+ IStatus status = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "Could not open Openshift Express application in browser", e);
+ OpenshiftUIActivator.getDefault().getLog().log(status);
+ }
+ }
+ };
+ }
+
+ protected SelectionAdapter onNew(DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = getContainer().getShell();
+ if (WizardUtils.openWizardDialog(new NewApplicationDialog(model.getUser()), shell)
+ == Dialog.OK) {
+ viewer.refresh();
+ }
+ }
+ };
+ }
+
+ protected TableViewer createApplicationTable(Group group) {
+ Composite tableContainer = new Composite(group, SWT.NONE);
+ Table table = new Table(tableContainer, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLinesVisible(true);
table.setHeaderVisible(true);
- this.viewer = new TableViewer(table);
+ TableColumnLayout tableLayout = new TableColumnLayout();
+ tableContainer.setLayout(tableLayout);
+ TableViewer viewer = new TableViewer(table);
+ viewer.setContentProvider(new ArrayContentProvider());
+
+ createTableColumn("Name", 1, new CellLabelProvider() {
+
+ @Override
+ public void update(ViewerCell cell) {
+ IApplication application = (IApplication) cell.getElement();
+ cell.setText(application.getName());
+ }
+ }, viewer, tableLayout);
+ createTableColumn("URL", 3, new CellLabelProvider() {
+
+ @Override
+ public void update(ViewerCell cell) {
+ try {
+ IApplication application = (IApplication) cell.getElement();
+ cell.setText(application.getApplicationUrl());
+ } catch (OpenshiftException e) {
+ // ignore
+ }
+ }
+ }, viewer, tableLayout);
+ return viewer;
}
+ private void createTableColumn(String name, int weight, CellLabelProvider cellLabelProvider, TableViewer viewer,
+ TableColumnLayout layout) {
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.LEFT);
+ column.getColumn().setText(name);
+ column.setLabelProvider(cellLabelProvider);
+
+ layout.setColumnData(column.getColumn(), new ColumnWeightData(weight, true));
+ }
+
+ private SelectionAdapter onDelete(final DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ WizardUtils.runInWizard(new DeleteApplicationJob(), getWizard().getContainer(), dbc);
+ } catch (Exception ex) {
+ // ignore
+ }
+ }
+ };
+ }
+
@Override
protected void onPageActivated(DataBindingContext dbc) {
try {
@@ -78,18 +219,6 @@
}
}
- protected void bindApplications(final Collection<IApplication> applications, final TableViewer viewer) {
- Display display = PlatformUI.getWorkbench().getDisplay();
- display.syncExec(new Runnable() {
-
- @Override
- public void run() {
- IObservableList input = new WritableList(applications, IApplication.class);
- ViewerSupport.bind(viewer, input, BeanProperties.values(new String[] { "name", "applicationUrl" }));
- }
- });
- }
-
private class LoadApplicationsJob extends Job {
private LoadApplicationsJob() {
super("Loading applications");
@@ -98,7 +227,15 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- bindApplications(model.getApplications(), viewer);
+ final Collection<IApplication> applications = model.getApplications();
+ Display display = PlatformUI.getWorkbench().getDisplay();
+ display.syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.setInput(applications);
+ }
+ });
return Status.OK_STATUS;
} catch (OpenshiftException e) {
return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
@@ -106,4 +243,24 @@
}
}
}
+
+ private class DeleteApplicationJob extends Job {
+
+ public DeleteApplicationJob() {
+ super("Deleteing application");
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ model.destroyCurrentApplication();
+ return Status.OK_STATUS;
+ } catch (OpenshiftException e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, NLS.bind(
+ "Could not delete application \"{0}\"",
+ model.getSelectedApplication().getName()));
+ }
+ }
+
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPageModel.java 2011-10-04 18:20:34 UTC (rev 35332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ApplicationWizardPageModel.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -11,17 +11,22 @@
package org.jboss.ide.eclipse.as.openshift.ui.internal.wizard;
import java.util.Collection;
+import java.util.Collections;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
/**
* @author André Dietisheim
- *
+ *
*/
-public class ApplicationWizardPageModel {
+public class ApplicationWizardPageModel extends ObservableUIPojo {
+ public static final String PROPERTY_SELECTED_APPLICATION = "selectedApplication";
+
+ private IApplication selectedApplication;
private ServerAdapterWizardModel wizardModel;
public ApplicationWizardPageModel(ServerAdapterWizardModel wizardModel) {
@@ -30,7 +35,30 @@
public Collection<IApplication> getApplications() throws OpenshiftException {
IUser user = wizardModel.getUser();
+ if (user == null) {
+ return Collections.emptyList();
+ }
return user.getApplications();
}
+ public IApplication getSelectedApplication() {
+ return selectedApplication;
+ }
+
+ public void setSelectedApplication(IApplication application) {
+ firePropertyChange(PROPERTY_SELECTED_APPLICATION, this.selectedApplication, this.selectedApplication = application);
+ }
+
+ public void destroyCurrentApplication() throws OpenshiftException {
+ if (selectedApplication == null) {
+ return;
+ }
+
+ selectedApplication.destroy();
+ }
+
+ public IUser getUser() {
+ return wizardModel.getUser();
+ }
+
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.openshift.ui.internal.wizard;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.ide.eclipse.as.openshift.core.IUser;
+
+/**
+ * @author André Dietisheim
+ */
+public class NewApplicationDialog extends Wizard {
+
+ private IUser user;
+
+ public NewApplicationDialog(IUser user) {
+ this.user = user;
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public boolean performFinish() {
+ return true;
+ }
+
+ @Override
+ public void addPages() {
+ addPage(new NewApplicationWizardPage(new NewApplicationWizardPageModel(user), this));
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationDialog.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.openshift.ui.internal.wizard;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
+import org.jboss.tools.common.ui.WizardUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class NewApplicationWizardPage extends AbstractOpenshiftWizardPage {
+
+ private static final int NAME_MAXLENGTH = 13;
+
+ private NewApplicationWizardPageModel model;
+
+ public NewApplicationWizardPage(NewApplicationWizardPageModel model, IWizard wizard) {
+ super("Create new Openshift Express application", "Create new Openshift Express application",
+ "Create new Openshift Express application", wizard);
+ this.model = model;
+ }
+
+ @Override
+ protected void doCreateControls(Composite parent, DataBindingContext dbc) {
+ GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).applyTo(parent);
+
+ Label nameLabel = new Label(parent, SWT.NONE);
+ nameLabel.setText("Name");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
+ Text nameText = new Text(parent, SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(nameText);
+
+ Label cartridgeLabel = new Label(parent, SWT.WRAP);
+ cartridgeLabel.setText("Cartridge");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(cartridgeLabel);
+ Combo cartridgesCombo = new Combo(parent, SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(cartridgesCombo);
+ }
+
+ @Override
+ protected void onPageActivated(DataBindingContext dbc) {
+ try {
+ WizardUtils.runInWizard(new Job("Load cartridges") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ model.loadCartridges();
+ } catch (OpenshiftException e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, "Could not load cartridges", e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getContainer());
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ private final class ApplicationNameValidator implements IInputValidator {
+
+ @Override
+ public String isValid(String newText) {
+ if (newText.length() > 0
+ && newText.length() <= NAME_MAXLENGTH) {
+ return null;
+ } else {
+ return "you have to provide a valid application name with less than 13 characters";
+ }
+ }
+ };
+
+}
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.openshift.ui.internal.wizard;
+
+import java.util.Collection;
+
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IUser;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+
+/**
+ * @author André Dietisheim
+ */
+public class NewApplicationWizardPageModel extends ObservableUIPojo {
+
+ private static final String PROPERTY_CARTRIDGES = "cartridges";
+
+ private IUser user;
+ private Collection<ICartridge> cartridges;
+
+ public NewApplicationWizardPageModel(IUser user) {
+ this.user = user;
+ }
+
+ public void loadCartridges() throws OpenshiftException {
+ setCartridges(user.getCartridges());
+ }
+
+ public void setCartridges(Collection<ICartridge> cartridges) {
+ firePropertyChange(PROPERTY_CARTRIDGES, this.cartridges, this.cartridges = cartridges);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewApplicationWizardPageModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java 2011-10-04 18:20:34 UTC (rev 35332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -12,12 +12,17 @@
import java.io.File;
import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.ValidationStatusProvider;
+import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.observable.IObservableCollection;
import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.value.WritableValue;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -37,7 +42,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.IDomain;
import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
import org.jboss.tools.common.ui.BrowserUtil;
import org.jboss.tools.common.ui.WizardUtils;
@@ -94,6 +99,12 @@
.applyTo(createButton);
createButton.addSelectionListener(onCreate(dbc));
DataBindingUtils.bindButtonEnablementToValidationStatus(createButton, dbc);
+
+ dbc.bindValue(
+ new WritableValue(null, IDomain.class)
+ , BeanProperties.value(NewDomainWizardPageModel.PROPERTY_DOMAIN).observe(model)
+ , new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER)
+ , new UpdateValueStrategy().setAfterGetValidator(new DomainCreatedValidator()));
}
private SelectionListener onBrowseSshKey() {
@@ -110,7 +121,6 @@
if (sshKeyPath != null) {
model.setSshKey(sshKeyPath);
}
- ;
}
};
}
@@ -134,7 +144,7 @@
protected IStatus run(IProgressMonitor monitor) {
try {
model.createDomain();
- } catch (OpenshiftException e) {
+ } catch (Exception e) {
return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, NLS.bind(
"Could not create a new domain with the name \"{0}\"",
model.getNamespace()), e);
@@ -174,8 +184,8 @@
if (!model.hasUser()) {
return false;
}
-
- final BlockingQueue<Boolean> queue = new ArrayBlockingQueue<Boolean>(1);
+
+ final ArrayBlockingQueue<Boolean> queue = new ArrayBlockingQueue<Boolean>(1);
try {
WizardUtils.runInWizard(
new Job("Checking presence of domain") {
@@ -188,13 +198,30 @@
queue.offer(false);
return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
"Could not get domain", e);
- }
+ }
return Status.OK_STATUS;
}
}, getWizard().getContainer(), getDatabindingContext());
} catch (Exception ex) {
// ignore
}
- return queue.poll();
+
+ try {
+ return queue.poll(6, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ return false;
+ }
}
+
+ private static class DomainCreatedValidator implements IValidator {
+ @Override
+ public IStatus validate(Object value) {
+ if (value != null) {
+ return ValidationStatus.ok();
+ } else {
+ return ValidationStatus.info("You have to create a domain...");
+ }
+ }
+ };
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPageModel.java 2011-10-04 18:20:34 UTC (rev 35332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPageModel.java 2011-10-04 19:18:39 UTC (rev 35333)
@@ -10,10 +10,14 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.ui.internal.wizard;
+import java.io.File;
+import java.io.IOException;
+
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.SSHPublicKey;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
/**
@@ -23,6 +27,7 @@
public static final String PROPERTY_NAMESPACE = "namespace";
public static final String PROPERTY_SSHKEY = "sshKey";
+ public static final String PROPERTY_DOMAIN = "domain";
private String namespace;
private IDomain domain;
@@ -37,9 +42,10 @@
return this.namespace;
}
- public void createDomain() throws OpenshiftException {
- IUser user = wizardModel.getUser();
- this.domain = user.createDomain(namespace, loadSshKey());
+ public void createDomain() throws OpenshiftException, IOException {
+ IUser user = getUser();
+ IDomain domain = user.createDomain(namespace, loadSshKey());
+ setDomain(domain);
}
public String getSshKey() {
@@ -50,9 +56,8 @@
firePropertyChange(PROPERTY_SSHKEY, this.sshKey, this.sshKey = sshKey);
}
- private ISSHPublicKey loadSshKey() {
- // TODO Auto-generated method stub
- return null;
+ private ISSHPublicKey loadSshKey() throws IOException, OpenshiftException {
+ return new SSHPublicKey(new File(sshKey));
}
public void setNamespace(String namespace) throws OpenshiftException {
@@ -66,21 +71,18 @@
return getUser().hasDomain();
}
- public void loadDomain() throws OpenshiftException {
- if (!hasUser()) {
- return;
- }
- IDomain domain = getUser().getDomain();
- if (domain != null) {
- this.domain = domain;
- setNamespace(domain.getNamespace());
- }
+ public IDomain getDomain() {
+ return domain;
}
+ public void setDomain(IDomain domain) {
+ firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
+ }
+
public boolean hasUser() {
return wizardModel.getUser() != null;
}
-
+
public IUser getUser() {
return wizardModel.getUser();
}
13 years, 5 months
JBoss Tools SVN: r35332 - in trunk: tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-10-04 14:20:34 -0400 (Tue, 04 Oct 2011)
New Revision: 35332
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java 2011-10-04 17:32:29 UTC (rev 35331)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java 2011-10-04 18:20:34 UTC (rev 35332)
@@ -173,11 +173,7 @@
* Test Code Completion functionality for Composite Component
*/
public void testCodeCompletionOfCompositeComponent(){
- eclipse.closeAllEditors();
- createJSF2Project(JSF2_TEST_PROJECT_NAME);
- openPage(JSF2_TEST_PAGE, JSF2_TEST_PROJECT_NAME);
- compositeComponentContainerEditor = SWTTestExt.bot.swtBotEditorExtByTitle(FACELETS_TEST_PAGE);
- origCompositeComponentContainerEditorText = compositeComponentContainerEditor.getText();
+ initJSF2PageTest();
ContentAssistBot contentAssist = compositeComponentContainerEditor.contentAssist();
SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
JSF2_TEST_PAGE,
@@ -262,6 +258,52 @@
compositeComponentDefEditor.save();
}
/**
+ * Test Code Completion functionality for Managed Bean
+ * referenced via @ManagedBean annotation
+ */
+ public void testCodeCompletionOfReferencedManagedBean(){
+ initJSF2PageTest();
+ String textForSelection = "value=\"#{user.name}\"";
+ List<String> expectedProposals = new LinkedList<String>();
+ expectedProposals.add("msgs");
+ expectedProposals.add("user : User");
+ expectedProposals.add("\"#{user.name}\"");
+ expectedProposals.add("applicationScope");
+ expectedProposals.add("cc");
+ expectedProposals.add("component");
+ expectedProposals.add("cookie");
+ expectedProposals.add("facesContext");
+ expectedProposals.add("flash");
+ expectedProposals.add("header");
+ expectedProposals.add("headerValues");
+ expectedProposals.add("initParam");
+ expectedProposals.add("param");
+ expectedProposals.add("paramValues");
+ expectedProposals.add("requestScope");
+ expectedProposals.add("resource");
+ expectedProposals.add("sessionScope");
+ expectedProposals.add("view");
+ expectedProposals.add("viewScope");
+ // Check content assist for #{ prefix
+ ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
+ JSF2_TEST_PAGE,
+ textForSelection,
+ 9,
+ 0,
+ expectedProposals);
+ // Check content assist for ${user. prefix
+ expectedProposals.clear();
+ expectedProposals.add("name : String - User");
+ expectedProposals.add("sayHello() : String - User");
+ expectedProposals.add("\"#{user.name}\"");
+ ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
+ FACELETS_TEST_PAGE,
+ textForSelection,
+ 14,
+ 0,
+ expectedProposals);
+ }
+ /**
* Initialize test which are using facelets test page
*/
private void initFaceletsPageTest() {
@@ -270,6 +312,17 @@
editor = SWTTestExt.bot.swtBotEditorExtByTitle(FACELETS_TEST_PAGE);
originalEditorText = editor.getText();
}
+
+ /**
+ * Initialize test which are using JSF2 test page
+ */
+ private void initJSF2PageTest() {
+ eclipse.closeAllEditors();
+ createJSF2Project(JSF2_TEST_PROJECT_NAME);
+ openPage(JSF2_TEST_PAGE, JSF2_TEST_PROJECT_NAME);
+ compositeComponentContainerEditor = SWTTestExt.bot.swtBotEditorExtByTitle(FACELETS_TEST_PAGE);
+ origCompositeComponentContainerEditorText = compositeComponentContainerEditor.getText();
+ }
/**
* Returns list of expected Content Assist proposals for Input tag
* @return
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java 2011-10-04 17:32:29 UTC (rev 35331)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java 2011-10-04 18:20:34 UTC (rev 35332)
@@ -165,5 +165,33 @@
selectedText.equalsIgnoreCase(expectedSelectedText));
compositeComponentEditor.close();
}
-
+ /**
+ * Test Open On functionality for Referenced Template within JSF2 project
+ */
+ public void testOpenOnForReferencedTemplateJsf2() {
+ eclipse.closeAllEditors();
+ createJSF2Project(JSF2_TEST_PROJECT_NAME);
+ openPage(JSF2_TEST_PAGE,JSF2_TEST_PROJECT_NAME);
+ // Check open on for <ez:input
+ String expectedOpenedFileName = "common.xhtml";
+ SWTBotEditor compositeComponentEditor = OpenOnHelper.checkOpenOnFileIsOpened(
+ SWTTestExt.bot, JSF2_TEST_PAGE, "<ui:composition template=\"/templates/common.xhtml\"", 30,
+ 0, 0, expectedOpenedFileName);
+ compositeComponentEditor.close();
+ }
+
+ /**
+ * Test Open On functionality for Referenced Template within JSF facelets project
+ */
+ public void testOpenOnForReferencedTemplateFacelets() {
+ eclipse.closeAllEditors();
+ openPage(FACELETS_TEST_PAGE,FACELETS_TEST_PROJECT_NAME);
+ // Check open on for <ez:input
+ String expectedOpenedFileName = "common.xhtml";
+ SWTBotEditor compositeComponentEditor = OpenOnHelper.checkOpenOnFileIsOpened(
+ SWTTestExt.bot, FACELETS_TEST_PAGE, "<ui:composition template=\"/templates/common.xhtml\"", 30,
+ 0, 0, expectedOpenedFileName);
+ compositeComponentEditor.close();
+ }
+
}
\ No newline at end of file
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-10-04 17:32:29 UTC (rev 35331)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-10-04 18:20:34 UTC (rev 35332)
@@ -704,4 +704,11 @@
public static final String URL_TEXT_LABEL = "Url:";
}
+
+ public static class WebXmlEditor{
+
+ public static final String SOURCE_TAB_LABEL = "Source";
+ public static final String TREE_TAB_LABEL = "Tree";
+
+ }
}
13 years, 5 months