JBoss Tools SVN: r29689 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:08:45 -0500 (Thu, 10 Mar 2011)
New Revision: 29689
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsolePage.java
Log:
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsolePage.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsolePage.java 2011-03-10 23:08:35 UTC (rev 29688)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsolePage.java 2011-03-10 23:08:45 UTC (rev 29689)
@@ -5,7 +5,7 @@
import org.eclipse.ui.console.TextConsoleViewer;
import org.eclipse.ui.part.Page;
import org.jboss.tools.seam.forge.console.Console;
-import org.jboss.tools.seam.forge.runtime.Manager;
+import org.jboss.tools.seam.forge.launching.ForgeRuntime;
public class ConsolePage extends Page {
@@ -14,7 +14,7 @@
@Override
public void createControl(Composite parent) {
- console = new Console(Manager.INSTANCE.getProcess());
+ console = new Console(ForgeRuntime.INSTANCE.getProcess());
viewer = new ConsoleViewer(parent, console);
console.initialize();
}
13 years, 10 months
JBoss Tools SVN: r29688 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:08:35 -0500 (Thu, 10 Mar 2011)
New Revision: 29688
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/InstalledForgeRuntimesBlock.java
Log:
even more runtime preferences stuf
- page is working
- initialization is working
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/InstalledForgeRuntimesBlock.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/InstalledForgeRuntimesBlock.java 2011-03-10 23:08:22 UTC (rev 29687)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/InstalledForgeRuntimesBlock.java 2011-03-10 23:08:35 UTC (rev 29688)
@@ -21,7 +21,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.jdt.launching.AbstractVMInstall;
import org.eclipse.jdt.launching.AbstractVMInstallType;
import org.eclipse.jdt.launching.IVMInstall;
@@ -54,14 +53,15 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
@@ -69,17 +69,20 @@
public class InstalledForgeRuntimesBlock implements ISelectionProvider {
- private Composite fControl;
+ private final int DEFAULT_COLUMN_WIDTH = 350/3 +1;
+
+
+ private Composite control;
private List fVMs = new ArrayList();
- private CheckboxTableViewer fVMList;
- private Button fAddButton;
- private Button fRemoveButton;
- private Button fEditButton;
- private Button fSearchButton;
+ private CheckboxTableViewer runtimesTableViewer;
+ private Button addButton;
+ private Button removeButton;
+ private Button editButton;
+ private Button searchButton;
private int fSortColumn = 0;
private ListenerList fSelectionListeners = new ListenerList();
private ISelection fPrevSelection = new StructuredSelection();
- private Table fTable;
+ private Table runtimesTable;
private static String fgLastUsedID;
class JREsContentProvider implements IStructuredContentProvider {
@@ -102,8 +105,6 @@
return vm.getName();
case 1:
return vm.getInstallLocation().getAbsolutePath();
- case 2:
- return vm.getVMInstallType().getName();
}
}
return element.toString();
@@ -120,7 +121,7 @@
}
public ISelection getSelection() {
- return new StructuredSelection(fVMList.getCheckedElements());
+ return new StructuredSelection(runtimesTableViewer.getCheckedElements());
}
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
@@ -133,73 +134,125 @@
fPrevSelection = selection;
Object jre = ((IStructuredSelection)selection).getFirstElement();
if (jre == null) {
- fVMList.setCheckedElements(new Object[0]);
+ runtimesTableViewer.setCheckedElements(new Object[0]);
} else {
- fVMList.setCheckedElements(new Object[]{jre});
- fVMList.reveal(jre);
+ runtimesTableViewer.setCheckedElements(new Object[]{jre});
+ runtimesTableViewer.reveal(jre);
}
fireSelectionChanged();
}
}
}
-
+
public void createControl(Composite ancestor) {
- Font font = ancestor.getFont();
- Composite parent= SWTFactory.createComposite(ancestor, font, 2, 1, GridData.FILL_BOTH);
- fControl = parent;
-
- SWTFactory.createLabel(parent, "Installed Forge Runtimes:", 2);
-
- fTable= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 250;
- gd.widthHint = 350;
- fTable.setLayoutData(gd);
- fTable.setFont(font);
- fTable.setHeaderVisible(true);
- fTable.setLinesVisible(true);
+ control = createMainControl(ancestor);
+ createTitleLabel();
+ createRuntimesArea();
+ createButtonsArea();
+ fillWithWorkspaceForgeRuntimes();
+ sortByName();
+ enableButtons();
+ }
+
+ private void createTitleLabel() {
+ Label label = new Label(control, SWT.NONE);
+ label.setText("Installed Forge Runtimes:");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ gd.grabExcessHorizontalSpace = false;
+ label.setLayoutData(gd);
+ }
- TableColumn column = new TableColumn(fTable, SWT.NULL);
- column.setText("Name");
- column.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- sortByName();
+ private void createButtonsArea() {
+ Composite buttons = createButtonsComposite();
+ createAddButton(buttons);
+ createEditButton(buttons);
+ createRemoveButton(buttons);
+ createSearchButton(buttons);
+ }
+
+ private void createSearchButton(Composite buttons) {
+ searchButton = new Button(buttons, SWT.PUSH);
+ searchButton.setText("&Search...");
+ searchButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ searchButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ search();
}
});
- int defaultwidth = 350/3 +1;
- column.setWidth(defaultwidth);
-
- column = new TableColumn(fTable, SWT.NULL);
- column.setText("Location");
- column.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- sortByLocation();
+ }
+
+ private void createRemoveButton(Composite buttons) {
+ removeButton = new Button(buttons, SWT.PUSH);
+ removeButton.setText("&Remove");
+ removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ removeButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ removeVMs();
}
});
- column.setWidth(defaultwidth);
-
- column = new TableColumn(fTable, SWT.NULL);
- column.setText("Type");
- column.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- sortByType();
+ }
+
+ private void createEditButton(Composite buttons) {
+ editButton = new Button(buttons, SWT.PUSH);
+ editButton.setText("&Edit...");
+ editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ editButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ editVM();
}
});
- column.setWidth(defaultwidth);
-
- fVMList = new CheckboxTableViewer(fTable);
- fVMList.setLabelProvider(new VMLabelProvider());
- fVMList.setContentProvider(new JREsContentProvider());
- // by default, sort by name
- sortByName();
-
- fVMList.addSelectionChangedListener(new ISelectionChangedListener() {
+ }
+
+ private void createAddButton(Composite buttons) {
+ addButton = new Button(buttons, SWT.PUSH);
+ addButton.setText("&Add...");
+ addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ addButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ addVM();
+ }
+ });
+ }
+
+ private Composite createButtonsComposite() {
+ Composite buttons = new Composite(control, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ buttons.setLayout(layout);
+ GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+ gd.horizontalSpan = 1;
+ buttons.setLayoutData(gd);
+ return buttons;
+ }
+
+ private Composite createMainControl(Composite ancestor) {
+ Composite result = new Composite(ancestor, SWT.NONE);
+ result.setLayout(new GridLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ result.setLayoutData(gd);
+ return result;
+ }
+
+ private void createRuntimesArea() {
+ createRuntimesTable();
+ createNameColumn();
+ createLocationColumn();
+ createRuntimesTableViewer();
+ }
+
+ private void createRuntimesTableViewer() {
+ runtimesTableViewer = new CheckboxTableViewer(runtimesTable);
+ runtimesTableViewer.setLabelProvider(new VMLabelProvider());
+ runtimesTableViewer.setContentProvider(new JREsContentProvider());
+ runtimesTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent evt) {
enableButtons();
}
});
- fVMList.addCheckStateListener(new ICheckStateListener() {
+ runtimesTableViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
if (event.getChecked()) {
setCheckedJRE((IVMInstall)event.getElement());
@@ -209,58 +262,55 @@
}
});
- fVMList.addDoubleClickListener(new IDoubleClickListener() {
+ runtimesTableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent e) {
- if (!fVMList.getSelection().isEmpty()) {
+ if (!runtimesTableViewer.getSelection().isEmpty()) {
editVM();
}
}
});
- fTable.addKeyListener(new KeyAdapter() {
+ }
+
+ private void createLocationColumn() {
+ TableColumn column = new TableColumn(runtimesTable, SWT.NULL);
+ column.setText("Location");
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ sortByLocation();
+ }
+ });
+ column.setWidth(DEFAULT_COLUMN_WIDTH);
+ }
+
+ private void createNameColumn() {
+ TableColumn column = new TableColumn(runtimesTable, SWT.NULL);
+ column.setText("Name");
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ sortByName();
+ }
+ });
+ column.setWidth(DEFAULT_COLUMN_WIDTH);
+ }
+
+ private void createRuntimesTable() {
+ runtimesTable= new Table(control, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 250;
+ gd.widthHint = 350;
+ runtimesTable.setLayoutData(gd);
+ runtimesTable.setFont(control.getFont());
+ runtimesTable.setHeaderVisible(true);
+ runtimesTable.setLinesVisible(true);
+ runtimesTable.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
- if (fRemoveButton.isEnabled()){
+ if (removeButton.isEnabled()){
removeVMs();
}
}
}
- });
-
- Composite buttons = SWTFactory.createComposite(parent, font, 1, 1, GridData.VERTICAL_ALIGN_BEGINNING, 0, 0);
-
- fAddButton = SWTFactory.createPushButton(buttons, "&Add...", null);
- fAddButton.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- addVM();
- }
});
-
- fEditButton= SWTFactory.createPushButton(buttons, "&Edit...", null);
- fEditButton.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- editVM();
- }
- });
-
- fRemoveButton= SWTFactory.createPushButton(buttons, "&Remove", null);
- fRemoveButton.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- removeVMs();
- }
- });
-
- SWTFactory.createVerticalSpacer(parent, 1);
-
- fSearchButton = SWTFactory.createPushButton(buttons, "&Search...", null);
- fSearchButton.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- search();
- }
- });
-
- fillWithWorkspaceJREs();
- enableButtons();
- fAddButton.setEnabled(JavaRuntime.getVMInstallTypes().length > 0);
}
public String generateName(String name){
@@ -290,7 +340,7 @@
}
private void sortByType() {
- fVMList.setComparator(new ViewerComparator() {
+ runtimesTableViewer.setComparator(new ViewerComparator() {
public int compare(Viewer viewer, Object e1, Object e2) {
if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
IVMInstall left= (IVMInstall)e1;
@@ -314,7 +364,7 @@
}
private void sortByName() {
- fVMList.setComparator(new ViewerComparator() {
+ runtimesTableViewer.setComparator(new ViewerComparator() {
public int compare(Viewer viewer, Object e1, Object e2) {
if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
IVMInstall left= (IVMInstall)e1;
@@ -335,7 +385,7 @@
* Sorts by VM location.
*/
private void sortByLocation() {
- fVMList.setComparator(new ViewerComparator() {
+ runtimesTableViewer.setComparator(new ViewerComparator() {
public int compare(Viewer viewer, Object e1, Object e2) {
if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
IVMInstall left= (IVMInstall)e1;
@@ -356,22 +406,21 @@
* Enables the buttons based on selected items counts in the viewer
*/
private void enableButtons() {
- IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection();
+ IStructuredSelection selection = (IStructuredSelection) runtimesTableViewer.getSelection();
int selectionCount= selection.size();
- fEditButton.setEnabled(selectionCount == 1);
-// fCopyButton.setEnabled(selectionCount > 0);
- if (selectionCount > 0 && selectionCount < fVMList.getTable().getItemCount()) {
+ editButton.setEnabled(selectionCount == 1);
+ if (selectionCount > 0 && selectionCount < runtimesTableViewer.getTable().getItemCount()) {
Iterator iterator = selection.iterator();
while (iterator.hasNext()) {
IVMInstall install = (IVMInstall)iterator.next();
if (isContributed(install)) {
- fRemoveButton.setEnabled(false);
+ removeButton.setEnabled(false);
return;
}
}
- fRemoveButton.setEnabled(true);
+ removeButton.setEnabled(true);
} else {
- fRemoveButton.setEnabled(false);
+ removeButton.setEnabled(false);
}
}
@@ -390,7 +439,7 @@
* @return control
*/
public Control getControl() {
- return fControl;
+ return control;
}
/**
@@ -403,8 +452,8 @@
for (int i = 0; i < vms.length; i++) {
fVMs.add(vms[i]);
}
- fVMList.setInput(fVMs);
- fVMList.refresh();
+ runtimesTableViewer.setInput(fVMs);
+ runtimesTableViewer.refresh();
}
/**
@@ -437,7 +486,7 @@
*/
public void vmAdded(IVMInstall vm) {
fVMs.add(vm);
- fVMList.refresh();
+ runtimesTableViewer.refresh();
}
/**
@@ -457,7 +506,7 @@
* Performs the edit VM action when the Edit... button is pressed
*/
private void editVM() {
- IStructuredSelection selection= (IStructuredSelection)fVMList.getSelection();
+ IStructuredSelection selection= (IStructuredSelection)runtimesTableViewer.getSelection();
VMStandin vm= (VMStandin)selection.getFirstElement();
if (vm == null) {
return;
@@ -488,7 +537,7 @@
* Performs the remove VM(s) action when the Remove... button is pressed
*/
private void removeVMs() {
- IStructuredSelection selection= (IStructuredSelection)fVMList.getSelection();
+ IStructuredSelection selection= (IStructuredSelection)runtimesTableViewer.getSelection();
IVMInstall[] vms = new IVMInstall[selection.size()];
Iterator iter = selection.iterator();
int i = 0;
@@ -509,7 +558,7 @@
for (int i = 0; i < vms.length; i++) {
fVMs.remove(vms[i]);
}
- fVMList.refresh();
+ runtimesTableViewer.refresh();
IStructuredSelection curr = (IStructuredSelection) getSelection();
if (!curr.equals(prev)) {
IVMInstall[] installs = getJREs();
@@ -759,7 +808,7 @@
* @return the checked JRE or <code>null</code> if none
*/
public IVMInstall getCheckedJRE() {
- Object[] objects = fVMList.getCheckedElements();
+ Object[] objects = runtimesTableViewer.getCheckedElements();
if (objects.length == 0) {
return null;
}
@@ -774,9 +823,9 @@
* @param qualifier key qualifier
*/
public void saveColumnSettings(IDialogSettings settings, String qualifier) {
- int columnCount = fTable.getColumnCount();
+ int columnCount = runtimesTable.getColumnCount();
for (int i = 0; i < columnCount; i++) {
- settings.put(qualifier + ".columnWidth" + i, fTable.getColumn(i).getWidth()); //$NON-NLS-1$
+ settings.put(qualifier + ".columnWidth" + i, runtimesTable.getColumn(i).getWidth()); //$NON-NLS-1$
}
settings.put(qualifier + ".sortColumn", fSortColumn); //$NON-NLS-1$
}
@@ -789,7 +838,7 @@
* @param qualifier key to restore settings from
*/
public void restoreColumnSettings(IDialogSettings settings, String qualifier) {
- fVMList.getTable().layout(true);
+ runtimesTableViewer.getTable().layout(true);
restoreColumnWidths(settings, qualifier);
try {
fSortColumn = settings.getInt(qualifier + ".sortColumn"); //$NON-NLS-1$
@@ -810,23 +859,22 @@
}
private void restoreColumnWidths(IDialogSettings settings, String qualifier) {
- int columnCount = fTable.getColumnCount();
+ int columnCount = runtimesTable.getColumnCount();
for (int i = 0; i < columnCount; i++) {
int width = -1;
try {
width = settings.getInt(qualifier + ".columnWidth" + i);
} catch (NumberFormatException e) {}
- if ((width <= 0) || (i == fTable.getColumnCount() - 1)) {
- fTable.getColumn(i).pack();
+ if ((width <= 0) || (i == runtimesTable.getColumnCount() - 1)) {
+ runtimesTable.getColumn(i).pack();
} else {
- fTable.getColumn(i).setWidth(width);
+ runtimesTable.getColumn(i).setWidth(width);
}
}
}
- protected void fillWithWorkspaceJREs() {
- // fill with JREs
+ protected void fillWithWorkspaceForgeRuntimes() {
List standins = new ArrayList();
IVMInstallType[] types = JavaRuntime.getVMInstallTypes();
for (int i = 0; i < types.length; i++) {
13 years, 10 months
JBoss Tools SVN: r29687 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:08:22 -0500 (Thu, 10 Mar 2011)
New Revision: 29687
Removed:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeRuntimesPreferencePage.java
Log:
even more runtime preferences stuf
- page is working
- initialization is working
Deleted: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeRuntimesPreferencePage.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeRuntimesPreferencePage.java 2011-03-10 23:07:59 UTC (rev 29686)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeRuntimesPreferencePage.java 2011-03-10 23:08:22 UTC (rev 29687)
@@ -1,144 +0,0 @@
-package org.jboss.tools.seam.forge.preferences;
-
-
-import java.io.File;
-
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.LibraryLocation;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.seam.forge.ForgePlugin;
-
-public class ForgeRuntimesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private InstalledForgeRuntimesBlock fJREBlock;
-
- public ForgeRuntimesPreferencePage() {
- super("Installed Forge Runtimes");
- }
-
- public void init(IWorkbench workbench) {
- }
-
- private void initDefaultVM() {
- IVMInstall realDefault= JavaRuntime.getDefaultVMInstall();
- if (realDefault != null) {
- IVMInstall[] vms= fJREBlock.getJREs();
- for (int i = 0; i < vms.length; i++) {
- IVMInstall fakeVM= vms[i];
- if (fakeVM.equals(realDefault)) {
- verifyDefaultVM(fakeVM);
- break;
- }
- }
- }
- }
-
- protected Control createContents(Composite ancestor) {
- initializeDialogUnits(ancestor);
- noDefaultAndApplyButton();
- createLayout(ancestor);
- createWrapLabel(ancestor);
- createVerticalSpacer(ancestor);
- createInstalledForgeRuntimesBlock(ancestor);
- initDefaultVM();
- applyDialogFont(ancestor);
- return ancestor;
- }
-
- private void createInstalledForgeRuntimesBlock(Composite ancestor) {
- fJREBlock = new InstalledForgeRuntimesBlock();
- fJREBlock.createControl(ancestor);
- Control control = fJREBlock.getControl();
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 1;
- control.setLayoutData(data);
- fJREBlock.restoreColumnSettings(
- ForgePlugin.getDefault().getDialogSettings(),
- ForgePlugin.PLUGIN_ID + ".forge_runtimes_preference_page_context");
-
- }
-
- private void createLayout(Composite ancestor) {
- GridLayout layout= new GridLayout();
- layout.numColumns= 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- ancestor.setLayout(layout);
- }
-
- private Label createWrapLabel(Composite parent) {
- Label l = new Label(parent, SWT.NONE | SWT.WRAP);
- l.setFont(parent.getFont());
- l.setText("Add, remove or edit Forge runtimes. By default, the checked Forge runtime is used when launching Forge.");
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 250;
- l.setLayoutData(gd);
- return l;
- }
-
- private void createVerticalSpacer(Composite parent) {
- Label lbl = new Label(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns;
- lbl.setLayoutData(gd);
- }
-
- public boolean performOk() {
- final boolean[] canceled = new boolean[] {false};
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- IVMInstall defaultVM = getCurrentDefaultVM();
- IVMInstall[] vms = fJREBlock.getJREs();
- ForgeRuntimesUpdater updater = new ForgeRuntimesUpdater();
- if (!updater.updateJRESettings(vms, defaultVM)) {
- canceled[0] = true;
- }
- }
- });
- if(canceled[0]) {
- return false;
- }
- fJREBlock.saveColumnSettings(
- ForgePlugin.getDefault().getDialogSettings(),
- ForgePlugin.PLUGIN_ID + ".forge_runtimes_preference_page_context");
- return super.performOk();
- }
-
- private void verifyDefaultVM(IVMInstall vm) {
- if (vm != null) {
- LibraryLocation[] locations= JavaRuntime.getLibraryLocations(vm);
- boolean exist = true;
- for (int i = 0; i < locations.length; i++) {
- exist = exist && new File(locations[i].getSystemLibraryPath().toOSString()).exists();
- }
- if (exist) {
- fJREBlock.setCheckedJRE(vm);
- } else {
- fJREBlock.removeJREs(new IVMInstall[]{vm});
- IVMInstall def = JavaRuntime.getDefaultVMInstall();
- if (def == null) {
- fJREBlock.setCheckedJRE(null);
- } else {
- fJREBlock.setCheckedJRE(def);
- }
- return;
- }
- } else {
- fJREBlock.setCheckedJRE(null);
- }
- }
-
- private IVMInstall getCurrentDefaultVM() {
- return fJREBlock.getCheckedJRE();
- }
-}
13 years, 10 months
JBoss Tools SVN: r29686 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:07:59 -0500 (Thu, 10 Mar 2011)
New Revision: 29686
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferencePage.java
Log:
Copied: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferencePage.java (from rev 29415, trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeRuntimesPreferencePage.java)
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferencePage.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferencePage.java 2011-03-10 23:07:59 UTC (rev 29686)
@@ -0,0 +1,373 @@
+package org.jboss.tools.seam.forge.preferences;
+
+
+import java.util.Iterator;
+
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.seam.forge.launching.ForgeRuntime;
+
+public class ForgeInstallationsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ private final int DEFAULT_COLUMN_WIDTH = 350/3 +1;
+
+// private InstalledForgeRuntimesBlock fJREBlock;
+
+// private Table runtimesTable;
+ private CheckboxTableViewer runtimesTableViewer ;
+ private Button removeButton;
+ private Button editButton;
+ private int sortColumn = 0;
+
+ public ForgeInstallationsPreferencePage() {
+ super("Installed Forge Runtimes");
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+// private void initDefaultVM() {
+// IVMInstall realDefault= JavaRuntime.getDefaultVMInstall();
+// if (realDefault != null) {
+//// IVMInstall[] vms= fJREBlock.getJREs();
+// IVMInstall[] vms= (IVMInstall[])runtimesTableViewer.getInput();
+// for (int i = 0; i < vms.length; i++) {
+// IVMInstall fakeVM= vms[i];
+// if (fakeVM.equals(realDefault)) {
+// verifyDefaultVM(fakeVM);
+// break;
+// }
+// }
+// }
+// }
+
+ protected Control createContents(Composite ancestor) {
+// initializeDialogUnits(ancestor);
+ noDefaultAndApplyButton();
+ createLayout(ancestor);
+ createWrapLabel(ancestor);
+ createVerticalSpacer(ancestor);
+ createPageBody(ancestor);
+// createInstalledForgeRuntimesBlock(ancestor);
+ initForgeInstallations();
+ sortByName();
+ enableButtons();
+// applyDialogFont(ancestor);
+ return ancestor;
+ }
+
+ private void createPageBody(Composite ancestor) {
+ Composite pageBody = createPageBodyControl(ancestor);
+ createTitleLabel(pageBody);
+ createRuntimesArea(pageBody);
+ createButtonsArea(pageBody);
+ }
+
+ private void createButtonsArea(Composite parent) {
+ Composite buttons = createButtonsComposite(parent);
+ createAddButton(buttons);
+ createEditButton(buttons);
+ createRemoveButton(buttons);
+ }
+
+ private void createRemoveButton(Composite buttons) {
+ removeButton = new Button(buttons, SWT.PUSH);
+ removeButton.setText("&Remove");
+ removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ removeButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ ForgeInstallationsPreferenceHelper.removeVMs();
+ }
+ });
+ }
+
+ private void createAddButton(Composite buttons) {
+ Button addButton = new Button(buttons, SWT.PUSH);
+ addButton.setText("&Add...");
+ addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ addButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ ForgeInstallationsPreferenceHelper.addVM();
+ }
+ });
+ }
+
+ private void createEditButton(Composite buttons) {
+ editButton = new Button(buttons, SWT.PUSH);
+ editButton.setText("&Edit...");
+ editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ editButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ ForgeInstallationsPreferenceHelper.editVM();
+ }
+ });
+ }
+
+ private Composite createButtonsComposite(Composite parent) {
+ Composite buttons = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ buttons.setLayout(layout);
+ GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+ gd.horizontalSpan = 1;
+ buttons.setLayoutData(gd);
+ return buttons;
+ }
+
+ private void createTitleLabel(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Installed Forge Runtimes:");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ gd.grabExcessHorizontalSpace = false;
+ label.setLayoutData(gd);
+ }
+
+ private void createRuntimesArea(Composite parent) {
+ Table runtimesTable = createRuntimesTable(parent);
+ createNameColumn(runtimesTable);
+ createLocationColumn(runtimesTable);
+ createRuntimesTableViewer(runtimesTable);
+ }
+
+ private void createRuntimesTableViewer(Table table) {
+ runtimesTableViewer = new CheckboxTableViewer(table);
+ runtimesTableViewer.setLabelProvider(new ForgeInstallationLabelProvider());
+ runtimesTableViewer.setContentProvider(ArrayContentProvider.getInstance());
+ runtimesTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent evt) {
+ enableButtons();
+ }
+ });
+// runtimesTableViewer.addCheckStateListener(new ICheckStateListener() {
+// public void checkStateChanged(CheckStateChangedEvent event) {
+// if (event.getChecked()) {
+// setCheckedJRE((IVMInstall)event.getElement());
+// } else {
+// setCheckedJRE(null);
+// }
+// }
+// });
+ runtimesTableViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent e) {
+ if (!runtimesTableViewer.getSelection().isEmpty()) {
+ ForgeInstallationsPreferenceHelper.editVM();
+ }
+ }
+ });
+ }
+
+ private void createLocationColumn(Table table) {
+ TableColumn column = new TableColumn(table, SWT.NULL);
+ column.setText("Location");
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ sortByLocation();
+ }
+ });
+ column.setWidth(DEFAULT_COLUMN_WIDTH);
+ }
+
+ private void createNameColumn(Table table) {
+ TableColumn column = new TableColumn(table, SWT.NULL);
+ column.setText("Name");
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ sortByName();
+ }
+ });
+ column.setWidth(DEFAULT_COLUMN_WIDTH);
+ }
+
+ private Table createRuntimesTable(Composite parent) {
+ Table runtimesTable= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 250;
+ gd.widthHint = 350;
+ runtimesTable.setLayoutData(gd);
+ runtimesTable.setHeaderVisible(true);
+ runtimesTable.setLinesVisible(true);
+ runtimesTable.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent event) {
+ if (event.character == SWT.DEL && event.stateMask == 0) {
+ if (removeButton.isEnabled()){
+ ForgeInstallationsPreferenceHelper.removeVMs();
+ }
+ }
+ }
+ });
+ return runtimesTable;
+ }
+
+ private Composite createPageBodyControl(Composite ancestor) {
+ Composite result = new Composite(ancestor, SWT.NONE);
+ result.setLayout(new GridLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ result.setLayoutData(gd);
+ return result;
+ }
+
+ private void createLayout(Composite ancestor) {
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 1;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ ancestor.setLayout(layout);
+ }
+
+ private Label createWrapLabel(Composite parent) {
+ Label l = new Label(parent, SWT.NONE | SWT.WRAP);
+ l.setFont(parent.getFont());
+ l.setText("Add, remove or edit Forge runtimes. By default, the checked Forge runtime is used when launching Forge.");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = 250;
+ l.setLayoutData(gd);
+ return l;
+ }
+
+ private void createVerticalSpacer(Composite parent) {
+ Label lbl = new Label(parent, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns;
+ lbl.setLayoutData(gd);
+ }
+
+ private void initForgeInstallations() {
+ runtimesTableViewer.setInput(ForgeRuntime.getInstallations());
+ runtimesTableViewer.setCheckedElements(new Object[] { ForgeRuntime.getDefaultInstallation() });
+ runtimesTableViewer.refresh();
+ }
+
+ private void sortByName() {
+ runtimesTableViewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
+ IVMInstall left= (IVMInstall)e1;
+ IVMInstall right= (IVMInstall)e2;
+ return left.getName().compareToIgnoreCase(right.getName());
+ }
+ return super.compare(viewer, e1, e2);
+ }
+
+ public boolean isSorterProperty(Object element, String property) {
+ return true;
+ }
+ });
+ sortColumn = 1;
+ }
+
+ private void sortByLocation() {
+ runtimesTableViewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
+ IVMInstall left= (IVMInstall)e1;
+ IVMInstall right= (IVMInstall)e2;
+ return left.getInstallLocation().getAbsolutePath().compareToIgnoreCase(right.getInstallLocation().getAbsolutePath());
+ }
+ return super.compare(viewer, e1, e2);
+ }
+
+ public boolean isSorterProperty(Object element, String property) {
+ return true;
+ }
+ });
+ sortColumn = 2;
+ }
+
+ private void enableButtons() {
+ IStructuredSelection selection = (IStructuredSelection) runtimesTableViewer.getSelection();
+ int selectionCount= selection.size();
+ editButton.setEnabled(selectionCount == 1);
+ if (selectionCount > 0 && selectionCount < runtimesTableViewer.getTable().getItemCount()) {
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ IVMInstall install = (IVMInstall)iterator.next();
+// if (isContributed(install)) {
+// removeButton.setEnabled(false);
+// return;
+// }
+ }
+ removeButton.setEnabled(true);
+ } else {
+ removeButton.setEnabled(false);
+ }
+ }
+
+ public boolean performOk() {
+ final boolean[] canceled = new boolean[] {false};
+ BusyIndicator.showWhile(null, new Runnable() {
+ public void run() {
+// IVMInstall defaultVM = getCurrentDefaultVM();
+//// IVMInstall[] vms = fJREBlock.getJREs();
+// IVMInstall[] vms = (IVMInstall[])runtimesTableViewer.getInput();
+// ForgeRuntimesUpdater updater = new ForgeRuntimesUpdater();
+// if (!updater.updateJRESettings(vms, defaultVM)) {
+// canceled[0] = true;
+// }
+ }
+ });
+ if(canceled[0]) {
+ return false;
+ }
+// fJREBlock.saveColumnSettings(
+// ForgePlugin.getDefault().getDialogSettings(),
+// ForgePlugin.PLUGIN_ID + ".forge_runtimes_preference_page_context");
+ return super.performOk();
+ }
+
+// private void verifyDefaultVM(IVMInstall vm) {
+// if (vm != null) {
+// LibraryLocation[] locations= JavaRuntime.getLibraryLocations(vm);
+// boolean exist = true;
+// for (int i = 0; i < locations.length; i++) {
+// exist = exist && new File(locations[i].getSystemLibraryPath().toOSString()).exists();
+// }
+// if (exist) {
+// fJREBlock.setCheckedJRE(vm);
+// } else {
+// fJREBlock.removeJREs(new IVMInstall[]{vm});
+// IVMInstall def = JavaRuntime.getDefaultVMInstall();
+// if (def == null) {
+// fJREBlock.setCheckedJRE(null);
+// } else {
+// fJREBlock.setCheckedJRE(def);
+// }
+// return;
+// }
+// } else {
+// fJREBlock.setCheckedJRE(null);
+// }
+// }
+
+// private IVMInstall getCurrentDefaultVM() {
+// return fJREBlock.getCheckedJRE();
+// }
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months
JBoss Tools SVN: r29685 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:07:45 -0500 (Thu, 10 Mar 2011)
New Revision: 29685
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferenceHelper.java
Log:
Added: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferenceHelper.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferenceHelper.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferenceHelper.java 2011-03-10 23:07:45 UTC (rev 29685)
@@ -0,0 +1,19 @@
+package org.jboss.tools.seam.forge.preferences;
+
+
+public class ForgeInstallationsPreferenceHelper {
+
+ public static void removeVMs() {
+ // TODO Auto-generated method stub
+ }
+
+ public static void addVM() {
+ // TODO Auto-generated method stub
+ }
+
+ public static void editVM() {
+ // TODO Auto-generated method stub
+ }
+
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationsPreferenceHelper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months
JBoss Tools SVN: r29684 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:07:33 -0500 (Thu, 10 Mar 2011)
New Revision: 29684
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationLabelProvider.java
Log:
Added: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationLabelProvider.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationLabelProvider.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationLabelProvider.java 2011-03-10 23:07:33 UTC (rev 29684)
@@ -0,0 +1,27 @@
+package org.jboss.tools.seam.forge.preferences;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.seam.forge.launching.ForgeInstallation;
+
+public class ForgeInstallationLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof ForgeInstallation) {
+ ForgeInstallation forgeInstallation= (ForgeInstallation)element;
+ switch(columnIndex) {
+ case 0:
+ return forgeInstallation.getName();
+ case 1:
+ return forgeInstallation.getLocation();
+ }
+ }
+ return element.toString();
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/preferences/ForgeInstallationLabelProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months
JBoss Tools SVN: r29683 - in trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge: launching and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:06:58 -0500 (Thu, 10 Mar 2011)
New Revision: 29683
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeInstallation.java
Log:
even more runtime preferences stuf
- page is working
- initialization is working
Copied: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeInstallation.java (from rev 29415, trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/runtime/ForgeRuntime.java)
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeInstallation.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeInstallation.java 2011-03-10 23:06:58 UTC (rev 29683)
@@ -0,0 +1,21 @@
+package org.jboss.tools.seam.forge.launching;
+
+public class ForgeInstallation {
+
+ private String name;
+ private String location;
+
+ public ForgeInstallation(String name, String location) {
+ this.name = name;
+ this.location = location;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeInstallation.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months
JBoss Tools SVN: r29682 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:06:37 -0500 (Thu, 10 Mar 2011)
New Revision: 29682
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StopDelegate.java
Log:
even more runtime preferences stuf
- page is working
- initialization is working
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StopDelegate.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StopDelegate.java 2011-03-10 23:06:24 UTC (rev 29681)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StopDelegate.java 2011-03-10 23:06:37 UTC (rev 29682)
@@ -4,13 +4,13 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-import org.jboss.tools.seam.forge.runtime.Manager;
+import org.jboss.tools.seam.forge.launching.ForgeRuntime;
public class StopDelegate implements IViewActionDelegate {
@Override
public void run(IAction action) {
- Manager.INSTANCE.stopForge();
+ ForgeRuntime.INSTANCE.stopForge();
}
@Override
13 years, 10 months
JBoss Tools SVN: r29681 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:06:24 -0500 (Thu, 10 Mar 2011)
New Revision: 29681
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StartDelegate.java
Log:
even more runtime preferences stuf
- page is working
- initialization is working
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StartDelegate.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StartDelegate.java 2011-03-10 23:06:08 UTC (rev 29680)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/action/StartDelegate.java 2011-03-10 23:06:24 UTC (rev 29681)
@@ -4,13 +4,13 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-import org.jboss.tools.seam.forge.runtime.Manager;
+import org.jboss.tools.seam.forge.launching.ForgeRuntime;
public class StartDelegate implements IViewActionDelegate {
@Override
public void run(IAction action) {
- Manager.INSTANCE.startForge();
+ ForgeRuntime.INSTANCE.startForge();
}
@Override
13 years, 10 months
JBoss Tools SVN: r29680 - trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-03-10 18:06:08 -0500 (Thu, 10 Mar 2011)
New Revision: 29680
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/ForgePlugin.java
Log:
even more runtime preferences stuf
- page is working
- initialization is working
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/ForgePlugin.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/ForgePlugin.java 2011-03-10 23:03:20 UTC (rev 29679)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/ForgePlugin.java 2011-03-10 23:06:08 UTC (rev 29680)
@@ -3,7 +3,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.jboss.tools.seam.forge.runtime.Manager;
+import org.jboss.tools.seam.forge.launching.ForgeRuntime;
import org.osgi.framework.BundleContext;
public class ForgePlugin extends AbstractUIPlugin {
@@ -18,8 +18,8 @@
}
public void stop(BundleContext context) throws Exception {
- if (Manager.INSTANCE.isForgeRunning()) {
- Manager.INSTANCE.stopForge();
+ if (ForgeRuntime.INSTANCE.isForgeRunning()) {
+ ForgeRuntime.INSTANCE.stopForge();
}
plugin = null;
super.stop(context);
13 years, 10 months