JBoss Tools SVN: r8072 - in trunk: as/plugins/org.jboss.ide.eclipse.as.ui/icons and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-05-13 22:47:59 -0400 (Tue, 13 May 2008)
New Revision: 8072
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/restart.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/start.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/stop.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/webxml.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/debug.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/server.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/AbstractServerActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ChangeTimeStampActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/DebugServerActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/RunServerActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/SelectServerActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerActionMessages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManagerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/StopServerActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/messages.properties
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
JBIDE-2209
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/restart.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/restart.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/start.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/start.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/stop.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/stop.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/webxml.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/webxml.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/debug.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/debug.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/actions/xpl/server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/AbstractServerActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/AbstractServerActionDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/AbstractServerActionDelegate.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public abstract class AbstractServerActionDelegate implements IWorkbenchWindowActionDelegate, ServerManagerListener {
+
+ static Map<String, AbstractServerActionDelegate> delegates = new HashMap<String,AbstractServerActionDelegate>();
+
+ protected IWorkbenchWindow window;
+ protected IAction action;
+ protected boolean isInitialised = false;
+
+ public AbstractServerActionDelegate() {
+ delegates.put(getClass().getName(), this);
+ }
+
+ public static void updateAll() {
+ AbstractServerActionDelegate[] ds = delegates.values().toArray(new AbstractServerActionDelegate[0]);
+ for (int i = 0; i < ds.length; i++) {
+ try {
+ ds[i].update();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ initModel();
+ }
+ });
+ }
+
+ private void initModel() {
+ ServerManager.getInstance().addListener(this);
+ update();
+ isInitialised = true;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(this.action == action) return;
+ this.action = action;
+ serverManagerChanged();
+ }
+
+ public void run(IAction action) {
+ if(!isInitialised) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if(isActionEnabled()) {
+ _run();
+ }
+ }
+ });
+ } else {
+ _run();
+ }
+ }
+
+ private void _run() {
+ try {
+ doRun();
+ } catch (Exception e) {
+ }
+ }
+
+ public void dispose() {}
+ protected void doRun() {}
+
+ protected boolean isActionEnabled() {
+ return true;
+ }
+
+ protected void update() {
+ if(action != null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ action.setEnabled(isActionEnabled());
+ setToolTip();
+ }
+ });
+ }
+ }
+
+ public void serverManagerChanged() {
+ update();
+ }
+
+ protected void setToolTip() {
+ if(action != null) {
+ String tooltip = computeToolTip();
+ if(tooltip != null) action.setToolTipText(tooltip);
+ }
+ }
+
+ protected String computeToolTip() {
+ return null;
+ }
+
+
+ // a stub that can be used by subclasses
+ protected static ISelectionProvider getSelectionProvider() {
+ return new ISelectionProvider() {
+ public void addSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ }
+ public ISelection getSelection() {
+ return null;
+ }
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ }
+ public void setSelection(ISelection selection) {
+ }
+ };
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ChangeTimeStampActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ChangeTimeStampActionDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ChangeTimeStampActionDelegate.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+
+public class ChangeTimeStampActionDelegate implements IWorkbenchWindowActionDelegate {
+
+ protected IWorkbenchWindow window;
+ String tooltip = null;
+ IProject project = null;
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(project == null && action.isEnabled()) action.setEnabled(false);
+ if(tooltip != null && (selection instanceof IStructuredSelection)) {
+ Object o = ((IStructuredSelection)selection).getFirstElement();
+ IProject p = getProject(o);
+ if(p != null) {
+ project = p;
+ action.setEnabled(computeEnabled());
+ action.setToolTipText(NLS.bind(ServerActionMessages.CHANGE_TIME_STAMP,project.getName()));
+ return;
+ }
+ }
+ tooltip = ServerActionMessages.CHANGE_TIME_STAMP_DEFAULT;
+ action.setToolTipText(tooltip);
+ }
+
+ IProject getProject(Object selection) {
+ if(selection instanceof IResource) {
+ return ((IResource)selection).getProject();
+ } else if(selection instanceof IAdaptable) {
+ Object r = ((IAdaptable)selection).getAdapter(IResource.class);
+ return r instanceof IResource ? ((IResource)r).getProject() : null;
+ }
+ return null;
+ }
+
+ protected boolean computeEnabled() {
+ if(project == null || !project.isAccessible()) return false;
+ boolean isWar = J2EEProjectUtilities.isDynamicWebProject(project);
+ boolean isEar = J2EEProjectUtilities.isEARProject(project);
+ boolean isEJB = J2EEProjectUtilities.isEJBProject(project);
+ return isEar || isEJB || isWar;
+ }
+
+ public void run(IAction action) {
+ try {
+ changeTimeStamp(project);
+ } catch (Exception e) {
+
+ }
+ }
+
+ public void dispose() {
+ window = null;
+ }
+
+ public static void changeTimeStamp(IProject project) throws CoreException {
+ if(project == null || !project.isAccessible()) return;
+ List<IFile> fs = getFilesToTouch(project);
+ for (int i = 0; i < fs.size(); i++) {
+ IFile f = (IFile)fs.get(i);
+ f.setLocalTimeStamp(System.currentTimeMillis());
+ f.touch(new NullProgressMonitor()); // done so deployers/listeners can detect the actual change.
+ }
+ }
+
+ private static List<IFile> getFilesToTouch(IProject project) {
+ List<IFile> fs = new ArrayList<IFile>();
+ if(project == null || !project.isAccessible()) return fs;
+ boolean isWar = J2EEProjectUtilities.isDynamicWebProject(project);
+ boolean isEar = J2EEProjectUtilities.isEARProject(project);
+
+ boolean isReferencedByEar = false;
+ if(!isEar) {
+ IProject[] ps = J2EEProjectUtilities.getReferencingEARProjects(project);
+ for (int i = 0; i < ps.length; i++) {
+ fs.addAll(getFilesToTouch(ps[i]));
+ isReferencedByEar = true;
+ }
+ }
+ if(isEar) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IPath path = component.getRootFolder().getProjectRelativePath();
+ IFile f = project.getFile(path.append("META-INF").append("application.xml"));
+ if(f != null && f.exists()) {
+ fs.add(f);
+ }
+ }
+ if(isWar && !isReferencedByEar) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IPath path = component.getRootFolder().getProjectRelativePath();
+ IFile f = project.getFile(path.append("WEB-INF").append("web.xml"));
+ if(f != null && f.exists()) {
+ fs.add(f);
+ }
+ }
+ return fs;
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/DebugServerActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/DebugServerActionDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/DebugServerActionDelegate.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IServer;
+
+public class DebugServerActionDelegate extends RunServerActionDelegate {
+
+ protected String getLaunchMode() {
+ return ILaunchManager.DEBUG_MODE;
+ }
+
+
+ protected String computeToolTip() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
+ if( selected.getServerState() == IServer.STATE_STARTED)
+ return NLS.bind(ServerActionMessages.RESTART_IN_DEBUG_MODE, name);
+ return NLS.bind(ServerActionMessages.START_IN_DEBUG_MODE, name); //$NON-NLS-2$
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/RunServerActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/RunServerActionDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/RunServerActionDelegate.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
+
+public class RunServerActionDelegate extends AbstractServerActionDelegate {
+
+ private StartAction delegate;
+ public void init(IWorkbenchWindow window) {
+ super.init(window);
+ update();
+ }
+
+ protected void doRun() {
+ IServer server = ServerManager.getInstance().getSelectedServer();
+ if(server == null)
+ return;
+ delegate = new StartAction(window.getShell(), getSelectionProvider(), getLaunchMode());
+ if( delegate.accept(server))
+ delegate.perform(server);
+ updateAll();
+ }
+
+ protected String getLaunchMode() {
+ return ILaunchManager.RUN_MODE;
+ }
+
+ protected boolean isActionEnabled() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ return (selected != null
+ && selected.getServerState() != IServer.STATE_STARTING);
+ }
+
+ protected String computeToolTip() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
+ if( selected.getServerState() == IServer.STATE_STARTED)
+ return NLS.bind(ServerActionMessages.RESTART_IN_RUN_MODE, name);
+ return NLS.bind(ServerActionMessages.START_IN_RUN_MODE, name);
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/SelectServerActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/SelectServerActionDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/SelectServerActionDelegate.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.wizard.NewServerWizard;
+import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
+
+
+public class SelectServerActionDelegate extends AbstractServerActionDelegate
+ implements IWorkbenchWindowPulldownDelegate {
+
+ private ArrayList images = new ArrayList();
+
+ protected void safeSelectionChanged(IAction action, ISelection selection) {
+ this.action = action;
+ update();
+ }
+
+ protected void update() {
+ if (action == null) return;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ update0();
+ }
+ });
+ }
+
+ private void update0() {
+ if(action == null) return;
+ IServer server = ServerManager.getInstance().getSelectedServer();
+ ImageDescriptor id = ImageResource.getImageDescriptor(server.getServerType().getId());
+ action.setImageDescriptor(id);
+ action.setText(null);
+ action.setToolTipText(ServerActionMessages.SELECT_A_SERVER);
+ }
+
+ protected void doRun() {
+ getMenu(window.getShell()).setVisible(true);
+ }
+
+ public void dispose() {
+ action = null;
+ }
+
+ public Menu getMenu(Control parent) {
+ cleanImages();
+
+ Menu menu = new Menu(parent);
+ IServer[] servers = ServerManager.getInstance().getServers();
+ for (int i = 0; i < servers.length; i++) {
+ createServerItem(menu, servers[i]);
+ }
+ new MenuItem(menu, SWT.SEPARATOR);
+ createNewServerItem(menu);
+ return menu;
+ }
+
+ // prevent memory leaks
+ protected void cleanImages() {
+ Iterator<Image> i = images.iterator();
+ while(i.hasNext())
+ ((Image)i.next()).dispose();
+ images.clear();
+ }
+
+ private void createServerItem(Menu menu, final IServer server) {
+ MenuItem item = new MenuItem(menu, SWT.RADIO);
+ if(server == ServerManager.getInstance().getSelectedServer()) {
+ item.setSelection(true);
+ }
+
+ item.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ ServerManager.getInstance().setSelectedServer(server.getId());
+ update();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ item.setText(server.getName());
+ ImageDescriptor id = ImageResource.getImageDescriptor(server.getServerType().getId());
+ Image i = id.createImage();
+ images.add(i);
+ item.setImage(i);
+ }
+
+ private void createNewServerItem(Menu menu) {
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("New server...");
+ item.setImage(JBossServerUISharedImages.getImage(JBossServerUISharedImages.GENERIC_SERVER_IMAGE));
+ item.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ newServer();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ newServer();
+ widgetSelected(e);
+ }
+ });
+ }
+
+ private void newServer() {
+ NewServerWizard wizard = new NewServerWizard();
+ WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
+ if (dialog.open() != Window.CANCEL) {
+ IServer server = (IServer)wizard.getRootFragment().getTaskModel().getObject(TaskModel.TASK_SERVER);
+ if(server != null) {
+ ServerManager.getInstance().setSelectedServer(server.getId());
+ update();
+ }
+ }
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerActionMessages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerActionMessages.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerActionMessages.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,20 @@
+package org.jboss.tools.wst.server.ui.action;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ServerActionMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.wst.server.ui.action.messages";
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, ServerActionMessages.class);
+ }
+ public static String START_IN_DEBUG_MODE;
+ public static String RESTART_IN_DEBUG_MODE;
+ public static String START_IN_RUN_MODE;
+ public static String RESTART_IN_RUN_MODE;
+ public static String SELECT_A_SERVER;
+ public static String STOP_SERVER;
+ public static String CHANGE_TIME_STAMP;
+ public static String CHANGE_TIME_STAMP_DEFAULT;
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManager.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManager.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerEvent;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+
+public class ServerManager {
+ private static ServerManager instance;
+
+ public static synchronized ServerManager getInstance() {
+ if(instance == null) {
+ instance = new ServerManager();
+ }
+ return instance;
+ }
+
+ private List<ServerManagerListener> listeners = new ArrayList<ServerManagerListener>();
+ private IServerListener serverListener;
+ protected IServer[] servers = new IServer[0];
+
+ IServer selected = null;
+
+ public ServerManager() {
+ serverListener = new ServerListenerImpl();
+ load();
+ }
+
+ void load() {
+ servers = (IServer[])ServerCore.getServers().clone();
+ loadSelectedServer();
+ ServerResourceListenerImpl listener = new ServerResourceListenerImpl();
+ ServerCore.addRuntimeLifecycleListener(listener);
+ ServerCore.addServerLifecycleListener(listener);
+ }
+
+ private void loadSelectedServer() {
+ if(servers == null || servers.length == 0) return;
+ String ds = getDefaultWebServer();
+ IServer s = getServer(ds);
+ if(s == null && servers.length > 0) {
+ s = servers[0];
+ setDefaultWebServer(servers[0].getId());
+ }
+ setSelectedServerInternal(s);
+ }
+
+ public IServer[] getServers() {
+ return servers;
+ }
+
+ public IServer getServer(String serverId) {
+ for (int i = 0; i < servers.length; i++) {
+ if(servers[i].getId().equals(serverId)) {
+ return servers[i];
+ }
+ }
+ return null;
+ }
+
+ public void addListener(ServerManagerListener listener) {
+ if(!listeners.contains(listener)) listeners.add(listener);
+ }
+
+ public void removeListener(ServerManagerListener listener) {
+ listeners.remove(listener);
+ }
+
+ void fire() {
+ ServerManagerListener[] ls = (ServerManagerListener[])listeners.toArray(new ServerManagerListener[0]);
+ for (int i = 0; i < ls.length; i++) {
+ ls[i].serverManagerChanged();
+ }
+ }
+
+ public void setSelectedServer(String id) {
+ IServer server = getServer(id);
+ if(server == selected) return;
+ setSelectedServerInternal(server);
+ setDefaultWebServer(id);
+ fire();
+ }
+
+ private void setSelectedServerInternal(IServer server) {
+ if(selected == server) return;
+ if(selected != null) selected.removeServerListener(serverListener);
+ selected = server;
+ if(selected != null) selected.addServerListener(serverListener);
+ }
+
+ public String getSelectedServerId() {
+ String result = getDefaultWebServer();
+ return result == null ? "" : result;
+ }
+
+ public IServer getSelectedServer() {
+ return selected;
+ }
+
+ class ServerResourceListenerImpl implements IRuntimeLifecycleListener, IServerLifecycleListener {
+ public void serverAdded(IServer server) {
+ IServer[] ss = new IServer[servers.length + 1];
+ System.arraycopy(servers, 0, ss, 0, servers.length);
+ ss[servers.length] = server;
+ servers = ss;
+ loadSelectedServer();
+ fire();
+ }
+ public void serverChanged(IServer server) {
+ fire();
+ }
+ public void serverRemoved(IServer server) {
+ List<IServer> l = new ArrayList<IServer>();
+ for (int i = 0; i < servers.length; i++) {
+ if(servers[i] != server) l.add(servers[i]);
+ }
+ if(l.size() == servers.length) return;
+ servers = l.toArray(new IServer[0]);
+ loadSelectedServer();
+ fire();
+ }
+ public void runtimeAdded(IRuntime runtime) {
+ fire();
+ }
+ public void runtimeChanged(IRuntime runtime) {
+ fire();
+ }
+ public void runtimeRemoved(IRuntime runtime) {
+ fire();
+ }
+ }
+
+ class ServerListenerImpl implements IServerListener {
+ public void serverChanged(ServerEvent arg0) {
+ fire();
+ }
+ }
+
+ static String DEFAULT_WEB_SERVER = JBossServerUIPlugin.PLUGIN_ID + ".defaultWebServer";
+
+ static String getDefaultWebServer() {
+ String result = getInstancePreference(DEFAULT_WEB_SERVER);
+ return result;
+ }
+
+ static void setDefaultWebServer(String value) {
+ getInstancePreferences().put(DEFAULT_WEB_SERVER, value);
+ }
+
+ static IEclipsePreferences getInstancePreferences() {
+ return new InstanceScope().getNode(JBossServerUIPlugin.PLUGIN_ID);
+ }
+
+ static IEclipsePreferences getDefaultPreferences() {
+ return new DefaultScope().getNode(JBossServerUIPlugin.PLUGIN_ID);
+ }
+
+ static String getInstancePreference(String key) {
+ IEclipsePreferences p = getInstancePreferences();
+ String value = p == null ? null : p.get(key, null);
+ return value != null ? value : getDefaultPreference(key);
+ }
+
+ static String getDefaultPreference(String key) {
+ IEclipsePreferences p = getDefaultPreferences();
+ return p == null ? null : p.get(key, null);
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManagerListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManagerListener.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/ServerManagerListener.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+public interface ServerManagerListener {
+ public void serverManagerChanged();
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/StopServerActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/StopServerActionDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/StopServerActionDelegate.java 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.wst.server.ui.action;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
+
+public class StopServerActionDelegate extends AbstractServerActionDelegate {
+ protected StopAction delegate;
+
+ public void init(IWorkbenchWindow window) {
+ super.init(window);
+ update();
+ delegate = new StopAction(window.getShell(), getSelectionProvider());
+ }
+
+ protected void doRun() {
+ IServer server = ServerManager.getInstance().getSelectedServer();
+ if(server == null) return;
+ if( delegate.accept(server))
+ delegate.perform(server);
+ }
+
+ protected boolean isActionEnabled() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ return (selected != null &&
+ (selected.getServerState() == IServer.STATE_STARTED
+ || selected.getServerState() == IServer.STATE_STARTING));
+ }
+
+ protected String computeToolTip() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
+ return NLS.bind(ServerActionMessages.STOP_SERVER, name);
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/messages.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/wst/server/ui/action/messages.properties 2008-05-14 02:47:59 UTC (rev 8072)
@@ -0,0 +1,8 @@
+START_IN_DEBUG_MODE=Start {0} in debug mode
+RESTART_IN_DEBUG_MODE=Restart {0} in debug mode
+START_IN_RUN_MODE=Start {0}
+RESTART_IN_RUN_MODE=Restart {0}
+SELECT_A_SERVER=Select a default server
+STOP_SERVER=Shutdown {0}
+CHANGE_TIME_STAMP=Change Timestamp of {0}
+CHANGE_TIME_STAMP_DEFAULT=Touch descriptors
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-05-14 00:28:48 UTC (rev 8071)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-05-14 02:47:59 UTC (rev 8072)
@@ -347,5 +347,24 @@
id="org.jboss.ide.eclipse.as.ui.launch.securityPollerHandler">
</pollerHandler>
</extension>
+
+
+
+
+ <extension point="org.eclipse.ui.actionSets">
+ <actionSet description="%actionSets.serverActions.description" id="org.jboss.tools.jst.web.ui.server.actionSet" label="%actionSets.serverActions.label" visible="true">
+ <action class="org.jboss.tools.wst.server.ui.action.SelectServerActionDelegate" icon="icons/actions/xpl/server.gif" id="org.jboss.tools.jst.web.ui.action.server.SelectServerActionDelegate" label="label1" style="pulldown" toolbarPath="Normal/SelectServer" tooltip="%actionSets.serverActions.selectServer.label">
+ </action>
+ <action class="org.jboss.tools.wst.server.ui.action.ChangeTimeStampActionDelegate" icon="icons/actions/webxml.gif" id="org.jboss.tools.jst.web.ui.action.server.ChangeTimeStampActionDelegate" label="label2" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.changeWebXmlTimeStamp.label">
+ </action>
+ <action class="org.jboss.tools.wst.server.ui.action.StopServerActionDelegate" icon="icons/actions/stop.gif" id="org.jboss.tools.jst.web.ui.action.server.StopServerActionDelegate" label="label4" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.stopServer.label">
+ </action>
+ <action class="org.jboss.tools.wst.server.ui.action.DebugServerActionDelegate" icon="icons/actions/xpl/debug.gif" id="org.jboss.tools.jst.web.ui.action.server.DebugServerActionDelegate" label="label6" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.startServer.label">
+ </action>
+ <action class="org.jboss.tools.wst.server.ui.action.RunServerActionDelegate" icon="icons/actions/start.gif" id="org.jboss.tools.jst.web.ui.action.server.RunServerActionDelegate" label="label7" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.startServer.label">
+ </action>
+ </actionSet>
+ </extension>
+
</plugin>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2008-05-14 00:28:48 UTC (rev 8071)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2008-05-14 02:47:59 UTC (rev 8072)
@@ -26,6 +26,8 @@
<attributeEditor class="org.jboss.tools.common.model.ui.attribute.editor.ComboBoxEditor" id="LibrarySetList">
</attributeEditor>
</extension>
+
+ <!--
<extension point="org.eclipse.ui.actionSets">
<actionSet description="%actionSets.serverActions.description" id="org.jboss.tools.jst.web.ui.server.actionSet" label="%actionSets.serverActions.label" visible="true">
<action class="org.jboss.tools.jst.web.ui.action.server.SelectServerActionDelegate" icon="images/xstudio/actions/tomcat/tomcat.gif" id="org.jboss.tools.jst.web.ui.action.server.SelectServerActionDelegate" label="%actionSets.serverActions.selectServer.label" style="pulldown" toolbarPath="Normal/SelectServer" tooltip="%actionSets.serverActions.selectServer.label">
@@ -42,6 +44,8 @@
</action>
</actionSet>
</extension>
+ -->
+
<extension id="e" name="XML Editors" point="org.jboss.tools.common.model.ui.xmlEditor">
<xmlEditor
class="org.jboss.tools.jst.web.ui.editors.WebCompoundEditor"
17 years, 11 months
JBoss Tools SVN: r8071 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-05-13 20:28:48 -0400 (Tue, 13 May 2008)
New Revision: 8071
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
Log:
wtp now demands you set server to stopping immediately or it'll fail ;) w00t
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2008-05-13 20:19:32 UTC (rev 8070)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2008-05-14 00:28:48 UTC (rev 8071)
@@ -84,8 +84,8 @@
return;
}
+ serverStopping();
new Thread() {public void run() {
- serverStopping();
boolean success = StopLaunchConfiguration.stop(getServer());
if( !success ) {
if( process != null && !process.isTerminated() ) {
17 years, 11 months
JBoss Tools SVN: r8070 - trunk/jst/features.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-05-13 16:19:32 -0400 (Tue, 13 May 2008)
New Revision: 8070
Removed:
trunk/jst/features/org.jboss.tools.jst.servers.feature/
Log:
removing servers feature
17 years, 11 months
JBoss Tools SVN: r8069 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: objecteditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-05-13 15:51:04 -0400 (Tue, 13 May 2008)
New Revision: 8069
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java
Log:
JBIDE-2204 Unhandled event loop exception when call CA in Insert Tag wizard
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-05-13 19:50:55 UTC (rev 8068)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-05-13 19:51:04 UTC (rev 8069)
@@ -181,6 +181,10 @@
addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
fWizardModel.removePropertyChangeListener(TagAttributesComposite.this);
+ if (context != null) {
+ context.clear();
+ context = null;
+ }
removeDisposeListener(this);
}
});
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java 2008-05-13 19:50:55 UTC (rev 8068)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java 2008-05-13 19:51:04 UTC (rev 8069)
@@ -97,6 +97,10 @@
public void dispose() {
if (xtable!=null) xtable.dispose();
xtable = null;
+ if (context != null) {
+ context.clear();
+ context = null;
+ }
}
class XTableProviderImpl implements XTableProvider {
17 years, 11 months
JBoss Tools SVN: r8068 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-05-13 15:50:55 -0400 (Tue, 13 May 2008)
New Revision: 8068
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java
Log:
JBIDE-2204 Unhandled event loop exception when call CA in Insert Tag wizard
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java 2008-05-13 19:50:20 UTC (rev 8067)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java 2008-05-13 19:50:55 UTC (rev 8068)
@@ -18,8 +18,8 @@
public class JSPCellEditorProviderImpl implements ExtendedCellEditorProvider {
public CellEditor createCellEditor(Composite parent, Properties context) {
- //ValueHelper valueHelper = new ValueHelper();
- //context.put("valueHelper", valueHelper);
+ ValueHelper valueHelper = new ValueHelper();
+ context.put("valueHelper", valueHelper);
return new JSPDialogCellEditor(parent, context);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java 2008-05-13 19:50:20 UTC (rev 8067)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java 2008-05-13 19:50:55 UTC (rev 8068)
@@ -44,10 +44,10 @@
public JSPDialogCellEditor(Composite parent, Properties context) {
super(parent);
this.context = context;
- //valueHelper = (ValueHelper)context.get("valueHelper");
+ ValueHelper valueHelper = (ValueHelper)context.get("valueHelper");
contentAssistentProcessor = new JSPDialogCellEditorContentAssistProcessor();
- //if(valueHelper != null) contentAssistentProcessor.setContext(context);
+ if(valueHelper != null) contentAssistentProcessor.setContext(context);
handler = ContentAssistHandler.createHandlerForText(getTextField(), ControlContentAssistHelper.createJavaContentAssistant(contentAssistentProcessor));
}
17 years, 11 months
JBoss Tools SVN: r8067 - in branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: objecteditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-05-13 15:50:20 -0400 (Tue, 13 May 2008)
New Revision: 8067
Modified:
branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java
Log:
JBIDE-2204 Unhandled event loop exception when call CA in Insert Tag wizard
Modified: branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
===================================================================
--- branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-05-13 19:50:13 UTC (rev 8066)
+++ branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-05-13 19:50:20 UTC (rev 8067)
@@ -181,6 +181,10 @@
addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
fWizardModel.removePropertyChangeListener(TagAttributesComposite.this);
+ if (context != null) {
+ context.clear();
+ context = null;
+ }
removeDisposeListener(this);
}
});
Modified: branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java
===================================================================
--- branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java 2008-05-13 19:50:13 UTC (rev 8066)
+++ branches/jbosstools-2.1.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesEditor.java 2008-05-13 19:50:20 UTC (rev 8067)
@@ -97,6 +97,10 @@
public void dispose() {
if (xtable!=null) xtable.dispose();
xtable = null;
+ if (context != null) {
+ context.clear();
+ context = null;
+ }
}
class XTableProviderImpl implements XTableProvider {
17 years, 11 months
JBoss Tools SVN: r8066 - branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-05-13 15:50:13 -0400 (Tue, 13 May 2008)
New Revision: 8066
Modified:
branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java
branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java
Log:
JBIDE-2204 Unhandled event loop exception when call CA in Insert Tag wizard
Modified: branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java
===================================================================
--- branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java 2008-05-13 13:48:31 UTC (rev 8065)
+++ branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPCellEditorProviderImpl.java 2008-05-13 19:50:13 UTC (rev 8066)
@@ -18,8 +18,8 @@
public class JSPCellEditorProviderImpl implements ExtendedCellEditorProvider {
public CellEditor createCellEditor(Composite parent, Properties context) {
- //ValueHelper valueHelper = new ValueHelper();
- //context.put("valueHelper", valueHelper);
+ ValueHelper valueHelper = new ValueHelper();
+ context.put("valueHelper", valueHelper);
return new JSPDialogCellEditor(parent, context);
}
Modified: branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java
===================================================================
--- branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java 2008-05-13 13:48:31 UTC (rev 8065)
+++ branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java 2008-05-13 19:50:13 UTC (rev 8066)
@@ -44,10 +44,10 @@
public JSPDialogCellEditor(Composite parent, Properties context) {
super(parent);
this.context = context;
- //valueHelper = (ValueHelper)context.get("valueHelper");
+ ValueHelper valueHelper = (ValueHelper)context.get("valueHelper");
contentAssistentProcessor = new JSPDialogCellEditorContentAssistProcessor();
- //if(valueHelper != null) contentAssistentProcessor.setContext(context);
+ if(valueHelper != null) contentAssistentProcessor.setContext(context);
handler = ContentAssistHandler.createHandlerForText(getTextField(), ControlContentAssistHelper.createJavaContentAssistant(contentAssistentProcessor));
}
17 years, 11 months
JBoss Tools SVN: r8065 - in trunk/ws/plugins: org.jboss.tools.ws.ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-05-13 09:48:31 -0400 (Tue, 13 May 2008)
New Revision: 8065
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/
trunk/ws/plugins/org.jboss.tools.ws.ui/
Log:
svnignore ws bin
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.core
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui
___________________________________________________________________
Name: svn:ignore
+ bin
17 years, 11 months
JBoss Tools SVN: r8064 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/help.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-13 09:46:59 -0400 (Tue, 13 May 2008)
New Revision: 8064
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties
Log:
JBIDE-2088
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties 2008-05-13 13:35:29 UTC (rev 8063)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties 2008-05-13 13:46:59 UTC (rev 8064)
@@ -411,6 +411,8 @@
WebAppFolderFilters24_CreateFilter.WindowTitle=Add Filter
WebAppFolderFilters24_CreateFilter.Title=Filter
+WebAppFolderFilters_Properties.WindowTitle=Properties
+WebAppFolderFilters_Properties.Title=Filters
WebAppFolderFilters24_Properties.WindowTitle=Properties
WebAppFolderFilters24_Properties.Title=Filters
@@ -730,6 +732,9 @@
WebAppJspConfig_Properties.WindowTitle=Properties
WebAppJspConfig_Properties.Title=JSP Config
+WebAppFolderTaglibs_Properties.WindowTitle=Properties
+WebAppFolderTaglibs_Properties.Title=JSP Config
+
##### jsp property group #####
WebAppJSPPropertyGroup_Properties=/struts/noHelpYet.html
WebAppJSPPropertyGroup_Properties.WindowTitle=Properties
17 years, 11 months
JBoss Tools SVN: r8063 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-13 09:35:29 -0400 (Tue, 13 May 2008)
New Revision: 8063
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java
Log:
JBIDE-2189
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java 2008-05-13 13:35:22 UTC (rev 8062)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java 2008-05-13 13:35:29 UTC (rev 8063)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.ui.actions.JdtActionConstants;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.IContributionItem;
@@ -54,7 +55,9 @@
registerAction(actionBars, o, "CopyActions.Paste", ActionFactory.PASTE.getId());
registerAction(actionBars, o, "CopyActions.Cut", ActionFactory.CUT.getId());
if(o.getFileType() <= XModelObject.FILE) {
- actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, new XOpenAction(o));
+ XOpenAction x = new XOpenAction(o);
+ actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, x);
+ actionBars.setGlobalActionHandler(JdtActionConstants.OPEN, x);
}
}
}
17 years, 11 months