You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/04/12 22:03:02 UTC
svn commit: r393587 [3/7] - in
/geronimo/devtools/eclipse-plugin/trunk/plugins:
org.apache.geronimo.st.core/ org.apache.geronimo.st.core/META-INF/
org.apache.geronimo.st.core/src/ org.apache.geronimo.st.core/src/org/
org.apache.geronimo.st.core/src/org...
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,92 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.actions;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
+import org.eclipse.wst.server.core.IServer;
+
+public class LaunchGeronimoConsoleAction implements IActionDelegate {
+
+ public static final String serverID = "org.apache.geronimo.generic.server.10";
+
+ private IServer server;
+
+ public LaunchGeronimoConsoleAction() {
+ super();
+ }
+
+ public URL getConsoleUrl() throws MalformedURLException {
+ if (server != null) {
+ GenericGeronimoServer gs = (GenericGeronimoServer) server.getAdapter(GenericGeronimoServer.class);
+ return new URL("http://" + server.getHost() + ":"
+ + gs.getHTTPPort() + "/console/");
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+
+ try {
+ int style = IWorkbenchBrowserSupport.AS_EDITOR
+ | IWorkbenchBrowserSupport.STATUS;
+ IWebBrowser browser = WorkbenchBrowserSupport.getInstance().createBrowser(style, "console", Messages.console, Messages.consoleTooltip);
+ URL url = getConsoleUrl();
+ if (url != null)
+ browser.openURL(url);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+
+ server = (IServer) ((StructuredSelection) selection).getFirstElement();
+
+ boolean enable = server != null
+ && serverID.equals(server.getServerType().getId())
+ && server.getServerState() == IServer.STATE_STARTED;
+
+ action.setEnabled(enable);
+
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,49 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.commands;
+
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public abstract class ServerCommand extends AbstractOperation {
+ protected IServerWorkingCopy server;
+
+ public ServerCommand(IServerWorkingCopy server, String name) {
+ super(name);
+ this.server = server;
+ }
+
+ public abstract void execute();
+
+ public IStatus execute(IProgressMonitor monitor, IAdaptable adapt) {
+ execute();
+ return null;
+ }
+
+ public abstract void undo();
+
+ public IStatus undo(IProgressMonitor monitor, IAdaptable adapt) {
+ undo();
+ return null;
+ }
+
+ public IStatus redo(IProgressMonitor monitor, IAdaptable adapt) {
+ return execute(monitor, adapt);
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/ServerCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,92 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.internal.Server;
+
+public class SetConsoleLogLevelCommand extends ServerCommand {
+
+ public static final String NONE = "--long";
+
+ public static final String INFO = "-v";
+
+ public static final String DEBUG = "-vv";
+
+ protected String value;
+
+ protected String oldValue;
+
+ private ILaunchConfigurationWorkingCopy wc = null;
+
+ /**
+ * @param server
+ * @param name
+ */
+ public SetConsoleLogLevelCommand(IServerWorkingCopy server, String value) {
+ super(server, value);
+ this.value = value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#execute()
+ */
+ public void execute() {
+ try {
+ oldValue = getCurrentValue();
+ if (oldValue != value) {
+ getLaunchConfiguration().setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, value);
+ getLaunchConfiguration().doSave();
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getCurrentValue() throws CoreException {
+ return getLaunchConfiguration().getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, NONE);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#undo()
+ */
+ public void undo() {
+ try {
+ getLaunchConfiguration().setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, oldValue);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private ILaunchConfigurationWorkingCopy getLaunchConfiguration()
+ throws CoreException {
+ if (wc == null) {
+ Server s = (Server) server.getAdapter(Server.class);
+ ILaunchConfiguration launchConfig = s.getLaunchConfiguration(true, null);
+ wc = launchConfig.getWorkingCopy();
+ }
+ return wc;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetConsoleLogLevelCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.commands;
+
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public class SetHTTPPortCommand extends ServerCommand {
+
+ protected String name;
+
+ protected String oldName;
+
+ GenericGeronimoServer gs;
+
+ /**
+ * @param server
+ * @param name
+ */
+ public SetHTTPPortCommand(IServerWorkingCopy server, String name) {
+ super(server, name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#execute()
+ */
+ public void execute() {
+ gs = (GenericGeronimoServer) server.getAdapter(GenericGeronimoServer.class);
+ if (gs == null) {
+ gs = (GenericGeronimoServer) server.loadAdapter(GenericGeronimoServer.class, new NullProgressMonitor());
+ }
+ oldName = gs.getHTTPPort();
+ gs.setHTTPPort(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#undo()
+ */
+ public void undo() {
+ if (gs != null) {
+ gs.setHTTPPort(oldName);
+ }
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetHTTPPortCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.commands;
+
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public class SetPasswordCommand extends ServerCommand {
+
+ protected String name;
+
+ protected String oldName;
+
+ GenericGeronimoServer gs;
+
+ /**
+ * @param server
+ * @param name
+ */
+ public SetPasswordCommand(IServerWorkingCopy server, String name) {
+ super(server, name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#execute()
+ */
+ public void execute() {
+ gs = (GenericGeronimoServer) server.getAdapter(GenericGeronimoServer.class);
+ if (gs == null) {
+ gs = (GenericGeronimoServer) server.loadAdapter(GenericGeronimoServer.class, new NullProgressMonitor());
+ }
+ oldName = gs.getAdminPassword();
+ gs.setAdminPassword(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#undo()
+ */
+ public void undo() {
+ if (gs != null) {
+ gs.setAdminPassword(oldName);
+ }
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetPasswordCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.commands;
+
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public class SetRMIPortCommand extends ServerCommand {
+
+ protected String name;
+
+ protected String oldName;
+
+ GenericGeronimoServer gs;
+
+ /**
+ * @param server
+ * @param name
+ */
+ public SetRMIPortCommand(IServerWorkingCopy server, String name) {
+ super(server, name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#execute()
+ */
+ public void execute() {
+ gs = (GenericGeronimoServer) server.getAdapter(GenericGeronimoServer.class);
+ if (gs == null) {
+ gs = (GenericGeronimoServer) server.loadAdapter(GenericGeronimoServer.class, new NullProgressMonitor());
+ }
+ oldName = gs.getRMINamingPort();
+ gs.setRMINamingPort(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#undo()
+ */
+ public void undo() {
+ if (gs != null) {
+ gs.setRMINamingPort(oldName);
+ }
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetRMIPortCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.commands;
+
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+/**
+ *
+ *
+ */
+public class SetUsernameCommand extends ServerCommand {
+
+ protected String name;
+
+ protected String oldName;
+
+ GenericGeronimoServer gs;
+
+ /**
+ * @param server
+ * @param name
+ */
+ public SetUsernameCommand(IServerWorkingCopy server, String name) {
+ super(server, name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#execute()
+ */
+ public void execute() {
+ gs = (GenericGeronimoServer) server.getAdapter(GenericGeronimoServer.class);
+ if (gs == null) {
+ gs = (GenericGeronimoServer) server.loadAdapter(GenericGeronimoServer.class, new NullProgressMonitor());
+ }
+ oldName = gs.getAdminID();
+ gs.setAdminID(name);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.internal.command.ServerCommand#undo()
+ */
+ public void undo() {
+ if (gs != null) {
+ gs.setAdminID(oldName);
+ }
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/commands/SetUsernameCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,161 @@
+package org.apache.geronimo.st.ui.editors;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.internal.Trace;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+public abstract class AbstractGeronimoDeploymentPlanEditor extends FormEditor {
+
+ private EObject deploymentPlan;
+
+ public AbstractGeronimoDeploymentPlanEditor() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void doSave(IProgressMonitor monitor) {
+ InputStream is = null;
+ try {
+ IEditorInput input = getEditorInput();
+ if (input instanceof IFileEditorInput) {
+ if (deploymentPlan != null) {
+ saveEditors();
+ }
+
+ if (getActiveEditor() == null) {
+ editorDirtyStateChanged();
+ } else {
+ getActiveEditor().doSave(monitor);
+ if (deploymentPlan != null) {
+ if (deploymentPlan.eResource() != null) {
+ deploymentPlan.eResource().unload();
+ }
+ // TODO not sure if this is the best way to refresh
+ // model
+ IFileEditorInput fei = (IFileEditorInput) input;
+ deploymentPlan = loadDeploymentPlan(fei.getFile());
+ }
+ }
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error saving", e);
+ } finally {
+ try {
+ if (is != null)
+ is.close();
+ } catch (Exception e) {
+ // do nothing
+ }
+ }
+ }
+
+ private void saveEditors() throws IOException {
+ deploymentPlan.eResource().save(Collections.EMPTY_MAP);
+ commitFormPages(true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ protected void addPages() {
+ try {
+ doAddPages();
+ } catch (PartInitException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ abstract public void doAddPages() throws PartInitException;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+ */
+ public final void doSaveAs() {
+ // do nothing
+ }
+
+ protected void addSourcePage() throws PartInitException {
+ TextEditor source = new TextEditor();
+ int index = addPage(source, getEditorInput());
+ setPageText(index, Messages.editorTabSource);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+ */
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ public void commitFormPages(boolean onSave) {
+ IFormPage[] pages = getPages();
+ for (int i = 0; i < pages.length; i++) {
+ IFormPage page = pages[i];
+ IManagedForm mform = page.getManagedForm();
+ if (mform != null && mform.isDirty())
+ mform.commit(true);
+ }
+ }
+
+ public IFormPage[] getPages() {
+ ArrayList formPages = new ArrayList();
+ for (int i = 0; i < pages.size(); i++) {
+ Object page = pages.get(i);
+ if (page instanceof IFormPage)
+ formPages.add(page);
+ }
+ return (IFormPage[]) formPages.toArray(new IFormPage[formPages.size()]);
+ }
+
+ public EObject getDeploymentPlan() {
+ return deploymentPlan;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
+ * org.eclipse.ui.IEditorInput)
+ */
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
+ super.init(site, input);
+ if (input instanceof IFileEditorInput) {
+ IFileEditorInput fei = (IFileEditorInput) input;
+ deploymentPlan = loadDeploymentPlan(fei.getFile());
+ if (deploymentPlan == null) {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Error Opening Editor", "Could not open the deployment plan editor. Opening the default text editor.");
+ }
+ }
+ }
+
+ abstract public EObject loadDeploymentPlan(IFile file);
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,179 @@
+package org.apache.geronimo.st.ui.internal;
+
+import org.apache.geronimo.st.ui.Activator;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+ public static String appGeneralPageTitle;
+ public static String connectorOverViewPageTitle;
+ public static String deploymentPageTitle;
+ public static String namingFormPageTitle;
+ public static String securityPageTitle;
+ public static String webGeneralPageTitle;
+ public static String editorTabGeneral;
+ public static String editorTabNaming;
+ public static String editorTabSecurity;
+ public static String editorTabDeployment;
+ public static String editorTabSource;
+ public static String errorCouldNotOpenFile;
+ public static String editorTitle;
+ public static String editorSectionGeneralTitle;
+ public static String editorSectionGeneralDescription;
+ public static String editorConfigId;
+ public static String editorParentId;
+ public static String editorContextRoot;
+ public static String editorClassloader;
+ public static String editorClassloaderServer;
+ public static String editorClassloaderWebApp;
+ public static String securityRealmName;
+ //
+ public static String editorSectionSecurityRolesTitle;
+ public static String editorSectionSecurityRolesDescription;
+ public static String name;
+ public static String description;
+ //
+ public static String editorSectionDependenciesTitle;
+ public static String editorSectionDependenciesDescription;
+ //
+ public static String editorSectionImportTitle;
+ public static String editorSectionImportDescription;
+ //
+ public static String editorSectionGBeanTitle;
+ public static String editorSectionGBeanDescription;
+ public static String className;
+ public static String GbeanName;
+ //
+ public static String editorResourceRefDescription;
+ public static String editorResourceRefTitle;
+ public static String editorResRefTargetNameTitle;
+ public static String editorResRefLinkTitle;
+ public static String editorResRefNameTitle;
+ //
+ public static String editorGBeanRefTitle;
+ public static String editorGBeanRefDescription;
+ public static String editorGBeanRefName;
+ public static String editorGBeanRefType;
+ public static String editorGBeanRefTargetName;
+ public static String editorGBeanRefProxyType;
+ //
+ public static String editorServiceRefDescription;
+ public static String editorServiceRefTitle;
+ public static String editorServiceRefName;
+ //
+ public static String editorResourceEnvRefDescription;
+ public static String editorResourceEnvRefTitle;
+ public static String editorResEnvRefMsgDestTitle;
+ public static String editorResEnvRefNameTitle;
+ //
+ public static String editorEjbLocalRefDescription;
+ public static String editorEjbLocalRefTitle;
+ public static String editorEjbRefTargetName;
+ public static String editorEjbRefEjbLink;
+ //
+ public static String editorEjbRefDescription;
+ public static String editorEjbRefTitle;
+ // Buttons
+ public static String add;
+ public static String remove;
+ public static String edit;
+ // Wizard/Wizard Pages
+ public static String wizardNewTitle_ResRef;
+ public static String wizardEditTitle_ResRef;
+ public static String wizardPageTitle_ResRef;
+ public static String wizardPageDescription_ResRef;
+ //
+ public static String wizardNewTitle_GBeanRef;
+ public static String wizardEditTitle_GBeanRef;
+ public static String wizardPageTitle_GBeanRef;
+ public static String wizardPageDescription_GBeanRef;
+ //
+ public static String wizardNewTitle_ServiceRef;
+ public static String wizardEditTitle_ServiceRef;
+ public static String wizardPageTitle_ServiceRef;
+ public static String wizardPageDescription_ServiceRef;
+ //
+ public static String wizardNewTitle_ResEnvRef;
+ public static String wizardEditTitle_ResEnvRef;
+ public static String wizardPageTitle_ResEnvRef;
+ public static String wizardPageDescription_ResEnvRef;
+ //
+ public static String wizardNewTitle_EjbRef;
+ public static String wizardEditTitle_EjbRef;
+ public static String wizardPageTitle_EjbRef;
+ public static String wizardPageDescription_EjbRef;
+ //
+ public static String wizardNewTitle_EjbLocalRef;
+ public static String wizardEditTitle_EjbLocalRef;
+ public static String wizardPageTitle_EjbLocalRef;
+ public static String wizardPageDescription_EjbLocalRef;
+ //
+ public static String wizardNewTitle_Dependency;
+ public static String wizardEditTitle_Dependency;
+ public static String wizardPageTitle_Dependency;
+ public static String wizardPageDescription_Dependency;
+ public static String dependencyGroupLabel;
+ public static String serverRepos;
+ public static String uri;
+ public static String mavenArtifact;
+ public static String groupId;
+ public static String artifactId;
+ public static String version;
+ //
+ public static String wizardNewTitle_Import;
+ public static String wizardEditTitle_Import;
+ public static String wizardPageTitle_Import;
+ public static String wizardPageDescription_Import;
+ //
+ public static String wizardNewTitle_GBean;
+ public static String wizardEditTitle_GBean;
+ public static String wizardPageTitle_GBean;
+ public static String wizardPageDescription_GBean;
+ //
+ public static String wizardNewTitle_SecurityRole;
+ public static String wizardEditTitle_SecurityRole;
+ public static String wizardPageTitle_SecurityRole;
+ public static String wizardPageDescription_SecurityRole;
+ public static String editorSectionSecurityTitle;
+ public static String editorSectionSecurityDescription;
+ public static String editorSectionPortsTitle;
+ public static String editorSectionPortsDescription;
+ public static String editorSectionLogLevelTitle;
+ public static String editorSectionLogLevelDescription;
+ public static String info;
+ public static String debug;
+ public static String httpPort;
+ public static String rmiPort;
+ public static String username;
+ public static String password;
+ public static String console;
+ public static String consoleTooltip;
+ public int i;
+ //
+ public static String doasCurrentCaller;
+ public static String useContextHandler;
+ public static String defaultRole;
+
+ // GeronimoServerRuntimeWizardFragment
+ public static String serverWizardDescription;
+ public static String browse;
+ public static String installDir;
+ public static String downloadOptions;
+ public static String chooseWebContainer;
+ public static String gWithTomcat;
+ public static String gWithJetty;
+ public static String install;
+ public static String jvmWarning;
+ public static String installTitle;
+ public static String installMessage;
+ public static String tooltipLoc;
+ public static String tooltipInstall;
+ public static String tooltipJetty;
+ public static String tooltipTomcat;
+
+ static {
+ NLS.initializeMessages(Activator.PLUGIN_ID + ".internal.Messages", Messages.class);
+ }
+}
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties Wed Apr 12 13:02:48 2006
@@ -0,0 +1,173 @@
+appGeneralPageTitle=Application Plan General Configuration
+connectorOverViewPageTitle=Connector Plan General Configuration
+deploymentPageTitle=Deployment Configuration
+namingFormPageTitle=Defined References
+securityPageTitle=Security Configuration
+webGeneralPageTitle=Web Deployment Plan General Configuration
+
+errorCouldNotOpenFile=Could not open file
+
+editorTitle=Geronimo Deployment Plan Editor
+editorSectionGeneralTitle=General
+editorSectionGeneralDescription=Edit the common deployment settings.
+
+editorSectionSecurityRolesTitle=Security Roles
+editorSectionSecurityRolesDescription=The following security roles are defined:
+
+editorSectionDependenciesTitle=Dependencies
+editorSectionDependenciesDescription=The following dependencies are defined as common libraries.
+
+editorSectionImportTitle=Imports
+editorSectionImportDescription=The following configurations are imported into this plan.
+
+editorSectionGBeanTitle=GBeans
+editorSectionGBeanDescription=The following gbeans are defined in this plan.
+className=Class
+GbeanName=Gbean Name
+
+editorSectionSecurityTitle=Security
+editorSectionSecurityDescription=Specify the security settings.
+username=User ID:
+password=Password:
+
+editorSectionPortsTitle=Port Configuration
+editorSectionPortsDescription=Specify the ports for this server instance.
+httpPort=HTTP Port:
+rmiPort=RMI Naming Port:
+
+editorSectionLogLevelTitle=Console Output
+editorSectionLogLevelDescription=Select the server console output log level.
+info=INFO
+debug=DEBUG
+
+editorConfigId=Config Id:
+editorParentId=Parent Id:
+editorContextRoot=Context Root:
+securityRealmName=Security realm name:
+editorClassloader=Search order used by the classloader to locate classes:
+editorClassloaderServer=Search the Geronimo server environment first (recomended)
+editorClassloaderWebApp=Search the web app first
+
+editorResourceRefTitle=Resource References
+editorResourceRefDescription=The following resource references are defined:
+editorResRefTargetNameTitle=Target Name
+editorResRefLinkTitle=Resource Link
+editorResRefNameTitle=Reference Name
+
+editorResourceEnvRefTitle=Resource Environment References
+editorResourceEnvRefDescription=The following resource environment references are defined:
+editorResEnvRefNameTitle=Reference Name
+editorResEnvRefMsgDestTitle=Message destination
+
+editorGBeanRefTitle=GBean References
+editorGBeanRefDescription=The following gbean references are defined:
+editorGBeanRefName=Name
+editorGBeanRefType=Type
+editorGBeanRefTargetName=Target
+editorGBeanRefProxyType=Proxy Type
+
+editorServiceRefDescription=The following service references are defined:
+editorServiceRefTitle=Service Refs
+editorServiceRefName=Name
+
+editorEjbRefDescription = The following ejb references are defined:
+editorEjbRefTitle = EJB References
+editorEjbRefTargetName=Target Name
+editorEjbRefEjbLink=EJB Link
+
+editorEjbLocalRefDescription=The following ejb local refererencs are defined:
+editorEjbLocalRefTitle=EJB Local References
+
+add=Add
+remove=Remove
+edit=Edit
+
+wizardNewTitle_ResRef=New Resource Reference
+wizardEditTitle_ResRef=Edit Resource Reference
+wizardPageTitle_ResRef=Resource Reference Details
+wizardPageDescription_ResRef=Provide details for this resource reference.
+
+wizardNewTitle_ResEnvRef=New Resource Enviornment Reference
+wizardEditTitle_ResEnvRef=Edit Resource Enviornment Reference
+wizardPageTitle_ResEnvRef=Resource Enviornment Reference Details
+wizardPageDescription_ResEnvRef=Provide details for this resource enviornment reference.
+
+wizardNewTitle_EjbRef=New EJB Reference
+wizardEditTitle_EjbRef=Edit EJB Reference
+wizardPageTitle_EjbRef=EJB Reference Details
+wizardPageDescription_EjbRef=Provide details for this ejb reference.
+
+wizardNewTitle_ServiceRef=New Service Reference
+wizardEditTitle_ServiceRef=Edit Service Reference
+wizardPageTitle_ServiceRef=Service Reference Details
+wizardPageDescription_ServiceRef=Provide details for this service reference
+
+wizardNewTitle_EjbLocalRef=New EJB Local Reference
+wizardEditTitle_EjbLocalRef=Edit EJB Local Reference
+wizardPageTitle_EjbLocalRef=EJB Reference Local Details
+wizardPageDescription_EjbLocalRef=Provide details for this ejb local reference.
+
+wizardNewTitle_GBeanRef=New GBean Reference
+wizardEditTitle_GBeanRef=Edit GBean Reference
+wizardPageTitle_GBeanRef=GBean Reference Details
+wizardPageDescription_GBeanRef=Provide details for this gbean reference.
+
+wizardNewTitle_SecurityRole=New Security Role
+wizardEditTitle_SecurityRole=Edit Security Role
+wizardPageTitle_SecurityRole=Security Role Details
+wizardPageDescription_SecurityRole=Provide details for this security role.
+
+wizardNewTitle_Dependency=New Dependency
+wizardEditTitle_Dependency=Edit Dependency
+wizardPageTitle_Dependency=Dependency Details
+wizardPageDescription_Dependency=Provide details for this dependency.
+
+wizardNewTitle_Import=New Import
+wizardEditTitle_Import=Edit Import
+wizardPageTitle_Import=Import Details
+wizardPageDescription_Import=Provide details for this dependency.
+
+wizardNewTitle_GBean=New GBean
+wizardEditTitle_GBean=Edit Gbean
+wizardPageTitle_GBean=Gbean Details
+wizardPageDescription_GBean=Provide details for this gbean.
+
+doasCurrentCaller=Do as current caller
+useContextHandler=Use context handler
+defaultRole=Default Role:
+
+dependencyGroupLabel=Dependency type and location
+serverRepos=Specify dependency by path
+uri=URI:
+mavenArtifact=Specify Maven-style dependency
+groupId=Group Id:
+artifactId=Artifact Id:
+version=Version:
+
+editorTabGeneral=General
+editorTabNaming=Naming
+editorTabSecurity=Security
+editorTabDeployment=Deployment
+editorTabSource=Source
+
+name=Name
+description=Description
+
+console=Geronimo Console
+consoleTooltip=Apache Geronimo Console
+
+serverWizardDescription=Specify the location of an existing 1.0 Geronimo installation. If none exists, specify an install location and press 'Download and Install'.
+browse=Browse
+installDir=Application Server Installation Directory:
+downloadOptions=Download Options
+chooseWebContainer=Select a web container:
+gWithTomcat=Geronimo with Tomcat
+gWithJetty=Geronimo with Jetty
+install=Download and Install
+jvmWarning=Geronimo is currently only certified on a 1.4 JVM. Use of any other version is not currently supported.
+installTitle=Install Confirmation
+installMessage=Install Apache Geronimo to {0} ?
+tooltipLoc=A location of an existing Geronimo installation or a path to install to.
+tooltipInstall=Downloads the selected Geronimo distribution and installs it to the specified location.
+tooltipJetty=Selects the Jetty distribution of Geronimo to install.
+tooltipTomcat=Selects the Tomcat distribution of Geronimo to install.
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,77 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.internal;
+
+import org.apache.geronimo.st.core.Activator;
+
+/**
+ * Helper class to route trace output.
+ */
+public class Trace {
+
+ /**
+ * Finest trace event.
+ */
+ public static byte INFO = 0;
+
+ /**
+ * Warning trace event.
+ */
+ public static byte WARNING = 1;
+
+ /**
+ * Severe trace event.
+ */
+ public static byte SEVERE = 2;
+
+ /**
+ * Trace constructor comment.
+ */
+ private Trace() {
+ super();
+ }
+
+ /**
+ * Trace the given text.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ */
+ public static void trace(byte level, String s) {
+ trace(level, s, null);
+ }
+
+ /**
+ * Trace the given message and exception.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ * @param t
+ * a throwable
+ */
+ public static void trace(byte level, String s, Throwable t) {
+ if (!Activator.getDefault().isDebugging())
+ return;
+
+ System.out.println(Activator.PLUGIN_ID + ": " + s);
+ if (t != null)
+ t.printStackTrace();
+ }
+}
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Trace.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,82 @@
+package org.apache.geronimo.st.ui.pages;
+
+import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+public abstract class AbstractGeronimoFormPage extends FormPage {
+
+ EObject deploymentPlan;
+
+ protected FormToolkit toolkit;
+
+ protected Composite body;
+
+ /**
+ * @param editor
+ * @param id
+ * @param title
+ */
+ public AbstractGeronimoFormPage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ }
+
+ /**
+ * @param id
+ * @param title
+ */
+ public AbstractGeronimoFormPage(String id, String title) {
+ super(id, title);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+ */
+ protected void createFormContent(IManagedForm managedForm) {
+ deploymentPlan = ((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan();
+ body = managedForm.getForm().getBody();
+ toolkit = managedForm.getToolkit();
+ ScrolledForm form = managedForm.getForm();
+ form.setText(getFormTitle());
+ // managedForm.addPart(new BannerPart(form.getBody(), toolkit,
+ // SWT.NONE));
+ form.getBody().setLayout(getLayout());
+ fillBody(managedForm);
+ form.reflow(true);
+ }
+
+ protected GridLayout getLayout() {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.horizontalSpacing = 20;
+ layout.makeColumnsEqualWidth = true;
+ return layout;
+ }
+
+ protected int getStyle() {
+ return ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+ | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+ | ExpandableComposite.FOCUS_TITLE;
+ }
+
+ abstract protected void fillBody(IManagedForm managedForm);
+
+ public EObject getDeploymentPlan() {
+ return deploymentPlan;
+ }
+
+ public String getFormTitle() {
+ return getTitle();
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/pages/AbstractGeronimoFormPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,59 @@
+package org.apache.geronimo.st.ui.sections;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public abstract class AbstractSectionPart extends SectionPart {
+
+ protected FormToolkit toolkit;
+
+ private EObject plan;
+
+ /**
+ * @param section
+ */
+ public AbstractSectionPart(Section section) {
+ super(section);
+ }
+
+ /**
+ * @param parent
+ * @param toolkit
+ * @param style
+ * @param plan
+ */
+ public AbstractSectionPart(Composite parent, FormToolkit toolkit,
+ int style, EObject plan) {
+ super(parent, toolkit, style);
+ this.toolkit = toolkit;
+ this.plan = plan;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.IFormPart#commit(boolean)
+ *
+ * Overriding this method as a workaround as switching tabs on a dirty
+ * editor commits the page and marks the part as not dirty.
+ */
+ public void commit(boolean onSave) {
+ boolean currentDirtyState = isDirty();
+ super.commit(onSave);
+ if (!onSave && currentDirtyState) {
+ markDirty();
+ }
+ }
+
+ public EObject getPlan() {
+ return plan;
+ }
+
+ public FormToolkit getToolkit() {
+ return toolkit;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,264 @@
+package org.apache.geronimo.st.ui.sections;
+
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+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.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public abstract class AbstractTableSection extends AbstractSectionPart {
+
+ private static final String[] COLUMN_NAMES = new String[] {};
+
+ private Table table;
+
+ private TableViewer tableViewer;
+
+ protected Button addButton;
+
+ protected Button editButton;
+
+ protected Button removeButton;
+
+ public AbstractTableSection(Section section) {
+ super(section);
+ }
+
+ /**
+ * @param plan
+ * @param parent
+ * @param toolkit
+ * @param style
+ *
+ * Subclasses should call createClient() in constructor
+ */
+ public AbstractTableSection(EObject plan, Composite parent,
+ FormToolkit toolkit, int style) {
+ super(parent, toolkit, style, plan);
+ }
+
+ public void createClient() {
+
+ if (getTableEntryObjectType() == null)
+ throw new NullPointerException();
+
+ getSection().setText(getTitle());
+ getSection().setDescription(getDescription());
+ getSection().setLayoutData(getSectionLayoutData());
+ Composite composite = createTableComposite(getSection());
+ getSection().setClient(composite);
+ table = createTable(composite);
+
+ tableViewer = new TableViewer(getTable());
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(getAdapterFactory()));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(getAdapterFactory()));
+ tableViewer.setInput(getInput());
+
+ tableViewer.addFilter(new ViewerFilter() {
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+ return AbstractTableSection.this.filter(viewer, parentElement, element);
+ }
+ });
+
+ if (getTableColumnNames().length > 0) {
+ tableViewer.setColumnProperties(getTableColumnNames());
+ }
+
+ Composite buttonComp = createButtonComposite(composite);
+ createAddButton(toolkit, buttonComp);
+ createRemoveButton(toolkit, buttonComp);
+ createEditButton(toolkit, buttonComp);
+
+ }
+
+ public Object getInput() {
+ return getPlan();
+ }
+
+ protected boolean filter(Viewer viewer, Object parentElement, Object element) {
+ return getTableEntryObjectType().isInstance(element);
+ }
+
+ protected Composite createTableComposite(Composite parent) {
+ Composite composite = toolkit.createComposite(parent);
+ composite.setLayout(getSectionCompositeLayout());
+ composite.setLayoutData(getTableCompositeLayoutData());
+ return composite;
+ }
+
+ protected GridData getSectionLayoutData() {
+ return new GridData(SWT.FILL, SWT.FILL, false, false);
+ }
+
+ protected GridData getTableCompositeLayoutData() {
+ return new GridData(SWT.FILL, SWT.FILL, false, false);
+ }
+
+ protected GridLayout getSectionCompositeLayout() {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 15;
+ return layout;
+ }
+
+ protected Table createTable(Composite composite) {
+ Table table = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION
+ | SWT.V_SCROLL | SWT.SINGLE);
+ if (isHeaderVisible()) {
+ table.setHeaderVisible(true);
+ }
+
+ GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
+ data.heightHint = 60;
+ data.widthHint = 400;
+ table.setLayoutData(data);
+
+ TableLayout tableLayout = new TableLayout();
+ table.setLayout(tableLayout);
+
+ for (int i = 0; i < getTableColumnNames().length; i++) {
+ tableLayout.addColumnData(new ColumnWeightData(35));
+ TableColumn tableColumn = new TableColumn(table, SWT.NONE);
+ tableColumn.setText(getTableColumnNames()[i]);
+ }
+
+ return table;
+ }
+
+ protected Composite createButtonComposite(Composite parent) {
+ Composite buttonComp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.horizontalSpacing = 2;
+ layout.verticalSpacing = 2;
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.numColumns = 1;
+ buttonComp.setLayout(layout);
+ buttonComp.setBackground(toolkit.getColors().getBackground());
+ buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ return buttonComp;
+ }
+
+ protected void createRemoveButton(FormToolkit toolkit, Composite buttonComp) {
+ removeButton = toolkit.createButton(buttonComp, Messages.remove, SWT.NONE);
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ int[] selectedIndices = table.getSelectionIndices();
+ for (int i = 0; i < selectedIndices.length; i++) {
+ TableItem tableItem = table.getItem(selectedIndices[i]);
+ EObject type = (EObject) (tableItem.getData());
+ table.remove(selectedIndices[i]);
+ EcoreUtil.remove(type);
+ markDirty();
+ }
+ }
+ });
+ removeButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ }
+
+ protected void createAddButton(FormToolkit toolkit, Composite buttonComp) {
+ addButton = toolkit.createButton(buttonComp, Messages.add, SWT.NONE);
+
+ addButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Wizard wizard = getWizard();
+ if (wizard != null) {
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+
+ dialog.open();
+
+ if (dialog.getReturnCode() == Dialog.OK) {
+ markDirty();
+ }
+ }
+ }
+ });
+
+ addButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ }
+
+ protected void createEditButton(FormToolkit toolkit, Composite buttonComp) {
+ editButton = toolkit.createButton(buttonComp, Messages.edit, SWT.NONE);
+
+ editButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object o = ((StructuredSelection) getTableViewer().getSelection()).getFirstElement();
+ if (o != null) {
+ Wizard wizard = getWizard();
+ if (wizard != null) {
+ if (wizard instanceof AbstractTableWizard) {
+ ((AbstractTableWizard) wizard).setEObject((EObject) o);
+ }
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ if (dialog.getReturnCode() == Dialog.OK) {
+ markDirty();
+ // TODO notify listeners
+ }
+ }
+ }
+ }
+ });
+
+ editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ }
+
+ public TableViewer getTableViewer() {
+ return tableViewer;
+ }
+
+ protected boolean isHeaderVisible() {
+ return true;
+ }
+
+ protected Table getTable() {
+ return table;
+ }
+
+ public String[] getTableColumnNames() {
+ return COLUMN_NAMES;
+ }
+
+ abstract public String getTitle();
+
+ abstract public String getDescription();
+
+ abstract public Wizard getWizard();
+
+ abstract public EReference getEReference();
+
+ abstract public EClass getTableEntryObjectType();
+
+ abstract public AdapterFactory getAdapterFactory();
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/AbstractTableSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,116 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.sections;
+
+import org.apache.geronimo.st.ui.commands.SetConsoleLogLevelCommand;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+public class ServerEditorLogLevelSection extends ServerEditorSection {
+
+ Button info;
+
+ Button debug;
+
+ public ServerEditorLogLevelSection() {
+ super();
+ }
+
+ public void createSection(Composite parent) {
+ super.createSection(parent);
+
+ FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+ Section section = toolkit.createSection(parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+ | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+ | ExpandableComposite.FOCUS_TITLE);
+
+ section.setText(Messages.editorSectionLogLevelTitle);
+ section.setDescription(Messages.editorSectionLogLevelDescription);
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Composite composite = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 15;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ section.setClient(composite);
+
+ info = toolkit.createButton(composite, Messages.info, SWT.RADIO);
+ debug = toolkit.createButton(composite, Messages.debug, SWT.RADIO);
+
+ SetConsoleLogLevelCommand cmd = new SetConsoleLogLevelCommand(server,
+ null);
+ try {
+ String value = cmd.getCurrentValue();
+ if (value.indexOf("-vv") != -1) {
+ debug.setSelection(true);
+ } else {
+ info.setSelection(true);
+ }
+ } catch (CoreException e1) {
+ e1.printStackTrace();
+ }
+
+ info.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (info.getSelection()) {
+ SetConsoleLogLevelCommand cmd = new SetConsoleLogLevelCommand(
+ server, SetConsoleLogLevelCommand.INFO);
+ cmd.execute();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ });
+
+ debug.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ if (debug.getSelection()) {
+ SetConsoleLogLevelCommand cmd = new SetConsoleLogLevelCommand(
+ server, SetConsoleLogLevelCommand.DEBUG);
+ cmd.execute();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ });
+
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,140 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.sections;
+
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.apache.geronimo.st.ui.commands.SetHTTPPortCommand;
+import org.apache.geronimo.st.ui.commands.SetRMIPortCommand;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+/**
+ * @author sppatel
+ *
+ */
+public class ServerEditorPortsSection extends ServerEditorSection {
+
+ Text httpPort;
+
+ Text rmiPort;
+
+ GenericGeronimoServer gs;
+
+ public ServerEditorPortsSection() {
+ super();
+ }
+
+ public void createSection(Composite parent) {
+ super.createSection(parent);
+
+ FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+ Section section = toolkit.createSection(parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+ | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+ | ExpandableComposite.FOCUS_TITLE);
+
+ section.setText(Messages.editorSectionPortsTitle);
+ section.setDescription(Messages.editorSectionPortsDescription);
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Composite composite = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 15;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ section.setClient(composite);
+
+ // ------- Label and text field for the http port -------
+ createLabel(composite, Messages.httpPort, toolkit);
+
+ httpPort = toolkit.createText(composite, getHTTPPort(), SWT.BORDER);
+ httpPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ httpPort.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ execute(new SetHTTPPortCommand(server, httpPort.getText()));
+ }
+ });
+
+ // ------- Label and text field for the rmi port -------
+ createLabel(composite, Messages.rmiPort, toolkit);
+
+ rmiPort = toolkit.createText(composite, getRMIPort(), SWT.BORDER);
+ rmiPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ rmiPort.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ execute(new SetRMIPortCommand(server, rmiPort.getText()));
+ }
+ });
+ }
+
+ protected Label createLabel(Composite parent, String text,
+ FormToolkit toolkit) {
+ Label label = toolkit.createLabel(parent, text);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ return label;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#init(org.eclipse.ui.IEditorSite,
+ * org.eclipse.ui.IEditorInput)
+ */
+ public void init(IEditorSite site, IEditorInput input) {
+ super.init(site, input);
+ gs = (GenericGeronimoServer) server.getAdapter(GenericGeronimoServer.class);
+ if (gs == null) {
+ gs = (GenericGeronimoServer) server.loadAdapter(GenericGeronimoServer.class,
+ new NullProgressMonitor());
+ }
+ }
+
+ private String getHTTPPort() {
+ if (gs != null) {
+ return gs.getHTTPPort();
+ }
+ return "";
+ }
+
+ private String getRMIPort() {
+ if (gs != null) {
+ return gs.getRMINamingPort();
+ }
+ return "";
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorPortsSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,143 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.ui.sections;
+
+import org.apache.geronimo.st.core.IGeronimoServer;
+import org.apache.geronimo.st.ui.commands.SetPasswordCommand;
+import org.apache.geronimo.st.ui.commands.SetUsernameCommand;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+public class ServerEditorSecuritySection extends ServerEditorSection {
+
+ Text username;
+
+ Text password;
+
+ IGeronimoServer gs;
+
+ public ServerEditorSecuritySection() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#createSection(org.eclipse.swt.widgets.Composite)
+ */
+ public void createSection(Composite parent) {
+ super.createSection(parent);
+
+ FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+ Section section = toolkit.createSection(parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+ | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+ | ExpandableComposite.FOCUS_TITLE);
+
+ section.setText(Messages.editorSectionSecurityTitle);
+ section.setDescription(Messages.editorSectionSecurityDescription);
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Composite composite = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 15;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ section.setClient(composite);
+
+ // ------- Label and text field for the username -------
+ createLabel(composite, Messages.username, toolkit);
+
+ username = toolkit.createText(composite, getUserName(), SWT.BORDER);
+ username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ username.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ execute(new SetUsernameCommand(server, username.getText()));
+ }
+ });
+
+ // ------- Label and text field for the password -------
+ createLabel(composite, Messages.password, toolkit);
+
+ password = toolkit.createText(composite, getPassword(), SWT.BORDER);
+ password
+ .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ password.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ execute(new SetPasswordCommand(server, password.getText()));
+ }
+ });
+
+ }
+
+ protected Label createLabel(Composite parent, String text,
+ FormToolkit toolkit) {
+ Label label = toolkit.createLabel(parent, text);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ return label;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#init(org.eclipse.ui.IEditorSite,
+ * org.eclipse.ui.IEditorInput)
+ */
+ public void init(IEditorSite site, IEditorInput input) {
+ super.init(site, input);
+ gs = (IGeronimoServer) server.getAdapter(IGeronimoServer.class);
+ if (gs == null) {
+ gs = (IGeronimoServer) server.loadAdapter(IGeronimoServer.class,
+ new NullProgressMonitor());
+ }
+ }
+
+ private String getUserName() {
+ if (gs != null) {
+ return gs.getAdminID();
+ }
+ return "";
+ }
+
+ private String getPassword() {
+ if (gs != null) {
+ return gs.getAdminPassword();
+ }
+ return "";
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain