JBoss Tools SVN: r35612 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-13 07:05:30 -0400 (Thu, 13 Oct 2011)
New Revision: 35612
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
Log:
JBIDE-9793 - NPE when using php cartridge
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-13 09:08:40 UTC (rev 35611)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-13 11:05:30 UTC (rev 35612)
@@ -70,6 +70,9 @@
private IRuntime runtimeDelegate;
private Label domainLabel;
private Label modeLabel;
+ private Link addRuntimeLink;
+ private Label runtimeLabel;
+
public AdapterWizardPage(ImportProjectWizard wizard, ImportProjectWizardModel model) {
super(
@@ -183,9 +186,6 @@
modeLabel.setEnabled(enabled);
}
- private Link addRuntimeLink;
- private Label runtimeLabel;
-
private void fillServerAdapterGroup(Group serverAdapterGroup) {
Composite c = new Composite(serverAdapterGroup, SWT.NONE);
c.setLayout(new FormLayout());
@@ -225,10 +225,11 @@
addRuntimeLink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IRuntimeType type = getValidRuntimeType();
- showRuntimeWizard(type);
+ if( type != null )
+ showRuntimeWizard(type);
}
});
-
+
serverAdapterCheckbox.setLayoutData(UIUtil.createFormData2(0, 5, null, 0, 0, 5, null, 0));
runtimeLabel.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, 0, 5, null, 0));
addRuntimeLink.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, null, 0, 100, -5));
@@ -238,6 +239,8 @@
// 0, 0, 5, 100, 0));
modeLabel.setLayoutData(UIUtil.createFormData2(domainLabel, 5, null, 0, 0, 5, 100, 0));
serverAdapterCheckbox.setSelection(true);
+ model.getParentModel().setProperty(AdapterWizardPageModel.CREATE_SERVER,
+ serverAdapterCheckbox2.getSelection());
}
private void updateSelectedRuntimeDelegate() {
@@ -291,6 +294,9 @@
suitableRuntimes.select(0);
updateSelectedRuntimeDelegate();
}
+ IRuntimeType type = getValidRuntimeType();
+ addRuntimeLink.setEnabled(type != null);
+
try {
domainLabel.setText("Host: " + model.getParentModel().getApplication().getApplicationUrl());
modeLabel.setText("Mode: Source");
@@ -302,8 +308,11 @@
}
protected void refreshValidRuntimes() {
- IRuntime[] runtimes = getRuntimesOfType(getValidRuntimeType().getId());
- fillRuntimeCombo(suitableRuntimes, runtimes);
+ IRuntimeType type = getValidRuntimeType();
+ if( type != null ) {
+ IRuntime[] runtimes = getRuntimesOfType(type.getId());
+ fillRuntimeCombo(suitableRuntimes, runtimes);
+ }
}
/* Stolen from NewManualServerComposite */
13 years, 3 months
JBoss Tools SVN: r35611 - in trunk/central/plugins/org.jboss.tools.central: META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-10-13 05:08:40 -0400 (Thu, 13 Oct 2011)
New Revision: 35611
Added:
trunk/central/plugins/org.jboss.tools.central/lib/
trunk/central/plugins/org.jboss.tools.central/lib/ocpsoft-pretty-time-1.0.7.jar
Modified:
trunk/central/plugins/org.jboss.tools.central/
trunk/central/plugins/org.jboss.tools.central/.classpath
trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF
trunk/central/plugins/org.jboss.tools.central/build.properties
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java
Log:
JBIDE-9838 Make dates pretty + news feed rendering more robust against broken content
Property changes on: trunk/central/plugins/org.jboss.tools.central
___________________________________________________________________
Modified: svn:ignore
- bin
+ bin
bin
Modified: trunk/central/plugins/org.jboss.tools.central/.classpath
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/.classpath 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/.classpath 2011-10-13 09:08:40 UTC (rev 35611)
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/ocpsoft-pretty-time-1.0.7.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF 2011-10-13 09:08:40 UTC (rev 35611)
@@ -29,3 +29,5 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Localization: plugin
Bundle-Vendor: %BundleVendor
+Bundle-ClassPath: lib/ocpsoft-pretty-time-1.0.7.jar,
+ .
Modified: trunk/central/plugins/org.jboss.tools.central/build.properties
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/build.properties 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/build.properties 2011-10-13 09:08:40 UTC (rev 35611)
@@ -10,4 +10,5 @@
about.ini,\
about.mappings,\
about.properties,\
- jboss_about.png
+ jboss_about.png,\
+ lib/ocpsoft-pretty-time-1.0.7.jar
Added: trunk/central/plugins/org.jboss.tools.central/lib/ocpsoft-pretty-time-1.0.7.jar
===================================================================
(Binary files differ)
Property changes on: trunk/central/plugins/org.jboss.tools.central/lib/ocpsoft-pretty-time-1.0.7.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-13 09:08:40 UTC (rev 35611)
@@ -1,431 +1,431 @@
-/*************************************************************************************
- * 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.central;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWebBrowser;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
-import org.eclipse.ui.internal.browser.WebBrowserPreference;
-import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
-import org.eclipse.ui.menus.CommandContributionItem;
-import org.eclipse.ui.menus.CommandContributionItemParameter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.services.IServiceLocator;
-import org.jboss.tools.central.editors.JBossCentralEditor;
-import org.jboss.tools.central.editors.JBossCentralEditorInput;
-import org.jboss.tools.central.model.Tutorial;
-import org.jboss.tools.central.model.TutorialCategory;
-import org.jboss.tools.project.examples.model.Project;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JBossCentralActivator extends AbstractUIPlugin {
-
- public static final String JBOSS_DISCOVERY_DIRECTORY_3_3_0_XML = "http://download.jboss.org/jbosstools/updates/nightly/trunk/directory.xml";
-
- public static final String ICON = "icon";
-
- private static final String DESCRIPTION = "description";
-
- private static final String TUTORIAL = "tutorial";
-
- public static final String CATEGORY_ID = "categoryId";
-
- public static final String REFERENCE = "reference";
-
- public static final String TYPE = "type";
-
- public static final String PRIORITY = "priority";
-
- public static final String ID = "id";
-
- public static final String NAME = "name";
-
- public static final String CATEGORY = "category";
-
- public static final String PROJECT_EXAMPLE_TYPE = "projectExample";
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.central"; //$NON-NLS-1$
-
- public static final String SHOW_JBOSS_CENTRAL_ON_STARTUP = "showJBossCentralOnStartup";
-
- public static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
-
- public static final String PROFILE_ID = "profileId";
-
- public static final String PROFILE_TIMESTAMP = "profileTimestamp";
-
- public static final String JBDS_PRODUCT_PLUGIN_ID = "com.jboss.jbds.product";
-
- public static final String NEW_PROJECT_EXAMPLES_WIZARD_ID = "org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard";
-
- public static final String NEWS_URL = "http://planet.jboss.org/view/all";
-
- public static final String NEWS_ATOM_URL = "http://planet.jboss.org/xml/all?type=atom";
-
- public static final String FORM_END_TAG = "</p></form>";
- public static final String FORM_START_TAG = "<form><p>";
- public static final String CANCELED = FORM_START_TAG + "<span color=\"header\" font=\"header\">Canceled.</span>" + FORM_END_TAG;
- public static final String LOADING = FORM_START_TAG + "<span color=\"header\" font=\"header\">Loading...</span>" + FORM_END_TAG;
-
- public static final String TUTORIALS_EXTENSION_ID = "org.jboss.tools.central.tutorials";
-
- public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
-
- public static final String SEARCH_THE_COMMUNITY = "Search the Community";
-
- public static final String SEARCH_COMMUNITY_PORTAL = "Search Community Portal";
-
- public Map<String, TutorialCategory> tutorialCategories;
-
- private BundleContext bundleContext;
-
- public static final int MAX_FEEDS = 100;
-
- // The shared instance
- private static JBossCentralActivator plugin;
-
- /**
- * The constructor
- */
- public JBossCentralActivator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- this.bundleContext = context;
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- bundleContext = null;
- tutorialCategories = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static JBossCentralActivator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- public IEclipsePreferences getPreferences() {
- IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
- return prefs;
- }
-
- public void savePreferences() {
- IEclipsePreferences prefs = getPreferences();
- try {
- prefs.flush();
- } catch (BackingStoreException e) {
- log(e);
- }
- }
-
- public static void log(Exception e, String message) {
- IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
- plugin.getLog().log(status);
- }
-
- public static void log(Throwable e) {
- IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
- .getLocalizedMessage(), e);
- plugin.getLog().log(status);
- }
-
- public static void log(String message) {
- IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message);
- plugin.getLog().log(status);
- }
-
- public boolean showJBossCentralOnStartup() {
- IEclipsePreferences prefs = JBossCentralActivator.getDefault().getPreferences();
- return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP, SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
- }
-
- public static boolean isJBDS() {
- Bundle bundle = Platform.getBundle(JBDS_PRODUCT_PLUGIN_ID);
- return bundle != null;
- }
-
- public static void openUrl(String location, Shell shell) {
- URL url = null;
- try {
- if (location != null) {
- url = new URL(location);
- }
-
- if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL) {
- IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
- .getBrowserSupport();
- support.getExternalBrowser().openURL(url);
- } else {
- IWebBrowser browser = null;
- int flags;
- if (WorkbenchBrowserSupport.getInstance().isInternalWebBrowserAvailable()) {
- flags = IWorkbenchBrowserSupport.AS_EDITOR
- | IWorkbenchBrowserSupport.LOCATION_BAR
- | IWorkbenchBrowserSupport.NAVIGATION_BAR;
- } else {
- flags = IWorkbenchBrowserSupport.AS_EXTERNAL
- | IWorkbenchBrowserSupport.LOCATION_BAR
- | IWorkbenchBrowserSupport.NAVIGATION_BAR;
- }
-
- String generatedId = JBossCentralActivator.PLUGIN_ID + System.currentTimeMillis();
- browser = WorkbenchBrowserSupport.getInstance().createBrowser(flags, generatedId, null, null);
- browser.openURL(url);
- }
- } catch (PartInitException e) {
- Status status = new Status(IStatus.ERROR,
- JBossCentralActivator.PLUGIN_ID,
- "Browser initialization failed");
- JBossCentralActivator.getDefault().getLog().log(status);
- MessageDialog.openError(shell, "Open Location",
- status.getMessage());
- } catch (MalformedURLException e) {
- Status status = new Status(IStatus.ERROR,
- JBossCentralActivator.PLUGIN_ID, "Invalid URL");
- JBossCentralActivator.getDefault().getLog().log(status);
- MessageDialog.openError(shell, "Open Location",
- status.getMessage());
- }
- }
-
- public Image getImage(ImageDescriptor imageDescriptor) {
- ImageRegistry imageRegistry = getImageRegistry();
- String id = getImageId(imageDescriptor);
- Image image = imageRegistry.get(id);
- if (image == null) {
- image = imageDescriptor.createImage(true);
- imageRegistry.put(id, image);
- }
- return image;
- }
-
- private String getImageId(ImageDescriptor imageDescriptor) {
- return PLUGIN_ID + "/" + imageDescriptor.hashCode();
- }
-
- public static CommandContributionItem createContributionItem(IServiceLocator serviceLocator, String commandId) {
- CommandContributionItemParameter parameter = new CommandContributionItemParameter(
- serviceLocator, commandId, commandId,
- CommandContributionItem.STYLE_PUSH);
- return new CommandContributionItem(parameter);
- }
-
- public static JBossCentralEditor getJBossCentralEditor() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorInput input = JBossCentralEditorInput.INSTANCE;
- try {
- IEditorPart editor = page.openEditor(input, JBossCentralEditor.ID);
- if (editor instanceof JBossCentralEditor) {
- return (JBossCentralEditor) editor;
- }
- } catch (PartInitException e) {
- JBossCentralActivator.log(e);
- }
- return null;
- }
-
- public Map<String, TutorialCategory> getTutorialCategories() {
- if (tutorialCategories == null) {
- tutorialCategories = new HashMap<String, TutorialCategory>();
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry
- .getExtensionPoint(TUTORIALS_EXTENSION_ID);
- IExtension[] extensions = extensionPoint.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IExtension extension = extensions[i];
- IConfigurationElement[] configurationElements = extension
- .getConfigurationElements();
- for (int j = 0; j < configurationElements.length; j++) {
- IConfigurationElement configurationElement = configurationElements[j];
- if (CATEGORY.equals(configurationElement.getName())) {
- String name = configurationElement.getAttribute(NAME);
- String id = configurationElement.getAttribute(ID);
- String priorityString = configurationElement.getAttribute(PRIORITY);
- int priority = Integer.MAX_VALUE;
- if (priorityString != null) {
- try {
- priority = new Integer(priorityString)
- .intValue();
- } catch (NumberFormatException e) {
- log(e);
- }
- }
- TutorialCategory category = new TutorialCategory(id, name, priority);
- tutorialCategories.put(id, category);
- }
- }
- for (int j = 0; j < configurationElements.length; j++) {
- IConfigurationElement configurationElement = configurationElements[j];
- if (TUTORIAL.equals(configurationElement.getName())) {
- String name = configurationElement.getAttribute(NAME);
- String id = configurationElement.getAttribute(ID);
- String type = configurationElement.getAttribute(TYPE);
- String reference = configurationElement.getAttribute(REFERENCE);
- String priorityString = configurationElement.getAttribute(PRIORITY);
- String description = configurationElement.getAttribute(DESCRIPTION);
- String iconPath = configurationElement.getAttribute(ICON);
- int priority = Integer.MAX_VALUE;
- if (priorityString != null) {
- try {
- priority = new Integer(priorityString)
- .intValue();
- } catch (NumberFormatException e) {
- log(e);
- }
- }
- String categoryId = configurationElement.getAttribute(CATEGORY_ID);
- TutorialCategory category = tutorialCategories.get(categoryId);
- if (category == null) {
- log("Invalid tutorial: id=" + id);
- continue;
- }
- Tutorial tutorial = new Tutorial(id, name, type, reference, priority, category, description, iconPath);
- category.getTutorials().add(tutorial);
- }
- }
- }
- List<TutorialCategory> emptyCategories = new ArrayList<TutorialCategory>();
- for (TutorialCategory category:tutorialCategories.values()) {
- if (category.getTutorials().size() == 0) {
- emptyCategories.add(category);
- }
- }
- for (TutorialCategory category:emptyCategories) {
- tutorialCategories.remove(category.getId());
- }
- }
-
- return tutorialCategories;
- }
-
- public Image getImage(String imagePath) {
- ImageRegistry registry = getImageRegistry();
- Image image = registry.get(imagePath);
- if (image != null) {
- return image;
- }
- ImageDescriptor imageDescriptor = getImageDescriptor(imagePath);
- image = imageDescriptor.createImage();
- registry.put(imagePath, image);
- return image;
- }
-
- public void setTutorialCategories(
- Map<String, TutorialCategory> tutorialCategories) {
- this.tutorialCategories = tutorialCategories;
- }
-
- public String getDescription(Tutorial tutorial) {
- String description = tutorial.getDescription();
- Project project = tutorial.getProjectExamples();
- if (project.getDescription() != null) {
- description = project.getDescription();
- }
- StringBuffer buffer = new StringBuffer();
- buffer.append(description);
- buffer.append("\n\n");
- buffer.append("Size: ");
- buffer.append(project.getSizeAsText());
- if (project.getUnsatisfiedFixes().size() > 0) {
- buffer.append("\n\n");
- }
- return buffer.toString();
- }
-
- public static Dictionary<Object, Object> getEnvironment() {
- Dictionary<Object, Object> environment = new Hashtable<Object, Object>(System.getProperties());
- Bundle bundle = Platform.getBundle("org.jboss.tools.central"); //$NON-NLS-1$
- Version version = bundle.getVersion();
- environment.put("org.jboss.tools.central.version", version.toString()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.major", version.getMajor()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.minor", version.getMinor()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
- return environment;
- }
-
- public Object getService(String name) {
- if (bundleContext == null)
- return null;
- ServiceReference<?> reference = bundleContext.getServiceReference(name);
- if (reference == null)
- return null;
- Object result = bundleContext.getService(reference);
- bundleContext.ungetService(reference);
- return result;
- }
-
- public BundleContext getBundleContext() {
- return bundleContext;
- }
-
-}
+/*************************************************************************************
+ * 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.central;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.browser.WebBrowserPreference;
+import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.services.IServiceLocator;
+import org.jboss.tools.central.editors.JBossCentralEditor;
+import org.jboss.tools.central.editors.JBossCentralEditorInput;
+import org.jboss.tools.central.model.Tutorial;
+import org.jboss.tools.central.model.TutorialCategory;
+import org.jboss.tools.project.examples.model.Project;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class JBossCentralActivator extends AbstractUIPlugin {
+
+ public static final String JBOSS_DISCOVERY_DIRECTORY_3_3_0_XML = "http://download.jboss.org/jbosstools/updates/nightly/trunk/directory.xml";
+
+ public static final String ICON = "icon";
+
+ private static final String DESCRIPTION = "description";
+
+ private static final String TUTORIAL = "tutorial";
+
+ public static final String CATEGORY_ID = "categoryId";
+
+ public static final String REFERENCE = "reference";
+
+ public static final String TYPE = "type";
+
+ public static final String PRIORITY = "priority";
+
+ public static final String ID = "id";
+
+ public static final String NAME = "name";
+
+ public static final String CATEGORY = "category";
+
+ public static final String PROJECT_EXAMPLE_TYPE = "projectExample";
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.central"; //$NON-NLS-1$
+
+ public static final String SHOW_JBOSS_CENTRAL_ON_STARTUP = "showJBossCentralOnStartup";
+
+ public static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
+
+ public static final String PROFILE_ID = "profileId";
+
+ public static final String PROFILE_TIMESTAMP = "profileTimestamp";
+
+ public static final String JBDS_PRODUCT_PLUGIN_ID = "com.jboss.jbds.product";
+
+ public static final String NEW_PROJECT_EXAMPLES_WIZARD_ID = "org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard";
+
+ public static final String NEWS_URL = "http://planet.jboss.org/feeds/blogs";
+
+ public static final String NEWS_ATOM_URL = "http://planet.jboss.org/feeds/blogs";
+
+ public static final String FORM_END_TAG = "</p></form>";
+ public static final String FORM_START_TAG = "<form><p>";
+ public static final String CANCELED = FORM_START_TAG + "<span color=\"header\" font=\"header\">Canceled.</span>" + FORM_END_TAG;
+ public static final String LOADING = FORM_START_TAG + "<span color=\"header\" font=\"header\">Loading...</span>" + FORM_END_TAG;
+
+ public static final String TUTORIALS_EXTENSION_ID = "org.jboss.tools.central.tutorials";
+
+ public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
+
+ public static final String SEARCH_THE_COMMUNITY = "Search the Community";
+
+ public static final String SEARCH_COMMUNITY_PORTAL = "Search Community Portal";
+
+ public Map<String, TutorialCategory> tutorialCategories;
+
+ private BundleContext bundleContext;
+
+ public static final int MAX_FEEDS = 100;
+
+ // The shared instance
+ private static JBossCentralActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public JBossCentralActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ this.bundleContext = context;
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ bundleContext = null;
+ tutorialCategories = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static JBossCentralActivator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public IEclipsePreferences getPreferences() {
+ IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
+ return prefs;
+ }
+
+ public void savePreferences() {
+ IEclipsePreferences prefs = getPreferences();
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ log(e);
+ }
+ }
+
+ public static void log(Exception e, String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+ plugin.getLog().log(status);
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ plugin.getLog().log(status);
+ }
+
+ public static void log(String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message);
+ plugin.getLog().log(status);
+ }
+
+ public boolean showJBossCentralOnStartup() {
+ IEclipsePreferences prefs = JBossCentralActivator.getDefault().getPreferences();
+ return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP, SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
+ }
+
+ public static boolean isJBDS() {
+ Bundle bundle = Platform.getBundle(JBDS_PRODUCT_PLUGIN_ID);
+ return bundle != null;
+ }
+
+ public static void openUrl(String location, Shell shell) {
+ URL url = null;
+ try {
+ if (location != null) {
+ url = new URL(location);
+ }
+
+ if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL) {
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ support.getExternalBrowser().openURL(url);
+ } else {
+ IWebBrowser browser = null;
+ int flags;
+ if (WorkbenchBrowserSupport.getInstance().isInternalWebBrowserAvailable()) {
+ flags = IWorkbenchBrowserSupport.AS_EDITOR
+ | IWorkbenchBrowserSupport.LOCATION_BAR
+ | IWorkbenchBrowserSupport.NAVIGATION_BAR;
+ } else {
+ flags = IWorkbenchBrowserSupport.AS_EXTERNAL
+ | IWorkbenchBrowserSupport.LOCATION_BAR
+ | IWorkbenchBrowserSupport.NAVIGATION_BAR;
+ }
+
+ String generatedId = JBossCentralActivator.PLUGIN_ID + System.currentTimeMillis();
+ browser = WorkbenchBrowserSupport.getInstance().createBrowser(flags, generatedId, null, null);
+ browser.openURL(url);
+ }
+ } catch (PartInitException e) {
+ Status status = new Status(IStatus.ERROR,
+ JBossCentralActivator.PLUGIN_ID,
+ "Browser initialization failed");
+ JBossCentralActivator.getDefault().getLog().log(status);
+ MessageDialog.openError(shell, "Open Location",
+ status.getMessage());
+ } catch (MalformedURLException e) {
+ Status status = new Status(IStatus.ERROR,
+ JBossCentralActivator.PLUGIN_ID, "Invalid URL");
+ JBossCentralActivator.getDefault().getLog().log(status);
+ MessageDialog.openError(shell, "Open Location",
+ status.getMessage());
+ }
+ }
+
+ public Image getImage(ImageDescriptor imageDescriptor) {
+ ImageRegistry imageRegistry = getImageRegistry();
+ String id = getImageId(imageDescriptor);
+ Image image = imageRegistry.get(id);
+ if (image == null) {
+ image = imageDescriptor.createImage(true);
+ imageRegistry.put(id, image);
+ }
+ return image;
+ }
+
+ private String getImageId(ImageDescriptor imageDescriptor) {
+ return PLUGIN_ID + "/" + imageDescriptor.hashCode();
+ }
+
+ public static CommandContributionItem createContributionItem(IServiceLocator serviceLocator, String commandId) {
+ CommandContributionItemParameter parameter = new CommandContributionItemParameter(
+ serviceLocator, commandId, commandId,
+ CommandContributionItem.STYLE_PUSH);
+ return new CommandContributionItem(parameter);
+ }
+
+ public static JBossCentralEditor getJBossCentralEditor() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorInput input = JBossCentralEditorInput.INSTANCE;
+ try {
+ IEditorPart editor = page.openEditor(input, JBossCentralEditor.ID);
+ if (editor instanceof JBossCentralEditor) {
+ return (JBossCentralEditor) editor;
+ }
+ } catch (PartInitException e) {
+ JBossCentralActivator.log(e);
+ }
+ return null;
+ }
+
+ public Map<String, TutorialCategory> getTutorialCategories() {
+ if (tutorialCategories == null) {
+ tutorialCategories = new HashMap<String, TutorialCategory>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint = registry
+ .getExtensionPoint(TUTORIALS_EXTENSION_ID);
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ IExtension extension = extensions[i];
+ IConfigurationElement[] configurationElements = extension
+ .getConfigurationElements();
+ for (int j = 0; j < configurationElements.length; j++) {
+ IConfigurationElement configurationElement = configurationElements[j];
+ if (CATEGORY.equals(configurationElement.getName())) {
+ String name = configurationElement.getAttribute(NAME);
+ String id = configurationElement.getAttribute(ID);
+ String priorityString = configurationElement.getAttribute(PRIORITY);
+ int priority = Integer.MAX_VALUE;
+ if (priorityString != null) {
+ try {
+ priority = new Integer(priorityString)
+ .intValue();
+ } catch (NumberFormatException e) {
+ log(e);
+ }
+ }
+ TutorialCategory category = new TutorialCategory(id, name, priority);
+ tutorialCategories.put(id, category);
+ }
+ }
+ for (int j = 0; j < configurationElements.length; j++) {
+ IConfigurationElement configurationElement = configurationElements[j];
+ if (TUTORIAL.equals(configurationElement.getName())) {
+ String name = configurationElement.getAttribute(NAME);
+ String id = configurationElement.getAttribute(ID);
+ String type = configurationElement.getAttribute(TYPE);
+ String reference = configurationElement.getAttribute(REFERENCE);
+ String priorityString = configurationElement.getAttribute(PRIORITY);
+ String description = configurationElement.getAttribute(DESCRIPTION);
+ String iconPath = configurationElement.getAttribute(ICON);
+ int priority = Integer.MAX_VALUE;
+ if (priorityString != null) {
+ try {
+ priority = new Integer(priorityString)
+ .intValue();
+ } catch (NumberFormatException e) {
+ log(e);
+ }
+ }
+ String categoryId = configurationElement.getAttribute(CATEGORY_ID);
+ TutorialCategory category = tutorialCategories.get(categoryId);
+ if (category == null) {
+ log("Invalid tutorial: id=" + id);
+ continue;
+ }
+ Tutorial tutorial = new Tutorial(id, name, type, reference, priority, category, description, iconPath);
+ category.getTutorials().add(tutorial);
+ }
+ }
+ }
+ List<TutorialCategory> emptyCategories = new ArrayList<TutorialCategory>();
+ for (TutorialCategory category:tutorialCategories.values()) {
+ if (category.getTutorials().size() == 0) {
+ emptyCategories.add(category);
+ }
+ }
+ for (TutorialCategory category:emptyCategories) {
+ tutorialCategories.remove(category.getId());
+ }
+ }
+
+ return tutorialCategories;
+ }
+
+ public Image getImage(String imagePath) {
+ ImageRegistry registry = getImageRegistry();
+ Image image = registry.get(imagePath);
+ if (image != null) {
+ return image;
+ }
+ ImageDescriptor imageDescriptor = getImageDescriptor(imagePath);
+ image = imageDescriptor.createImage();
+ registry.put(imagePath, image);
+ return image;
+ }
+
+ public void setTutorialCategories(
+ Map<String, TutorialCategory> tutorialCategories) {
+ this.tutorialCategories = tutorialCategories;
+ }
+
+ public String getDescription(Tutorial tutorial) {
+ String description = tutorial.getDescription();
+ Project project = tutorial.getProjectExamples();
+ if (project.getDescription() != null) {
+ description = project.getDescription();
+ }
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(description);
+ buffer.append("\n\n");
+ buffer.append("Size: ");
+ buffer.append(project.getSizeAsText());
+ if (project.getUnsatisfiedFixes().size() > 0) {
+ buffer.append("\n\n");
+ }
+ return buffer.toString();
+ }
+
+ public static Dictionary<Object, Object> getEnvironment() {
+ Dictionary<Object, Object> environment = new Hashtable<Object, Object>(System.getProperties());
+ Bundle bundle = Platform.getBundle("org.jboss.tools.central"); //$NON-NLS-1$
+ Version version = bundle.getVersion();
+ environment.put("org.jboss.tools.central.version", version.toString()); //$NON-NLS-1$
+ environment.put("org.jboss.tools.central.version.major", version.getMajor()); //$NON-NLS-1$
+ environment.put("org.jboss.tools.central.version.minor", version.getMinor()); //$NON-NLS-1$
+ environment.put("org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
+ return environment;
+ }
+
+ public Object getService(String name) {
+ if (bundleContext == null)
+ return null;
+ ServiceReference<?> reference = bundleContext.getServiceReference(name);
+ if (reference == null)
+ return null;
+ Object result = bundleContext.getService(reference);
+ bundleContext.ungetService(reference);
+ return result;
+ }
+
+ public BundleContext getBundleContext() {
+ return bundleContext;
+ }
+
+}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-13 09:08:40 UTC (rev 35611)
@@ -45,6 +45,7 @@
import org.eclipse.jface.window.ToolTip;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ControlAdapter;
@@ -805,10 +806,21 @@
td.indent = 2;
Point size = newsComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
td.maxWidth = size.x - 2;
- formText.setText(text, true, true);
- //Display display = Display.getCurrent();
+ try {
+ // to avoid illegal argumentexception on formtext fields.
+ // we replace the HTML entity with the standard xml version
+ // TODO: should probably be done earlier on but couldn't find where.
+ text = text.replaceAll(" ", " ");
+
+ formText.setText(text, true, true);
+ } catch(IllegalArgumentException se) {
+ formText.setText("Problem rendering entry - " + se.getMessage(),false,false);
+ }
+ //Display display = Display.getCurrent();
//formText.setFont(getLinkFont(display));
formText.setFont("default", JFaceResources.getDefaultFont());
+ formText.setFont("date", JFaceResources.getDefaultFont());
+ formText.setColor("date", JFaceColors.getHyperlinkText(getDisplay()));
//formText.setForeground(JFaceColors.getHyperlinkText(getDisplay()));
formText.setFont("description", JFaceResources.getDefaultFont());
//Font boldFont = getAuthorFont(display);
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-10-13 09:08:40 UTC (rev 35611)
@@ -129,12 +129,12 @@
}
setPageImage(index, gettingStartedImage);
- softwarePage = new SoftwarePage(this);
+ /*softwarePage = new SoftwarePage(this);
index = addPage(softwarePage);
if (softwareImage == null) {
softwareImage = JBossCentralActivator.getImageDescriptor("/icons/software.png").createImage();
}
- setPageImage(index, softwareImage);
+ setPageImage(index, softwareImage);*/
} catch (PartInitException e) {
JBossCentralActivator.log(e, "Error adding page");
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java 2011-10-13 09:08:40 UTC (rev 35611)
@@ -24,11 +24,14 @@
private List<NewsEntry> entries = new ArrayList<NewsEntry>();
private Exception exception;
- public static RefreshNewsJob INSTANCE = new RefreshNewsJob();
+ public static RefreshNewsJob INSTANCE = new RefreshNewsJob(JBossCentralActivator.NEWS_ATOM_URL);
- private RefreshNewsJob() {
+ private String newsurl;
+
+ private RefreshNewsJob(String newsurl) {
super("Refreshing JBoss News...");
setPriority(LONG);
+ this.newsurl=newsurl;
}
@Override
@@ -40,7 +43,7 @@
SyndFeedInput input = new SyndFeedInput();
URL url;
try {
- url = new URL(JBossCentralActivator.NEWS_ATOM_URL);
+ url = new URL(newsurl);
} catch (MalformedURLException e) {
exception = e;
return Status.CANCEL_STATUS;
@@ -110,6 +113,8 @@
}
}
}
+
+
Date date;
if (entry.getUpdatedDate() != null) {
date = entry.getUpdatedDate();
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java 2011-10-13 08:04:07 UTC (rev 35610)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java 2011-10-13 09:08:40 UTC (rev 35611)
@@ -5,6 +5,8 @@
import org.apache.commons.lang.StringEscapeUtils;
import org.jboss.tools.central.JBossCentralActivator;
+import com.ocpsoft.pretty.time.PrettyTime;
+
public class NewsEntry {
private String title;
private String link;
@@ -81,12 +83,15 @@
boolean cr = false;
if (date != null) {
buffer.append("<span font=\"default\">");
- buffer.append("posted on ");
- buffer.append(date);
+ buffer.append("posted ");
buffer.append("</span>");
+ buffer.append("<b>");
+ PrettyTime prettyTime = new PrettyTime(new Date());
+ buffer.append(" " + prettyTime.format(date));
+ buffer.append("</b>");
cr = true;
}
- if (author != null && !author.isEmpty()) {
+ if (author != null && !author.isEmpty() && !"(author unknown)".equalsIgnoreCase(author)) {
buffer.append(" ");
buffer.append("<span font=\"default\">");
buffer.append(" by");
13 years, 3 months
JBoss Tools SVN: r35610 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-13 04:04:07 -0400 (Thu, 13 Oct 2011)
New Revision: 35610
Removed:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
[JBIDE-9793] removed deprecated class ServerAdapterWizardModel and merged it's changes to the new class ImportProjectWizardModel
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13 07:56:35 UTC (rev 35609)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13 08:04:07 UTC (rev 35610)
@@ -97,7 +97,7 @@
public void setApplication(IApplication application) {
dataModel.put(APPLICATION, application);
}
-
+
public void importProject(final File projectFolder, IProgressMonitor monitor) throws OpenshiftException,
CoreException,
InterruptedException {
@@ -137,7 +137,7 @@
}
private void connectToGitRepo(IProject project, File gitFolder, IProgressMonitor monitor) throws CoreException {
- new ConnectProviderOperation(project).execute(monitor);
+ new ConnectProviderOperation(project, gitFolder).execute(monitor);
}
public File cloneRepository(IProgressMonitor monitor) throws URISyntaxException, OpenshiftException,
@@ -159,7 +159,7 @@
ensureEgitUIIsStarted();
URIish gitUri = new URIish(uri);
RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil();
-
+
CloneOperation cloneOperation =
new CloneOperation(gitUri, true, null, destination, Constants.HEAD, "origin", CLONE_TIMEOUT);
cloneOperation.run(monitor);
Deleted: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-13 07:56:35 UTC (rev 35609)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-13 08:04:07 UTC (rev 35610)
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * 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.wizard;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.HashMap;
-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.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.egit.core.op.CloneOperation;
-import org.eclipse.egit.core.op.ConnectProviderOperation;
-import org.eclipse.egit.ui.Activator;
-import org.eclipse.jgit.api.Git;
-import org.eclipse.jgit.api.InitCommand;
-import org.eclipse.jgit.api.errors.CheckoutConflictException;
-import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
-import org.eclipse.jgit.api.errors.InvalidMergeHeadsException;
-import org.eclipse.jgit.api.errors.NoHeadException;
-import org.eclipse.jgit.api.errors.NoMessageException;
-import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
-import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.merge.MergeStrategy;
-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.IServerType;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
-import org.jboss.tools.openshift.express.client.IApplication;
-import org.jboss.tools.openshift.express.client.IUser;
-import org.jboss.tools.openshift.express.client.OpenshiftException;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.GeneralProjectImportOperation;
-import org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.MavenProjectImportOperation;
-
-/**
- * @author André Dietisheim <adietish(a)redhat.com>
- */
-public class ServerAdapterWizardModel extends ObservableUIPojo {
-
- private HashMap<String, Object> dataModel = new HashMap<String, Object>();
-
- private static final String USER = "user";
- private static final String APPLICATION = "application";
-
- public void setProperty(String key, Object value) {
- dataModel.put(key, value);
- }
-
- public Object getProperty(String key) {
- return dataModel.get(key);
- }
-
- public void setUser(IUser user) {
- dataModel.put(USER, user);
- }
-
- public IUser getUser() {
- return (IUser) dataModel.get(USER);
- }
-
- public IApplication getApplication() {
- return (IApplication)dataModel.get(APPLICATION);
- }
-
- public void setApplication(IApplication application) {
- dataModel.put(APPLICATION, application);
- }
-
- public void importProject(File projectFolder, IProgressMonitor monitor) throws OpenshiftException, CoreException, InterruptedException {
- MavenProjectImportOperation mavenImport = new MavenProjectImportOperation(projectFolder);
- List<IProject> importedProjects = Collections.emptyList();
- if (mavenImport.isMavenProject()) {
- importedProjects = mavenImport.importToWorkspace(monitor);
- } else {
- importedProjects = new GeneralProjectImportOperation(projectFolder).importToWorkspace(monitor);
- }
-
- connectToGitRepo(importedProjects, monitor);
-
- createServerAdapterIfRequired();
- }
-
- private void connectToGitRepo(List<IProject> projects, IProgressMonitor monitor) throws CoreException {
- for (IProject project : projects) {
- connectToGitRepo(project, monitor);
- }
- }
-
- private void connectToGitRepo(IProject project, IProgressMonitor monitor) throws CoreException {
- new ConnectProviderOperation(project).execute(monitor);
- }
-
- public File cloneRepository(IProgressMonitor monitor) throws URISyntaxException, OpenshiftException,
- InvocationTargetException,
- InterruptedException {
- File destination = getDestinationDirectory(getApplication());
- cloneRepository(getApplication().getGitUri(), destination, monitor);
- return destination;
- }
-
- private void cloneRepository(String uri, File destination, IProgressMonitor monitor) throws URISyntaxException,
- OpenshiftException,
- InvocationTargetException,
- InterruptedException {
- if (destination.exists()) {
- FileUtil.completeDelete(destination);
- }
- URIish gitUri = new URIish(uri);
- CloneOperation cloneOperation =
- new CloneOperation(gitUri, true, null, destination, Constants.HEAD, "origin", 10 * 1024);
- cloneOperation.run(null);
- File gitDirectory = new File(destination, Constants.DOT_GIT);
- Activator.getDefault().getRepositoryUtil().addConfiguredRepository(gitDirectory);
- }
-
- private File getDestinationDirectory(IApplication application) {
- String applicationDirectory = "openshift-" + application.getName();
- // File workspace =
- // ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
- String userHome = System.getProperty("java.io.tmpdir");
- // File workDir = new File(workspace, applicationWorkingdir);
- return new File(userHome, applicationDirectory);
- }
-
- private void mergeWithRemote(Git git, String remoteName) throws CoreException, NoHeadException,
- ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException,
- WrongRepositoryStateException, NoMessageException, IOException {
- Repository repository = git.getRepository();
- ObjectId objectId = repository.resolve("HEAD");
- git.merge().include(objectId).setStrategy(MergeStrategy.OURS).call();
- }
-
- private void createServerAdapterIfRequired() {
- // TODO
- Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
- if( b != null && b.booleanValue() ) {
- IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
- IRuntime rt = (IRuntime)getProperty(AdapterWizardPageModel.RUNTIME_DELEGATE);
- String mode = (String)getProperty(AdapterWizardPageModel.MODE);
-
- try {
- IServer server = ExpressServerUtils.createServer(rt, type, "Openshift Server1");
- ExpressServerUtils.fillServerWithOpenshiftDetails(server, getApplication().getApplicationUrl(),
- getUser().getRhlogin(), getUser().getPassword(),
- getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
- } catch(CoreException ce) {
- OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
- } catch( OpenshiftException ose) {
- IStatus s = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, "Cannot create openshift server adapter", ose);
- OpenshiftUIActivator.getDefault().getLog().log(s);
- }
- }
- }
-
- private Git createGit(File repositoryFile) throws IOException {
- InitCommand init = Git.init();
- init.setDirectory(repositoryFile);
- init.setBare(false);
- return init.call();
- }
-
- private File createRepositoryFile(String name) {
- IPath workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- IPath gitRepoProject = workspace.append(name);
- File repositoryFile = new File(gitRepoProject.toFile(), Constants.DOT_GIT);
- return repositoryFile;
- }
-
-}
13 years, 3 months
JBoss Tools SVN: r35609 - trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-10-13 03:56:35 -0400 (Thu, 13 Oct 2011)
New Revision: 35609
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java
Log:
JBIDE-9882: Forge does not start on XP
Modified: trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java 2011-10-13 07:54:52 UTC (rev 35608)
+++ trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java 2011-10-13 07:56:35 UTC (rev 35609)
@@ -94,31 +94,27 @@
}
private static String createJBossModulesPathArgument(String location) {
- StringBuffer buffer = new StringBuffer("-modulepath ");
+ StringBuffer buffer = new StringBuffer();
buffer.append(getMainModulesLocation(location)).append(File.pathSeparator);
buffer.append(getUserModulesLocation()).append(File.pathSeparator);
buffer.append(getExtraModulesLocation());
- return buffer.toString();
+ return "-modulepath " + encloseWithDoubleQuotesIfNeeded(buffer.toString());
}
- private static String encloseWithDoubleQuotes(String str) {
- return "\"" + str + "\"";
+ private static String encloseWithDoubleQuotesIfNeeded(String str) {
+ if (str.contains(" ")) {
+ return "\"" + str + "\"";
+ } else {
+ return str;
+ }
}
private static String getMainModulesLocation(String location) {
- String result = location + "/modules";
- if (result.contains(" ")) {
- result = encloseWithDoubleQuotes(result);
- }
- return result;
+ return location + "/modules";
}
private static String getUserModulesLocation() {
- String result = System.getProperty("user.home") + "/.forge/plugins";
- if (result.contains(" ")) {
- result = encloseWithDoubleQuotes(result);
- }
- return result;
+ return System.getProperty("user.home") + "/.forge/plugins";
}
private static String getExtraModulesLocation() {
@@ -128,19 +124,20 @@
} catch (IOException e) {
ForgeCorePlugin.log(new RuntimeException("Problem while obtaining location of extra runtime classes.", e));
}
- if (result.contains(" ")) {
- result = encloseWithDoubleQuotes(result);
- }
return result;
}
private static String createVmArguments(String location) {
StringBuffer buffer = new StringBuffer();
- buffer.append("-Dforge.home=").append(location).append(' ');
+ buffer.append("-Dforge.home=").append(encloseWithDoubleQuotesIfNeeded(location)).append(' ');
buffer.append("-Dforge.shell.colorEnabled=true").append(' ');
buffer.append("-Dforge.compatibility.IDE=true").append(' ');
- buffer.append("-cp ").append(location).append("/jboss-modules.jar ");
+ buffer.append(getClassPathArgument(location));
return buffer.toString();
}
+ private static String getClassPathArgument(String location) {
+ return "-cp " + encloseWithDoubleQuotesIfNeeded(location + "/jboss-modules.jar");
+ }
+
}
13 years, 3 months
JBoss Tools SVN: r35608 - in trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal: ui/behaviour and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-13 03:54:52 -0400 (Thu, 13 Oct 2011)
New Revision: 35608
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
JBIDE-9793 - trying to synch with andre, keep clobbering each other
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-13 06:09:42 UTC (rev 35607)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-13 07:54:52 UTC (rev 35608)
@@ -31,6 +31,13 @@
return attributes.getAttribute(ATTRIBUTE_EXPRESS_MODE, EXPRESS_SOURCE_MODE);
}
+ public static String getExpressModeAsString(IServerAttributes attributes) {
+ String mode = getExpressMode(attributes);
+ if( mode.equals(EXPRESS_SOURCE_MODE))
+ return "Source";
+ return "Binary";
+ }
+
public static IServer setExpressMode(IServer server, String val) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, val);
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java 2011-10-13 06:09:42 UTC (rev 35607)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java 2011-10-13 07:54:52 UTC (rev 35608)
@@ -41,7 +41,7 @@
userText = new Text(composite, SWT.BORDER);
Label passLabel = new Label(composite, SWT.NONE);
passLabel.setText("Openshift Password:");
- passText = new Text(composite, SWT.BORDER);
+ passText = new Text(composite, SWT.BORDER | SWT.PASSWORD);
Label domainLabel = new Label(composite, SWT.NONE);
domainLabel.setText("Domain: " + ExpressServerUtils.getExpressDomain(callback.getServer()));
@@ -49,14 +49,17 @@
appLabel.setText("App: " + ExpressServerUtils.getExpressApplication(callback.getServer()));
Label modeLabel = new Label(composite, SWT.NONE);
- modeLabel.setText("Mode:");
+ modeLabel.setText("Mode: " + ExpressServerUtils.getExpressModeAsString(callback.getServer()));
+ userText.setText(ExpressServerUtils.getExpressUsername(callback.getServer()));
+ passText.setText(ExpressServerUtils.getExpressPassword(callback.getServer()));
+
// Maybe just make this a label ??
- modeCombo = new Combo(composite, SWT.READ_ONLY);
- modeCombo.setItems(new String[]{
- "Source", "Binary"
- });
- modeCombo.select(0);
+// modeCombo = new Combo(composite, SWT.READ_ONLY);
+// modeCombo.setItems(new String[]{
+// "Source", "Binary"
+// });
+// modeCombo.select(0);
nameLabel.setLayoutData(UIUtil.createFormData2(0, 5,null,0,0,5,null,0));
userText.setLayoutData(UIUtil.createFormData2(0,3,null,0,nameLabel,5,100,-5));
@@ -67,7 +70,7 @@
domainLabel.setLayoutData(UIUtil.createFormData2(passText,5,null,0,0,5,null,0));
appLabel.setLayoutData(UIUtil.createFormData2(domainLabel,5,null,0,0,5,null,0));
modeLabel.setLayoutData(UIUtil.createFormData2(appLabel,5,null,0,0,5,null,0));
- modeCombo.setLayoutData(UIUtil.createFormData2(appLabel,3,null,0,modeLabel,5,100,-5));
+// modeCombo.setLayoutData(UIUtil.createFormData2(appLabel,3,null,0,modeLabel,5,100,-5));
}
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-13 06:09:42 UTC (rev 35607)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-13 07:54:52 UTC (rev 35608)
@@ -52,7 +52,6 @@
import org.eclipse.wst.server.core.TaskModel;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.wizard.TaskWizard;
import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
@@ -178,8 +177,15 @@
protected void enableServerWidgets(boolean enabled) {
suitableRuntimes.setEnabled(enabled);
+ runtimeLabel.setEnabled(enabled);
+ addRuntimeLink.setEnabled(enabled);
+ domainLabel.setEnabled(enabled);
+ modeLabel.setEnabled(enabled);
}
+ private Link addRuntimeLink;
+ private Label runtimeLabel;
+
private void fillServerAdapterGroup(Group serverAdapterGroup) {
Composite c = new Composite(serverAdapterGroup, SWT.NONE);
c.setLayout(new FormLayout());
@@ -197,12 +203,12 @@
}
});
- Label l = new Label(c, SWT.BORDER);
- l.setText("Local Runtime: ");
+ runtimeLabel = new Label(c, SWT.BORDER);
+ runtimeLabel.setText("Local Runtime: ");
suitableRuntimes = new Combo(c, SWT.READ_ONLY);
- Link addRuntime = new Link(c, SWT.NONE);
- addRuntime.setText("<a>" + Messages.addRuntime + "</a>");
+ addRuntimeLink = new Link(c, SWT.NONE);
+ addRuntimeLink.setText("<a>" + Messages.addRuntime + "</a>");
domainLabel = new Label(c, SWT.NONE);
// appLabel = new Label(c, SWT.NONE);
@@ -216,7 +222,7 @@
public void widgetDefaultSelected(SelectionEvent e) {
}
});
- addRuntime.addSelectionListener(new SelectionAdapter() {
+ addRuntimeLink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IRuntimeType type = getValidRuntimeType();
showRuntimeWizard(type);
@@ -224,14 +230,14 @@
});
serverAdapterCheckbox.setLayoutData(UIUtil.createFormData2(0, 5, null, 0, 0, 5, null, 0));
- l.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, 0, 5, null, 0));
- addRuntime.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, null, 0, 100, -5));
- suitableRuntimes.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, l, 5, addRuntime, -5));
+ runtimeLabel.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, 0, 5, null, 0));
+ addRuntimeLink.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, null, 0, 100, -5));
+ suitableRuntimes.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, runtimeLabel, 5, addRuntimeLink, -5));
domainLabel.setLayoutData(UIUtil.createFormData2(suitableRuntimes, 5, null, 0, 0, 5, 100, 0));
// appLabel.setLayoutData(UIUtil.createFormData2(domainLabel, 5, null,
// 0, 0, 5, 100, 0));
modeLabel.setLayoutData(UIUtil.createFormData2(domainLabel, 5, null, 0, 0, 5, 100, 0));
-
+ serverAdapterCheckbox.setSelection(true);
}
private void updateSelectedRuntimeDelegate() {
@@ -312,9 +318,7 @@
IRuntimeWorkingCopy runtimeWorkingCopy = runtimeType.createRuntime(null, null);
taskModel.putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy);
} catch (CoreException ce) {
- if (Trace.SEVERE) {
- Trace.trace(Trace.STRING_SEVERE, "Error creating runtime", ce);
- }
+ OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
return Window.CANCEL;
}
fragment = new WizardFragment() {
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13 06:09:42 UTC (rev 35607)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13 07:54:52 UTC (rev 35608)
@@ -31,11 +31,15 @@
import org.eclipse.jgit.transport.JschConfigSessionFactory;
import org.eclipse.jgit.transport.URIish;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.GeneralProjectImportOperation;
import org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.MavenProjectImportOperation;
@@ -185,5 +189,23 @@
private void createServerAdapterIfRequired() {
// TODO
+ Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
+ if( b != null && b.booleanValue() ) {
+ IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
+ IRuntime rt = (IRuntime)getProperty(AdapterWizardPageModel.RUNTIME_DELEGATE);
+ String mode = (String)getProperty(AdapterWizardPageModel.MODE);
+
+ try {
+ IServer server = ExpressServerUtils.createServer(rt, type, "Openshift Server1");
+ ExpressServerUtils.fillServerWithOpenshiftDetails(server, getApplication().getApplicationUrl(),
+ getUser().getRhlogin(), getUser().getPassword(),
+ getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
+ } catch(CoreException ce) {
+ OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
+ } catch( OpenshiftException ose) {
+ IStatus s = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, "Cannot create openshift server adapter", ose);
+ OpenshiftUIActivator.getDefault().getLog().log(s);
+ }
+ }
}
}
13 years, 3 months
JBoss Tools SVN: r35606 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-13 02:02:03 -0400 (Thu, 13 Oct 2011)
New Revision: 35606
Modified:
trunk/build/aggregate/site/build.xml
Log:
when adding web content to update site, include directory.xml as well; add -Dcollect.zips.skip override to make testing easier
Modified: trunk/build/aggregate/site/build.xml
===================================================================
--- trunk/build/aggregate/site/build.xml 2011-10-13 06:01:56 UTC (rev 35605)
+++ trunk/build/aggregate/site/build.xml 2011-10-13 06:02:03 UTC (rev 35606)
@@ -475,8 +475,21 @@
</filterchain>
</copy>
+ <!-- get filename matching org.jboss.tools.central.discovery_1.0.0.v20111013-0511-M4.jar, then generate replacement directory.xml file -->
+ <path id="central.discovery.jar.id">
+ <fileset dir="${update.site.source.dir}/plugins">
+ <include name="org.jboss.tools.central.discovery_*.jar"/>
+ </fileset>
+ </path>
+ <property name="central.discovery.path" refid="central.discovery.jar.id"/>
+ <basename property="central.discovery.jar" file="${central.discovery.path}"/>
+ <echo file="${output.dir}/directory.xml"><?xml version='1.0' encoding='UTF-8'?>
+<directory xmlns="http://www.eclipse.org/mylyn/discovery/directory/">
+<entry url="${jbosstools-nightly}plugins/${central.discovery.jar}" permitCategories="true"/>
+</directory>
+</echo>
<copy todir="${update.site.source.dir}">
- <fileset dir="${output.dir}" includes="index.html, **/*.css, README*" />
+ <fileset dir="${output.dir}" includes="index.html, **/*.css, README*, directory.xml" />
</copy>
</target>
@@ -494,7 +507,7 @@
<!-- look for http://download.jboss.org/jbosstools/builds/staging/jbosstools-3.*/logs/z...;
if found, load file and use ${ALL_ZIPS} to get list of relative path zips to fetch -->
- <target name="collect.zips" description="collect zips from the sites we aggregated">
+ <target name="collect.zips" description="collect zips from the sites we aggregated" unless="collect.zips.skip">
<property name="aggregate.zips.dir" value="${output.dir}/zips" />
<delete dir="${aggregate.zips.dir}" quiet="true" />
<mkdir dir="${aggregate.zips.dir}" />
13 years, 3 months
JBoss Tools SVN: r35604 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-13 02:01:47 -0400 (Thu, 13 Oct 2011)
New Revision: 35604
Modified:
trunk/build/aggregate/site/site.xsl
Log:
add link to directory.xml
Modified: trunk/build/aggregate/site/site.xsl
===================================================================
--- trunk/build/aggregate/site/site.xsl 2011-10-13 06:01:40 UTC (rev 35603)
+++ trunk/build/aggregate/site/site.xsl 2011-10-13 06:01:47 UTC (rev 35604)
@@ -119,6 +119,8 @@
<a href="features/" style="font-size:x-small">features</a>
</td>
<td class="rowLine" colspan="1">
+ ::
+ <a href="directory.xml" style="font-size:x-small">directory.xml</a>
</td>
</tr>
</table>
13 years, 3 months