JBoss Tools SVN: r36194 - in trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui: src/org/jboss/tools/common/jdt/debug/ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-11-07 10:40:28 -0500 (Mon, 07 Nov 2011)
New Revision: 36194
Modified:
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java
Log:
JBIDE-9658 jboss remote launch debug have a badly/noninformative preference on launch configuration + error in logs
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml 2011-11-07 15:14:28 UTC (rev 36193)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml 2011-11-07 15:40:28 UTC (rev 36194)
@@ -2,6 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
+ <!--
<extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
type="org.eclipse.jdt.launching.remoteJavaApplication"
@@ -10,7 +11,7 @@
id="org.jboss.tools.common.jdt.debug.ui.launching.launchConfigurationTabGroup.JBossRemoteJavaApplication2">
</launchConfigurationTabGroup>
</extension>
- <!--
+
<extension
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java 2011-11-07 15:14:28 UTC (rev 36193)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java 2011-11-07 15:40:28 UTC (rev 36194)
@@ -25,6 +25,7 @@
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.IPersistableSourceLocator;
@@ -68,6 +69,7 @@
private static final String KEY_SEQUENCE_PREFIX = "M1+D ";
public static final String DISCOVER_REMOTE_APPLICATION_ACTION_ID = "org.jboss.tools.common.jdt.debug.ui.discover";
+ public static final String REMOTE_DEBUG_PREFERENCE_PAGE_ID = "org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebugPreferencePage";
// The shared instance
private static RemoteDebugUIActivator plugin;
private static VmModel[] vmModels;
@@ -338,4 +340,15 @@
}
return null;
}
+
+ public static ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ public static ILaunchConfigurationType getRemoteJavaApplicationConfigurationType() {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager
+ .getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
+ return type;
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java 2011-11-07 15:14:28 UTC (rev 36193)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java 2011-11-07 15:40:28 UTC (rev 36194)
@@ -141,7 +141,7 @@
setAttribute(wc);
wc.doSave();
} else {
- ILaunchConfigurationType configType = getConfigurationType();
+ ILaunchConfigurationType configType = RemoteDebugUIActivator.getRemoteJavaApplicationConfigurationType();
wc = RemoteDebugActivator.createNewLaunchConfiguration(configType);
}
if (javaProject != null && javaProject.isOpen()) {
@@ -179,15 +179,4 @@
attrMap);
}
- private ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- private ILaunchConfigurationType getConfigurationType() {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType type = manager
- .getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
- return type;
- }
-
}
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java 2011-11-07 15:14:28 UTC (rev 36193)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java 2011-11-07 15:40:28 UTC (rev 36194)
@@ -8,6 +8,7 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnLayoutData;
import org.eclipse.jface.viewers.ColumnWeightData;
@@ -29,6 +30,8 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog;
import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
import org.jboss.tools.common.jdt.debug.VmModel;
import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
@@ -296,7 +299,13 @@
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.YES_ID) {
- new LaunchDialogAction().run();
+ //new LaunchDialogAction().run();
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell();
+ PreferenceDialog dialog = WorkbenchPreferenceDialog.createDialogOn(
+ shell,
+ RemoteDebugUIActivator.REMOTE_DEBUG_PREFERENCE_PAGE_ID);
+ dialog.open();
configureCombo();
} else {
super.buttonPressed(buttonId);
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java 2011-11-07 15:14:28 UTC (rev 36193)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java 2011-11-07 15:40:28 UTC (rev 36194)
@@ -1,24 +1,49 @@
+/*************************************************************************************
+ * 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.common.jdt.debug.ui.preferences;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
+import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnViewerEditor;
-import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
-import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TableViewerEditor;
-import org.eclipse.jface.viewers.TableViewerFocusCellManager;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -26,31 +51,97 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.common.jdt.debug.ui.Messages;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class RemoteDebugPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
-// private Image checkboxOn;
-// private Image checkboxOff;
-// private Image errorIcon;
-// private RemoteDebug[] remoteDebugs;
-// private TableViewer viewer;
-// private Button discoverButton;
+ private static final String ADD_ALL = " Add All>> ";
+ private static final String ADD = " Add>> ";
+ private static final String REMOVE_ALL = " <<Remove All ";
+ private static final String REMOVE = " <Remove ";
private Button autoConnectButton;
-
+ private Button removeButton;
+ private Button removeAllButton;
+ private Button addButton;
+ private Button addAllButton;
+ private ListViewer eclipseConfigurationsViewer;
+ private ListViewer jbossConfigurationsViewer;
+ private Set<ILaunchConfiguration> jbossConfigurations = new HashSet<ILaunchConfiguration>();
+ private Set<ILaunchConfiguration> eclipseConfigurations = new HashSet<ILaunchConfiguration>();
+ private Set<ILaunchConfiguration> selectedEclipseConfigurations = new HashSet<ILaunchConfiguration>();
+ private Set<ILaunchConfiguration> selectedJBossConfigurations = new HashSet<ILaunchConfiguration>();
+
+ private ILaunchConfigurationListener launchConfigurationListener = new ILaunchConfigurationListener() {
+
+ private void updateLaunchConfiguration(ILaunchConfiguration configuration) {
+ try {
+ if (!RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID
+ .equals(configuration.getType().getIdentifier())) {
+ return;
+ }
+ refreshConfigurations();
+ eclipseConfigurationsViewer.setInput(eclipseConfigurations.toArray(new ILaunchConfiguration[0]));
+ jbossConfigurationsViewer.setInput(jbossConfigurations.toArray(new ILaunchConfiguration[0]));
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ }
+ }
+ @Override
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+
+ @Override
+ public void launchConfigurationChanged(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+
+ @Override
+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+ };
+
@Override
public void init(IWorkbench workbench) {
-// remoteDebugs = RemoteDebugUIActivator.getDefault().getRemoteDebugs();
-// checkboxOn = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/xpl/complete_tsk.gif").createImage();
-// checkboxOff = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/xpl/incomplete_tsk.gif").createImage();
-// errorIcon = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/xpl/error_tsk.gif").createImage();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(launchConfigurationListener);
}
+ protected void refreshConfigurations() {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
+ jbossConfigurations.clear();
+ eclipseConfigurations.clear();
+ try {
+ ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type);
+ for (ILaunchConfiguration config:configs) {
+ if (config.getAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, false)) {
+ jbossConfigurations.add(config);
+ } else {
+ eclipseConfigurations.add(config);
+ }
+ }
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ }
+ eclipseConfigurationsViewer.setInput(eclipseConfigurations.toArray(new ILaunchConfiguration[0]));
+ jbossConfigurationsViewer.setInput(jbossConfigurations.toArray(new ILaunchConfiguration[0]));
+ selectedJBossConfigurations.clear();
+ selectedEclipseConfigurations.clear();
+ eclipseConfigurationsViewer.setSelection(new StructuredSelection(selectedEclipseConfigurations));
+ jbossConfigurationsViewer.setSelection(new StructuredSelection(selectedJBossConfigurations));
+ configureButtons();
+ }
+
@Override
protected Control createContents(Composite parent) {
initializeDialogUnits(parent);
@@ -60,173 +151,242 @@
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setLayout(layout);
-// Group group = new Group(composite, SWT.NONE);
-// GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-// group.setLayoutData(gd);
-// layout = new GridLayout(1, false);
-// group.setLayout(layout);
-// group.setText("Key Bindings");
-//
-// viewer = new TableViewer(group, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
-// | SWT.V_SCROLL | SWT.BORDER);
-// gd = new GridData(GridData.FILL_BOTH);
-// gd.heightHint = 250;
-// viewer.getTable().setLayoutData(gd);
-//
-// Table table = viewer.getTable();
-// table.setHeaderVisible(true);
-// table.setLinesVisible(true);
-// table.setFont(parent.getFont());
-//
-// viewer.setContentProvider(new RemoteDebugContentProvider());
-//
-// String[] columnHeaders = {"Key", "Description", "Port", "Show"};
-//
-// for (int i = 0; i < columnHeaders.length; i++) {
-// TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
-// column.setLabelProvider(new RemoteDebugLabelProvider(i));
-// column.getColumn().setText(columnHeaders[i]);
-// column.getColumn().setResizable(true);
-// column.getColumn().setMoveable(true);
-// column.setEditingSupport(new RemoteDebugEditingSupport(viewer, i));
-//
-// }
-//
-// ColumnLayoutData[] remoteDebugLayouts= {
-// new ColumnWeightData(150,150),
-// new ColumnWeightData(250,250),
-// new ColumnWeightData(80,80),
-// new ColumnWeightData(60,60),
-// };
-//
-// TableLayout tableLayout = new AutoResizeTableLayout(table);
-// for (int i = 0; i < remoteDebugLayouts.length; i++) {
-// tableLayout.addColumnData(remoteDebugLayouts[i]);
-// }
-//
-// viewer.getTable().setLayout(tableLayout);
-//
-// TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(viewer, new FocusCellOwnerDrawHighlighter(viewer));
-//
-// ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(viewer) {
-// protected boolean isEditorActivationEvent(
-// ColumnViewerEditorActivationEvent event) {
-// ViewerCell cell = viewer.getColumnViewerEditor().getFocusCell();
-// if (cell != null && cell.getColumnIndex() == 1) {
-// return super.isEditorActivationEvent(event);
-// }
-// return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
-// || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
-// || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
-// || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
-// }
-// };
-//
-// TableViewerEditor.create(viewer, focusCellManager, actSupport, ColumnViewerEditor.TABBING_HORIZONTAL
-// | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
-// | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
-//
-// viewer.setInput(remoteDebugs);
-//
-// discoverButton = new Button(composite, SWT.CHECK);
-// discoverButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-// discoverButton.setSelection(RemoteDebugUIActivator.getDefault().isDiscoverRemoteApplication());
-// discoverButton.setText(Messages.Discover_Remote_Applications);
-//
-// createNoteComposite(composite.getFont(), composite, "Note:",
-// "It may take some time to discover remote applications.");
autoConnectButton = new Button(composite, SWT.CHECK);
autoConnectButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
autoConnectButton.setSelection(RemoteDebugUIActivator.getDefault().isAutoConnect());
autoConnectButton.setText("Automatically connect if only one application found");
+ Group remoteConfigurationsGroup = new Group(composite, SWT.NONE);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ layout = new GridLayout(3, false);
+ remoteConfigurationsGroup.setLayout(layout);
+ remoteConfigurationsGroup.setLayoutData(gd);
+ remoteConfigurationsGroup.setText("Remote Configurations");
+
+ Composite eclipseConfigurationsComposite = new Composite(remoteConfigurationsGroup, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ eclipseConfigurationsComposite.setLayoutData(gd);
+ eclipseConfigurationsComposite.setLayout(new GridLayout(1, false));
+
+ Label eclipseConfigurationLabel = new Label(eclipseConfigurationsComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ eclipseConfigurationLabel.setLayoutData(gd);
+ eclipseConfigurationLabel.setText("Eclipse Remote Java Configurations:");
+
+ eclipseConfigurationsViewer = new ListViewer(eclipseConfigurationsComposite, SWT.BORDER | SWT.MULTI);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.heightHint = 300;
+
+ eclipseConfigurationsViewer.getList().setLayoutData(gd);
+ eclipseConfigurationsViewer.setContentProvider(new ArrayContentProvider());
+ eclipseConfigurationsViewer.setLabelProvider(new RemoteConfigurationsLabelProvider());
+
+ Composite buttonsComposite = new Composite(remoteConfigurationsGroup, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ buttonsComposite.setLayoutData(gd);
+ buttonsComposite.setLayout(new GridLayout(1, false));
+
+ Label buttonsLabel = new Label(buttonsComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ buttonsLabel.setLayoutData(gd);
+
+ Composite buttonsComp = new Composite(buttonsComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, true);
+ buttonsComp.setLayoutData(gd);
+ buttonsComp.setLayout(new GridLayout());
+
+ GC gc = new GC(buttonsComp);
+ int maxAddRemoveButtonsWidth = computeMaxAddRemoveButtonsWidth(gc);
+ gc.dispose();
+
+ removeButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, REMOVE);
+ removeAllButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, REMOVE_ALL);
+ addButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, ADD);
+ addAllButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, ADD_ALL);
+
+ Composite jbossConfigurationsComposite = new Composite(remoteConfigurationsGroup, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ jbossConfigurationsComposite.setLayoutData(gd);
+ jbossConfigurationsComposite.setLayout(new GridLayout());
+
+ Label jbossConfigurationLabel = new Label(jbossConfigurationsComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ jbossConfigurationLabel.setLayoutData(gd);
+ jbossConfigurationLabel.setText("JBoss Remote Java Configurations:");
+
+ jbossConfigurationsViewer = new ListViewer(jbossConfigurationsComposite, SWT.BORDER | SWT.MULTI);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.heightHint = 300;
+ jbossConfigurationsViewer.getList().setLayoutData(gd);
+ jbossConfigurationsViewer.setContentProvider(new ArrayContentProvider());
+ jbossConfigurationsViewer.setLabelProvider(new RemoteConfigurationsLabelProvider());
+
+ Button remoteConfigurationButton = new Button(composite, SWT.PUSH);
+ remoteConfigurationButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));
+ remoteConfigurationButton.setText("Configure Remote Java Application...");
+ remoteConfigurationButton.setImage(DebugPluginImages
+ .getImage(IDebugUIConstants.IMG_ACT_DEBUG));
+ remoteConfigurationButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(launchConfigurationListener);
+ LaunchConfigurationManager lcManager = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
+ LaunchGroupExtension group = lcManager.getLaunchGroup(RemoteDebugActivator.LAUNCH_CATEGORY);
+ LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(getShell(), group);
+ //ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfiguration config = null;
+ if (selectedJBossConfigurations.size() > 0) {
+ config = selectedJBossConfigurations.iterator().next();
+ } else if (selectedEclipseConfigurations.size() > 0) {
+ config = selectedEclipseConfigurations.iterator().next();
+ } else if (jbossConfigurations.size() > 0) {
+ config = jbossConfigurations.iterator().next();
+ } else if (eclipseConfigurations.size() > 0) {
+ config = eclipseConfigurations.iterator().next();
+ }
+ if (config != null) {
+ IStructuredSelection selection = new StructuredSelection(config);
+ dialog.setInitialSelection(selection);
+ dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
+ } else {
+ dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED);
+ }
+ dialog.open();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(launchConfigurationListener);
+ refreshConfigurations();
+ }
+
+ });
+
+ eclipseConfigurationsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection sel = event.getSelection();
+ selectedEclipseConfigurations.clear();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) sel;
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof ILaunchConfiguration) {
+ selectedEclipseConfigurations.add((ILaunchConfiguration) object);
+ }
+ }
+ }
+ configureButtons();
+ }
+ });
+ jbossConfigurationsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection sel = event.getSelection();
+ selectedJBossConfigurations.clear();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) sel;
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof ILaunchConfiguration) {
+ selectedJBossConfigurations.add((ILaunchConfiguration) object);
+ }
+ }
+ }
+ configureButtons();
+ }
+ });
+
+ removeButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ changeConfigurations(selectedJBossConfigurations, false);
+ }
+
+ });
+ removeAllButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ changeConfigurations(jbossConfigurations, false);
+ }
+
+ });
+ addButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ changeConfigurations(selectedEclipseConfigurations, true);
+ }
+
+ });
+ addAllButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ changeConfigurations(eclipseConfigurations, true);
+ }
+
+ });
+ refreshConfigurations();
+
return composite;
}
- class RemoteDebugContentProvider implements IStructuredContentProvider {
+ private void configureButtons() {
+ removeButton.setEnabled(selectedJBossConfigurations.size() > 0);
+ removeAllButton.setEnabled(jbossConfigurations.size() > 0);
+ addButton.setEnabled(selectedEclipseConfigurations.size() > 0);
+ addAllButton.setEnabled(eclipseConfigurations.size() > 0);
+ }
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
+ protected Button createButton(Composite buttonsComp,
+ int maxAddRemoveButtonsWidth, String text) {
+ GridData gd;
+ Button button = new Button(buttonsComp, SWT.NONE | SWT.LEFT);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+ gd.widthHint = maxAddRemoveButtonsWidth;
+ button.setLayoutData(gd);
+ button.setText(text);
+ return button;
+ }
- @Override
- public Object[] getElements(Object inputElement) {
- //return remoteDebugs;
- return new Object[0];
- }
+ private int computeMaxAddRemoveButtonsWidth(GC gc) {
+ int maxWidth = 0;
+
+ maxWidth = getGreaterWidth(gc,REMOVE, maxWidth);
+ maxWidth = getGreaterWidth(gc,REMOVE_ALL, maxWidth);
+ maxWidth = getGreaterWidth(gc,ADD, maxWidth);
+ maxWidth = getGreaterWidth(gc,ADD_ALL, maxWidth);
- @Override
- public void dispose() {
-
- }
-
+ return maxWidth;
}
- class RemoteDebugLabelProvider extends ColumnLabelProvider {
+ private int getGreaterWidth(GC gc, String str, int compareWidth) {
+ int greaterWidth = compareWidth;
- private int columnIndex;
-
- public RemoteDebugLabelProvider(int i) {
- this.columnIndex = i;
+ Point strExtentPoint = gc.stringExtent(str);
+ int strWidth = strExtentPoint.x;
+ if (strWidth > compareWidth) {
+ greaterWidth = strWidth;
}
- public String getText(Object element) {
- if (element instanceof RemoteDebug) {
- RemoteDebug remoteDebug = (RemoteDebug) element;
- switch (columnIndex) {
- case 0:
- return remoteDebug.getKey(true);
- case 1:
- return remoteDebug.getDescription();
- case 2:
- return remoteDebug.getPort();
- }
- }
- return null;
- }
-
- @Override
- public Image getImage(Object element) {
- if (element == null) {
- return null;
- }
- RemoteDebug remoteDebug = (RemoteDebug) element;
-// if (columnIndex == 0) {
-// return remoteDebug.isValid() ? null : errorIcon;
-// }
-// if (columnIndex == 3) {
-// return remoteDebug.isShow() ? checkboxOn : checkboxOff;
-// }
- return null;
- }
+ return greaterWidth + 5;
}
@Override
public void dispose() {
-// if (checkboxOff != null) {
-// checkboxOff.dispose();
-// }
-// if (checkboxOn != null) {
-// checkboxOn.dispose();
-// }
-// if (errorIcon != null) {
-// errorIcon.dispose();
-// }
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(launchConfigurationListener);
super.dispose();
}
@Override
protected void performApply() {
IEclipsePreferences preferences = RemoteDebugUIActivator.getDefault().getPreferences();
-// int keys = RemoteDebugUIActivator.KEYS;
-// for (int i = 0; i < keys; i++) {
-// preferences.put(RemoteDebugUIActivator.getDescriptionPreferenceName(i), remoteDebugs[i].getDescription());
-// preferences.put(RemoteDebugUIActivator.getPortPreferenceName(i), remoteDebugs[i].getPort());
-// preferences.putBoolean(RemoteDebugUIActivator.getShowPreferenceName(i), remoteDebugs[i].isShow());
-// }
-// preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, discoverButton.getSelection());
preferences.putBoolean(RemoteDebugUIActivator.AUTO_CONNECT, autoConnectButton.getSelection());
RemoteDebugUIActivator.getDefault().savePreferences();
}
@@ -234,21 +394,7 @@
@Override
protected void performDefaults() {
IEclipsePreferences preferences = RemoteDebugUIActivator.getDefault().getPreferences();
-
-// int keys = RemoteDebugUIActivator.KEYS;
-// for (int i = 0; i < keys; i++) {
-// preferences.put(RemoteDebugUIActivator.getDescriptionPreferenceName(i), RemoteDebugUIActivator.DEFAULT_DESCRIPTION);
-// preferences.put(RemoteDebugUIActivator.getPortPreferenceName(i), RemoteDebugUIActivator.DEFAULT_PORT);
-// preferences.putBoolean(RemoteDebugUIActivator.getShowPreferenceName(i), RemoteDebugUIActivator.DEFAULT_SHOW);
-//
-// }
-// preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, RemoteDebugUIActivator.DEFAULT_DISCOVER_REMOTE_APPLICATION);
-// RemoteDebugUIActivator.getDefault().savePreferences();
-// remoteDebugs = RemoteDebugUIActivator.getDefault().getRemoteDebugs();
-// viewer.setInput(remoteDebugs);
-// discoverButton.setSelection(RemoteDebugUIActivator.DEFAULT_DISCOVER_REMOTE_APPLICATION);
-// preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, RemoteDebugUIActivator.DEFAULT_DISCOVER_REMOTE_APPLICATION);
-
+
autoConnectButton.setSelection(RemoteDebugUIActivator.AUTO_CONNECT_DEFAULT);
preferences.putBoolean(RemoteDebugUIActivator.AUTO_CONNECT, RemoteDebugUIActivator.AUTO_CONNECT_DEFAULT);
RemoteDebugUIActivator.getDefault().savePreferences();
@@ -260,5 +406,34 @@
performApply();
return super.performOk();
}
+
+ protected void changeConfigurations(Set<ILaunchConfiguration> configurations, boolean value) {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(launchConfigurationListener);
+ for (ILaunchConfiguration configuration:configurations) {
+ try {
+ ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
+ wc.setAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, value);
+ wc.doSave();
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ }
+ }
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(launchConfigurationListener);
+ refreshConfigurations();
+ }
+ class RemoteConfigurationsLabelProvider extends LabelProvider {
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof ILaunchConfiguration) {
+ ILaunchConfiguration configuration = (ILaunchConfiguration) element;
+ return configuration.getName();
+ }
+ return null;
+ }
+ }
+
}
14 years, 2 months
JBoss Tools SVN: r36193 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-07 10:14:28 -0500 (Mon, 07 Nov 2011)
New Revision: 36193
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
Log:
[JBIDE-10060] migrated fix from m4 to trunk (beta1)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-11-07 15:05:04 UTC (rev 36192)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-11-07 15:14:28 UTC (rev 36193)
@@ -35,3 +35,4 @@
org.jboss.tools.common.ui.databinding,
org.jboss.tools.common.ui.preferencevalue,
org.jboss.tools.common.ui.ssh
+
14 years, 2 months
JBoss Tools SVN: r36192 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/behaviour and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-07 10:05:04 -0500 (Mon, 07 Nov 2011)
New Revision: 36192
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
Log:
[JBIDE-10049] migrated fix from m4 to trunk (beta1)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-11-07 14:57:00 UTC (rev 36191)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-11-07 15:05:04 UTC (rev 36192)
@@ -4,12 +4,13 @@
Bundle-SymbolicName: org.jboss.tools.openshift.express.ui;singleton:=true
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator
-Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="[2.3.0,3.0.0)",
- org.jboss.tools.openshift.egit.core;bundle-version="[2.3.0,3.0.0)",
+Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
+ org.jboss.ide.eclipse.as.egit.core;bundle-version="2.3.0",
org.eclipse.egit.ui;bundle-version="[1.0.0,2.0.0)",
org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
org.eclipse.jgit;bundle-version="[1.1.0,2.1.0)",
com.jcraft.jsch;bundle-version="0.1.44",
+ org.eclipse.jsch.core;bundle-version="[1.1.300,2.0.0)",
org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
org.eclipse.m2e.core;bundle-version="1.0.100",
org.eclipse.ui,
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-11-07 14:57:00 UTC (rev 36191)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-11-07 15:05:04 UTC (rev 36192)
@@ -20,7 +20,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.ide.eclipse.as.egit.core.EGitUtils;
public class ExpressPublishMethod implements IJBossServerPublishMethod {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java 2011-11-07 14:57:00 UTC (rev 36191)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java 2011-11-07 15:05:04 UTC (rev 36192)
@@ -20,7 +20,6 @@
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -33,10 +32,6 @@
*/
public abstract class AbstractOpenShiftWizardPage extends WizardPage {
- protected enum WizardProgressDirection {
- BACKWARD, FORWARD
- }
-
private DataBindingContext dbc;
protected AbstractOpenShiftWizardPage(String title, String description, String pageName, IWizard wizard) {
@@ -85,46 +80,29 @@
@Override
public void handlePageChanging(PageChangingEvent event) {
if (event.getTargetPage() == AbstractOpenShiftWizardPage.this) {
- onPageWillGetActivated(getActivationDirection(event), event, dbc);
- } else if (event.getCurrentPage() == AbstractOpenShiftWizardPage.this){
- onPageWillGetDeactivated(getDeactivationDirection(event), event, dbc);
+ onPageWillGetActivated(event, dbc);
+ } else {
+ onPageWillGetDeactivated(event, dbc);
}
}
-
});
}
}
- private WizardProgressDirection getActivationDirection(PageChangingEvent event) {
- IWizardPage previousPage = getPreviousPage();
- if (previousPage == null
- || previousPage.equals(event.getCurrentPage())) {
- return WizardProgressDirection.BACKWARD;
- } else {
- return WizardProgressDirection.FORWARD;
- }
+ protected DataBindingContext getDatabindingContext() {
+ return dbc;
}
- private WizardProgressDirection getDeactivationDirection(PageChangingEvent event) {
- IWizardPage previousPage = getPreviousPage();
- if (previousPage == null
- || previousPage.equals(event.getTargetPage())) {
- return WizardProgressDirection.BACKWARD;
- } else {
- return WizardProgressDirection.FORWARD;
- }
- }
-
protected void onPageActivated(DataBindingContext dbc) {
}
protected void onPageDeactivated(DataBindingContext dbc) {
}
- protected void onPageWillGetActivated(WizardProgressDirection direction, PageChangingEvent event, DataBindingContext dbc) {
+ protected void onPageWillGetActivated(PageChangingEvent event, DataBindingContext dbc) {
}
- protected void onPageWillGetDeactivated(WizardProgressDirection direction, PageChangingEvent event, DataBindingContext dbc) {
+ protected void onPageWillGetDeactivated(PageChangingEvent event, DataBindingContext dbc) {
}
protected abstract void doCreateControls(Composite parent, DataBindingContext dbc);
@@ -132,4 +110,5 @@
protected DataBindingContext getDataBindingContext() {
return dbc;
}
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-11-07 14:57:00 UTC (rev 36191)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-11-07 15:05:04 UTC (rev 36192)
@@ -146,9 +146,8 @@
}
@Override
- protected void onPageWillGetDeactivated(WizardProgressDirection direction, PageChangingEvent event, DataBindingContext dbc) {
- if (!model.areCredentialsValidated()
- && direction == WizardProgressDirection.FORWARD) {
+ protected void onPageWillGetDeactivated(PageChangingEvent event, DataBindingContext dbc) {
+ if (!model.areCredentialsValidated()) {
try {
final ArrayBlockingQueue<IStatus> queue = new ArrayBlockingQueue<IStatus>(1);
WizardUtils.runInWizard(
@@ -160,7 +159,7 @@
queue.offer(status);
return Status.OK_STATUS;
}
- }, getContainer(), getDataBindingContext());
+ }, getContainer(), getDatabindingContext());
queue.poll(10, TimeUnit.SECONDS);
event.doit = model.areCredentialsValid();
} catch (Exception ex) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-11-07 14:57:00 UTC (rev 36191)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-11-07 15:05:04 UTC (rev 36192)
@@ -26,6 +26,7 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
@@ -93,6 +94,16 @@
"You have to select a ssh public key")),
new UpdateValueStrategy().setAfterGetValidator(new SSHKeyValidator()));
ControlDecorationSupport.create(sshKeyTextBinding, SWT.TOP | SWT.LEFT);
+ try {
+ model.initSshKey();
+ } catch (OpenShiftException ex) {
+ IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "Could check your ssh keys", ex);
+ OpenShiftUIActivator.log(status);
+ ErrorDialog.openError(getShell(),
+ "Error checking your ssh keys",
+ "Could not check your ssh keys", status);
+ }
Button browseButton = new Button(container, SWT.PUSH);
browseButton.setText("Browse");
@@ -113,7 +124,6 @@
GridDataFactory.fillDefaults()
.span(3, 1).align(SWT.FILL, SWT.CENTER).applyTo(sshPrefsLink);
sshPrefsLink.addSelectionListener(onSshPrefs());
-
}
private SelectionListener onNew() {
@@ -122,26 +132,35 @@
@Override
public void widgetSelected(SelectionEvent e) {
- InputDialog dialog = new PassphraseDialog(getShell());
- if (Dialog.OK == dialog.open()) {
- try {
- String passPhrase = dialog.getValue();
- model.createSShKeyPair(passPhrase);
- } catch (FileNotFoundException ex) {
- IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "Could not read the ssh key folder", ex);
- OpenShiftUIActivator.log(status);
- ErrorDialog.openError(getShell(),
- "Error creating a new ssh key pair",
- "Could not create a new ssh key pair", status);
- } catch (OpenShiftException ex) {
- IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "Could not create an ssh key pair", ex);
- OpenShiftUIActivator.log(status);
- ErrorDialog.openError(getShell(),
- "Error creating a new ssh key pair",
- "Could not create a new ssh key pair", status);
+ try {
+ if (model.libraPublicKeyExists()) {
+ MessageDialog.openInformation(getShell(),
+ "Libra Key already present",
+ "You already have a key at \"" + model.getLibraPublicKey() + "\". Please move it or use it.");
+ return;
+ }
+
+ InputDialog dialog = new PassphraseDialog(getShell());
+ if (Dialog.OK == dialog.open()) {
+ try {
+ String passPhrase = dialog.getValue();
+ model.createLibraKeyPair(passPhrase);
+ } catch (FileNotFoundException ex) {
+ IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "Could not read the ssh key folder", ex);
+ OpenShiftUIActivator.log(status);
+ ErrorDialog.openError(getShell(),
+ "Error creating a new ssh key pair",
+ "Could not create a new ssh key pair", status);
+ }
}
+ } catch (OpenShiftException ex) {
+ IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "Could not create an ssh key pair", ex);
+ OpenShiftUIActivator.log(status);
+ ErrorDialog.openError(getShell(),
+ "Error creating a new ssh key pair",
+ "Could not create a new ssh key pair", status);
}
}
};
@@ -177,7 +196,7 @@
SshPrivateKeysPreferences.openPreferencesPage(getShell());
// refresh warning about key
// (since user may have changed SSH2 prefs)
- getDataBindingContext().updateTargets();
+ getDatabindingContext().updateTargets();
}
};
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2011-11-07 14:57:00 UTC (rev 36191)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2011-11-07 15:05:04 UTC (rev 36192)
@@ -14,8 +14,10 @@
import java.io.FileNotFoundException;
import java.io.IOException;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jsch.internal.core.IConstants;
+import org.eclipse.jsch.internal.core.JSchCorePlugin;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
-import org.jboss.tools.common.ui.ssh.SshPrivateKeysPreferences;
import org.jboss.tools.openshift.express.client.IDomain;
import org.jboss.tools.openshift.express.client.ISSHPublicKey;
import org.jboss.tools.openshift.express.client.IUser;
@@ -29,7 +31,7 @@
*/
public class NewDomainWizardPageModel extends ObservableUIPojo {
- private static final String OPENSHIFT_KEY_PREFIX = "openshift_id_rsa_";
+ public static final String LIBRA_KEY = "libra_id_rsa";
private static final String PUBLIC_KEY_SUFFIX = ".pub";
public static final String PROPERTY_NAMESPACE = "namespace";
@@ -46,6 +48,40 @@
this.user = user;
}
+ public void initSshKey() throws OpenShiftException {
+ if (!libraPublicKeyExists()) {
+ return;
+ }
+ File libraPublicKey = getLibraPublicKey();
+ setSshKey(libraPublicKey.getAbsolutePath());
+ }
+
+ /**
+ * Returns the file of the libra public key. It is not checking if the file exists.
+ *
+ * @return the libra public key
+ * @throws OpenShiftException
+ */
+ public File getLibraPublicKey() throws OpenShiftException {
+ File libraPrivateKey = getLibraPrivateKey();
+ return new File(libraPrivateKey.getParent(), getPublicKeyPath(libraPrivateKey.getName()));
+ }
+
+ private String getPublicKeyPath(String privateKeyPath) {
+ return privateKeyPath + PUBLIC_KEY_SUFFIX;
+ }
+
+ public File getLibraPrivateKey() throws OpenShiftException {
+ Preferences preferences = JSchCorePlugin.getPlugin().getPluginPreferences();
+ String ssh2Home = preferences.getString(IConstants.KEY_SSH2HOME);
+ if (ssh2Home == null
+ || ssh2Home.trim().length() == 0) {
+ throw new OpenShiftException("Could not determine your ssh2 home directory");
+ }
+
+ return new File(ssh2Home, LIBRA_KEY);
+ }
+
public String getNamespace() {
return this.namespace;
}
@@ -58,34 +94,37 @@
public String getSshKey() {
return sshKey;
}
+
+ public boolean libraPublicKeyExists() throws OpenShiftException {
+ return FileUtils.canRead(getLibraPublicKey());
+ }
- public void createSShKeyPair(String passPhrase) throws FileNotFoundException, OpenShiftException {
- String sshKeysDirectory = SshPrivateKeysPreferences.getSshKeyDirectory();
- SSHKeyPair keyPair = createSshKeyPair(passPhrase, sshKeysDirectory);
- SshPrivateKeysPreferences.add(keyPair.getPrivateKeyPath());
+ public void createLibraKeyPair(String passPhrase) throws FileNotFoundException, OpenShiftException {
+ File libraPublicKey = getLibraPublicKey();
+ if (libraPublicKey.canRead()) {
+ // key already exists
+ return;
+ }
+ File libraPrivateKey = getLibraPrivateKey();
+ SSHKeyPair keyPair = SSHKeyPair.create(passPhrase, libraPrivateKey.getAbsolutePath(), libraPublicKey.getAbsolutePath());
+ addToPrivateKeysPreferences(keyPair);
setSshKey(keyPair.getPublicKeyPath());
}
- private SSHKeyPair createSshKeyPair(String passPhrase, String sshKeysDirectory) throws OpenShiftException {
- String privateKeyPath = getKeyPairFileName(sshKeysDirectory);
- String publicKeyPath = getPublicKeyPath(privateKeyPath);
- return SSHKeyPair.create(passPhrase, privateKeyPath, publicKeyPath);
- }
-
- private String getKeyPairFileName(String sshKeysDirectory) {
- int i = 0;
- File privateKey = null;
- while (FileUtils.canRead(privateKey = new File(sshKeysDirectory, OPENSHIFT_KEY_PREFIX + i))
- || FileUtils.canRead(new File(sshKeysDirectory, getPublicKeyPath(privateKey.getName())))) {
- i++;
+ private void addToPrivateKeysPreferences(SSHKeyPair keyPair) {
+ Preferences preferences = JSchCorePlugin.getPlugin().getPluginPreferences();
+ String privateKeys = preferences.getString(IConstants.KEY_PRIVATEKEY);
+ if (privateKeys != null
+ && privateKeys.trim().length() > 0) {
+ privateKeys = privateKeys + "," + keyPair.getPrivateKeyPath();
+ } else {
+ privateKeys = keyPair.getPrivateKeyPath();
}
- return privateKey.getAbsolutePath();
+ preferences.setValue(IConstants.KEY_PRIVATEKEY, privateKeys);
+ JSchCorePlugin.getPlugin().setNeedToLoadKeys(true);
+ JSchCorePlugin.getPlugin().savePluginPreferences();
}
-
- private String getPublicKeyPath(String privateKeyPath) {
- return privateKeyPath + PUBLIC_KEY_SUFFIX;
- }
-
+
public void setSshKey(String sshKey) {
firePropertyChange(PROPERTY_SSHKEY, this.sshKey, this.sshKey = sshKey);
}
14 years, 2 months
JBoss Tools SVN: r36191 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-07 09:57:00 -0500 (Mon, 07 Nov 2011)
New Revision: 36191
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
Log:
[]JBIDE-10068] added dependency to jsch bundle
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-11-07 13:50:20 UTC (rev 36190)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-11-07 14:57:00 UTC (rev 36191)
@@ -10,3 +10,4 @@
org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
Export-Package: org.jboss.tools.openshift.express.client,
org.jboss.tools.openshift.express.client.utils
+Require-Bundle: com.jcraft.jsch;bundle-version="0.1.44"
14 years, 2 months
JBoss Tools SVN: r36190 - in trunk/openshift/plugins: org.jboss.tools.openshift.express.client and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-07 08:50:20 -0500 (Mon, 07 Nov 2011)
New Revision: 36190
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/pom.xml
Modified:
trunk/openshift/plugins/pom.xml
Log:
[JBIDE-10068] added client bundle to the build again
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/pom.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/pom.xml (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/pom.xml 2011-11-07 13:50:20 UTC (rev 36190)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.openshift</groupId>
+ <artifactId>plugins</artifactId>
+ <version>2.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.openshift.plugins</groupId>
+ <artifactId>org.jboss.tools.openshift.express.client</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
Modified: trunk/openshift/plugins/pom.xml
===================================================================
--- trunk/openshift/plugins/pom.xml 2011-11-07 13:27:22 UTC (rev 36189)
+++ trunk/openshift/plugins/pom.xml 2011-11-07 13:50:20 UTC (rev 36190)
@@ -13,8 +13,7 @@
<modules>
<module>org.jboss.tools.openshift.egit.core</module>
<module>org.jboss.tools.openshift.egit.ui</module>
- <!-- JBIDE-10068
- <module>org.jboss.tools.openshift.express.client</module> -->
+ <module>org.jboss.tools.openshift.express.client</module>
<module>org.jboss.tools.openshift.express.ui</module>
</modules>
</project>
14 years, 2 months
JBoss Tools SVN: r36189 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.client: .settings and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-07 08:27:22 -0500 (Mon, 07 Nov 2011)
New Revision: 36189
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.project
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.settings/
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.settings/org.eclipse.jdt.core.prefs
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/build.properties
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/jboss-dmr-1.0.0.Final.jar
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/src/
Log:
[]JBIDE-10068] created wrapper bundle that wraps the openshift express client jar and it's dependency (jboss-dmr)
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2011-11-07 13:27:22 UTC (rev 36189)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Final.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>
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.project
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.project (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.project 2011-11-07 13:27:22 UTC (rev 36189)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.openshift.express.client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.settings/org.eclipse.jdt.core.prefs 2011-11-07 13:27:22 UTC (rev 36189)
@@ -0,0 +1,8 @@
+#Mon Nov 07 14:21:09 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-11-07 13:27:22 UTC (rev 36189)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Client
+Bundle-SymbolicName: org.jboss.tools.openshift.express.client
+Bundle-Version: 2.3.0.qualifier
+Bundle-Vendor: JBoss by Red Hat
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .,
+ jboss-dmr-1.0.0.Final.jar,
+ org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
+Export-Package: org.jboss.tools.openshift.express.client,
+ org.jboss.tools.openshift.express.client.utils
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/build.properties
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/build.properties (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/build.properties 2011-11-07 13:27:22 UTC (rev 36189)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ jboss-dmr-1.0.0.Final.jar,\
+ org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/jboss-dmr-1.0.0.Final.jar
===================================================================
(Binary files differ)
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/jboss-dmr-1.0.0.Final.jar
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 2 months
JBoss Tools SVN: r36188 - trunk/openshift/plugins.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-07 08:26:11 -0500 (Mon, 07 Nov 2011)
New Revision: 36188
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/
Log:
[]JBIDE-10068] initial import
14 years, 2 months
JBoss Tools SVN: r36187 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-11-07 03:25:14 -0500 (Mon, 07 Nov 2011)
New Revision: 36187
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
Log:
JBIDE-10105 - trunk - messagebox error from m4
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-11-07 07:59:25 UTC (rev 36186)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-11-07 08:25:14 UTC (rev 36187)
@@ -8,10 +8,9 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard;
import org.eclipse.ui.PlatformUI;
@@ -120,19 +119,23 @@
final boolean[] b = new boolean[1];
Display.getDefault().syncExec(new Runnable() {
public void run() {
- MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
- messageBox.setMessage(message);
- messageBox.setText(title);
- int response = messageBox.open();
- if (response == SWT.YES)
- b[0] = true;
- else
- b[0] = false;
+ b[0] = MessageDialog.openQuestion(getActiveShell(), title, message);
}
});
return b[0];
}
+ private static Shell getActiveShell() {
+ Display display = Display.getDefault();
+ final Shell[] ret = new Shell[1];
+ display.syncExec(new Runnable() {
+ public void run() {
+ ret[0] = Display.getCurrent().getActiveShell();
+ }
+ });
+ return ret[0];
+ }
+
@Override
public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
IServer server) {
14 years, 2 months
JBoss Tools SVN: r36186 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-11-07 02:59:25 -0500 (Mon, 07 Nov 2011)
New Revision: 36186
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
Log:
JBIDE-9724 - fixed in beta1
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java 2011-11-07 02:18:50 UTC (rev 36185)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java 2011-11-07 07:59:25 UTC (rev 36186)
@@ -4,12 +4,11 @@
import java.text.MessageFormat;
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.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
@@ -18,7 +17,6 @@
import org.eclipse.wst.server.core.TaskModel;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
-import org.jboss.ide.eclipse.as.ui.IPreferenceKeys;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -93,14 +91,11 @@
}
private boolean standaloneScriptExists() {
- String standaloneScriptPath = new StringBuilder(homeDir)
- .append(File.separator)
- .append("bin") //$NON-NLS-1$
- .append(File.separator)
- .append("standalone.sh") //$NON-NLS-1$
- .toString();
- return new File(standaloneScriptPath).exists();
+ String s = JBossServerType.AS7.getSystemJarPath();
+ IPath p = new Path(homeDir).append(s);
+ return p.toFile().exists();
}
+
@Override
protected String getSystemJarPath() {
return JBossServerType.AS7.getSystemJarPath();
14 years, 2 months
JBoss Tools SVN: r36185 - trunk/seam/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-11-06 21:18:50 -0500 (Sun, 06 Nov 2011)
New Revision: 36185
Modified:
trunk/seam/docs/reference/en-US/Book_Info.xml
trunk/seam/docs/reference/en-US/seam_view.xml
Log:
updated for JBIDE-8336
Modified: trunk/seam/docs/reference/en-US/Book_Info.xml
===================================================================
--- trunk/seam/docs/reference/en-US/Book_Info.xml 2011-11-07 02:15:34 UTC (rev 36184)
+++ trunk/seam/docs/reference/en-US/Book_Info.xml 2011-11-07 02:18:50 UTC (rev 36185)
@@ -5,9 +5,9 @@
<title>Seam Developer Tools Reference Guide</title>
<subtitle>Provides information relating to the Seam Developer Tools module.</subtitle>
<productname>JBoss Developer Studio</productname>
- <productnumber>4.1</productnumber>
- <edition>4.1.0</edition>
- <pubsnumber>4</pubsnumber>
+ <productnumber>5.0</productnumber>
+ <edition>5.0.0</edition>
+ <pubsnumber>1</pubsnumber>
<abstract>
<para>The Seam Developer Tools Reference Guide explains how to use the Seam Developer Tools module to create Seam projects for deployment.</para>
</abstract>
Modified: trunk/seam/docs/reference/en-US/seam_view.xml
===================================================================
--- trunk/seam/docs/reference/en-US/seam_view.xml 2011-11-07 02:15:34 UTC (rev 36184)
+++ trunk/seam/docs/reference/en-US/seam_view.xml 2011-11-07 02:18:50 UTC (rev 36185)
@@ -14,8 +14,8 @@
<section>
<title>Seam Components View</title>
- <para>This chapter introduces you with Seam Components View.</para>
- <para>The <property>Seam Components View</property> is available from Seam perspective. It provides a list of seam components found in a project.</para>
+ <para>This chapter introduces you with <guilabel>Seam Components</guilabel> View.</para>
+ <para>The <guilabel>Seam Components</guilabel> view is available from Seam perspective. It provides a list of seam components found in a project.</para>
<figure>
<title>Seam Components View</title>
@@ -25,8 +25,21 @@
</imageobject>
</mediaobject>
</figure>
+
+ <para>
+ By right-clicking on a project and bringing up the context menu, you can create a new Seam project, action, conversation, form or entity. You can also generate entities from this menu and it is all able to be done from the <guilabel>Seam Components</guilabel> view.
+ </para>
- <para>The Seam Components View can show a components default scope in two ways:</para>
+ <figure>
+ <title>Seam Components View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_view/seam_view_1a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The <guilabel>Seam Components</guilabel> View can show a components default scope in two ways:</para>
<itemizedlist>
<listitem><para>as labels on each component (click on the triangular symbol at the top of the Seam Components View page and select <menuchoice><guimenuitem>Scope Presentation</guimenuitem><guimenuitem>Label</guimenuitem></menuchoice>)</para></listitem>
@@ -82,7 +95,7 @@
</mediaobject>
</figure>
- <para>The Seam Component View can be filtered by choosing <property>Customize View</property>.</para>
+ <para>The <guilabel>Seam Components</guilabel> view can be filtered by choosing <property>Customize View</property>.</para>
<figure>
<title>Customize View</title>
14 years, 2 months