Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 45012 invoked from network); 29 Apr 2010 00:58:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Apr 2010 00:58:17 -0000 Received: (qmail 76368 invoked by uid 500); 29 Apr 2010 00:58:17 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 76329 invoked by uid 500); 29 Apr 2010 00:58:17 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 76322 invoked by uid 99); 29 Apr 2010 00:58:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Apr 2010 00:58:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Apr 2010 00:58:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A5A932388980; Thu, 29 Apr 2010 00:57:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r939152 [2/7] - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui: ./ META-INF/ icons/ src/main/java/org/apache/geronimo/st/v30/ui/ src/main/java/org/apache/geronimo/st/v30/ui/actions/ src/main/java/org/apache... Date: Thu, 29 Apr 2010 00:57:15 -0000 To: scm@geronimo.apache.org From: mcconne@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100429005717.A5A932388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetInPlaceSharedLibCommand extends ServerCommand { + + boolean value; + + boolean oldValue; + + /** + * @param server + * @param name + */ + public SetInPlaceSharedLibCommand(IServerWorkingCopy server, boolean value) { + super(server, "SetInPlaceSharedLibCommand"); + this.value = value; + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute() + */ + public void execute() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + oldValue = gs.isInPlaceSharedLib(); + gs.setInPlaceSharedLib(value); + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo() + */ + public void undo() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + gs.setInPlaceSharedLib(oldValue); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetInPlaceSharedLibCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetNotRedeployJSPFilesCommand extends ServerCommand { + + boolean value; + + boolean oldValue; + + /** + * @param server + * @param name + */ + public SetNotRedeployJSPFilesCommand(IServerWorkingCopy server, boolean value) { + super(server, "SetRunFromWorkspaceCommand"); + this.value = value; + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute() + */ + public void execute() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + oldValue = gs.isNotRedeployJSPFiles(); + gs.setNotRedeployJSPFiles(value); + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo() + */ + public void undo() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + gs.setNotRedeployJSPFiles(oldValue); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNotRedeployJSPFilesCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetPasswordCommand extends ServerCommand { + + protected String name; + + protected String oldName; + + GeronimoServerDelegate 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 = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + if (gs == null) { + gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.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.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.wst.server.core.IServerWorkingCopy; +/** + * @version $Rev$ $Date$ + * + * Command to change the server's auto-publish setting. + */ +public class SetPublishTimeoutCommand extends ServerCommand { + protected long timeOut; + protected long oldTimeOut; + + /** + * SetServerAutoPublishDefaultCommand constructor. + * + * @param server a server + * @param time a publish time + */ + public SetPublishTimeoutCommand(IServerWorkingCopy server, long timeOut) { + super(server, "SetServerAutoPublishTimeOutCommand"); + this.timeOut = timeOut; + } + + /** + * Execute the command. + */ + public void execute() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + oldTimeOut = gs.getPublishTimeout(); + gs.setPublishTimeout(timeOut); + } + + /** + * Undo the command. + */ + public void undo() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + gs.setPublishTimeout(oldTimeOut); + } +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetRMIPortCommand extends ServerCommand { + + protected String name; + + protected String oldName; + + GeronimoServerDelegate 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 = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + if (gs == null) { + gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.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.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetRunFromWorkspaceCommand extends ServerCommand { + + boolean value; + + boolean oldValue; + + /** + * @param server + * @param name + */ + public SetRunFromWorkspaceCommand(IServerWorkingCopy server, boolean value) { + super(server, "SetRunFromWorkspaceCommand"); + this.value = value; + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute() + */ + public void execute() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + oldValue = gs.isRunFromWorkspace(); + gs.setRunFromWorkspace(value); + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo() + */ + public void undo() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + gs.setRunFromWorkspace(oldValue); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRunFromWorkspaceCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetSelectClasspathContainersCommand extends ServerCommand { + + boolean value; + boolean oldValue; + + + /** + * @param server + * @param name + */ + public SetSelectClasspathContainersCommand(IServerWorkingCopy server, boolean value) { + super(server, "SetSelectClasspathContainersCommand"); + this.value = value; + } + + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute() + */ + public void execute() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + oldValue = gs.isSelectClasspathContainers(); + gs.setSelectClasspathContainers(value); + } + + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo() + */ + public void undo() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + gs.setSelectClasspathContainers(oldValue); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetSelectClasspathContainersCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,83 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import java.lang.reflect.Method; + +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetServerInstancePropertyCommand extends ServerCommand { + + Object value; + Object oldValue; + Class valueType; + + String setterName; + String getterName; + + Class adapterClass; + Object adaptedClass; + + public SetServerInstancePropertyCommand(IServerWorkingCopy server, Object value, String setterName, Class valueType, Class adapterClass) { + super(server, value.toString()); + this.value = value; + this.setterName = setterName; + this.getterName = "get" + setterName.split("set")[1]; + this.valueType = valueType; + this.adapterClass = adapterClass; + } + + /* (non-Javadoc) + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute() + */ + public void execute() { + adaptedClass = server.getAdapter(adapterClass); + if (adaptedClass == null) { + adaptedClass = server.loadAdapter(adapterClass, new NullProgressMonitor()); + } + try { + Method getterMethod = adaptedClass.getClass().getMethod(getterName, new Class[]{}); + oldValue = getterMethod.invoke(adaptedClass, new Object[]{}); + + Method setterMethod = adaptedClass.getClass().getMethod(setterName, new Class[]{valueType}); + setterMethod.invoke(adaptedClass, new Object[]{value}); + } catch (Exception e) { + //TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /* (non-Javadoc) + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo() + */ + public void undo() { + if(adaptedClass != null) { + try { + Method setterMethod = adaptedClass.getClass().getMethod(setterName, new Class[]{String.class}); + setterMethod.invoke(adaptedClass, new Object[]{oldValue}); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetUsernameCommand extends ServerCommand { + + protected String name; + + protected String oldName; + + GeronimoServerDelegate 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 = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + if (gs == null) { + gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.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.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetVMArgsCommand extends ServerCommand { + + protected String args; + + protected String oldArgs; + + GeronimoServerDelegate gs; + + public SetVMArgsCommand(IServerWorkingCopy server, String args) { + super(server, args); + this.args = args; + } + + public void execute() { + gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + if (gs == null) { + gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class, new NullProgressMonitor()); + } + oldArgs = gs.getVMArgs(); + gs.setVMArgs(args); + } + + public void undo() { + if (gs != null) { + gs.setVMArgs(oldArgs); + } + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,272 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.editors; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; + +import org.apache.geronimo.st.v30.core.operations.ImportDeploymentPlanDataModelProvider; +import org.apache.geronimo.st.v30.core.operations.ImportDeploymentPlanOperation; +import org.apache.geronimo.st.v30.ui.internal.Messages; +import org.apache.geronimo.st.v30.ui.internal.Trace; +import org.apache.geronimo.st.v30.ui.pages.AbstractGeronimoFormPage; +import org.apache.geronimo.st.v30.ui.pages.DeploymentPlanSourcePage; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +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.PlatformUI; +import org.eclipse.ui.forms.IManagedForm; +import org.eclipse.ui.forms.editor.FormEditor; +import org.eclipse.ui.forms.editor.IFormPage; +import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; +import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; +import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; +import org.eclipse.wst.common.frameworks.datamodel.IDataModel; +import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; +import org.eclipse.wst.common.project.facet.core.IFacetedProject; +import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; +import org.eclipse.wst.sse.ui.StructuredTextEditor; + +/** + * @version $Rev$ $Date$ + */ +public abstract class AbstractGeronimoDeploymentPlanEditor extends FormEditor { + + protected JAXBElement 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) { + IFileEditorInput fei = (IFileEditorInput) input; + if (deploymentPlan != null) { + saveDeploymentPlan(fei.getFile()); + commitFormPages(true); + } + + 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 + deploymentPlan = loadDeploymentPlan(fei.getFile()); + } + } + } + } catch (Exception e) { + Trace.trace(Trace.SEVERE, "Error saving", e); + MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error saving", e.getMessage()); + } finally { + try { + if (is != null) + is.close(); + } catch (Exception e) { + Trace.trace(Trace.SEVERE, "Error saving", e); + MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error saving", e.getMessage()); + } + } + } + +// private void saveEditors(IFile file) throws IOException, JAXBException { +// JAXBContext jb = JAXBContext.newInstance( "org.apache.geronimo.xml.ns.j2ee.web_2_0:org.apache.geronimo.xml.ns.j2ee.application_2:org.apache.geronimo.xml.ns.deployment_1:org.apache.geronimo.xml.ns.naming_1", Activator.class.getClassLoader() ); +// jb.createMarshaller().marshal( deploymentPlan, new File( file.getLocationURI().toURL().getFile()) ); +// 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 { + DeploymentPlanSourcePage source = new DeploymentPlanSourcePage(this); + 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 JAXBElement 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; + try { + deploymentPlan = loadDeploymentPlan(fei.getFile()); + } catch (Exception e1) { + // throw new PartInitException("Error in loading deployment plan"); + // if catching an exception , it will try to correct the plan + // or open the plan with default editor + e1.printStackTrace(); + } + + boolean fix = false; + if(deploymentPlan == null) { + fix = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.errorOpenDialog, Messages.editorCorrect); + } + + if(fix) { + IProject project = fei.getFile().getProject(); + IDataModel model = DataModelFactory.createDataModel(new ImportDeploymentPlanDataModelProvider()); + model.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName()); + try { + IFacetedProject facetedProject = ProjectFacetsManager.create(project); + model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, facetedProject.getPrimaryRuntime()); + IDataModelOperation op = new ImportDeploymentPlanOperation(model); + op.execute(new NullProgressMonitor(), null); + } catch (Exception e) { + throw new PartInitException(e.getMessage()); + } + + try { + deploymentPlan = loadDeploymentPlan(fei.getFile()); + } catch (Exception e) { + throw new PartInitException("Error in loading deployment plan"); + } + + if (deploymentPlan == null) { + MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.errorOpenDialog, Messages.editorDefault); + } + } + } + } + + public void reloadDeploymentPlan() throws Exception { + IEditorInput input = getEditorInput(); + if (input instanceof IFileEditorInput) { + IFileEditorInput fei = (IFileEditorInput) input; + if (deploymentPlan != null) { + deploymentPlan = loadDeploymentPlan(fei.getFile()); + IFormPage[] pages = getPages(); + for (int i = 0; i < pages.length; i++) { + IFormPage page = pages[i]; + IManagedForm mform = page.getManagedForm(); + if (mform != null) { + if (page instanceof AbstractGeronimoFormPage) { + AbstractGeronimoFormPage geronimoPage = (AbstractGeronimoFormPage)page; + geronimoPage.refresh(); + } + } + } + } + } + } + + @Override + protected void pageChange(int newPageIndex) { + if (isDirty()) { + IFormPage[] pages = getPages(); + IFormPage active = getActivePageInstance(); + int curr = getCurrentPage(); + if (getCurrentPage() == newPageIndex) { + return; + } + // if the old or the new page are the source page, don't allow the page change + if (newPageIndex == pages.length || getCurrentPage() == pages.length) { + setActivePage(curr); + MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.savePageTitle, Messages.savePageMessage); + return; + } + } + super.pageChange(newPageIndex); + } + + abstract public JAXBElement loadDeploymentPlan(IFile file) throws Exception; + abstract public void saveDeploymentPlan(IFile file) throws Exception; + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoDeploymentPlanEditor.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,75 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.editors; + +import java.io.IOException; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; + +import org.apache.geronimo.st.v30.core.GeronimoUtils; +import org.apache.geronimo.st.v30.core.jaxb.JAXBUtils; +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.forms.editor.FormEditor; + +/** + * @version $Rev$ $Date$ + */ +public abstract class AbstractGeronimoFormContentLoader implements IGeronimoFormContentLoader { + + /* (non-Javadoc) + * @see org.apache.geronimo.st.v30.ui.editors.IGeronimoFormContentLoader#doAddPages(org.eclipse.ui.forms.editor.FormEditor) + */ + public void doAddPages(FormEditor editor) throws PartInitException{ + triggerGeronimoServerInfoUpdate(); + IEditorInput input = editor.getEditorInput(); + if(input instanceof IFileEditorInput) { + String planFileName = ((IFileEditorInput) input).getFile().getName(); + if(GeronimoUtils.WEB_PLAN_NAME.equals(planFileName)) { + addWebPlanPages(editor); + } else if(GeronimoUtils.OPENEJB_PLAN_NAME.equals(planFileName)) { + addOpenEjbPlanPages(editor); + } else if(GeronimoUtils.CONNECTOR_PLAN_NAME.equals(planFileName)) { + addConnectorPlanPages(editor); + } else if(GeronimoUtils.APP_PLAN_NAME.equals(planFileName)) { + addApplicationPlanPages(editor); + } else if(GeronimoUtils.APP_CLIENT_PLAN_NAME.equals(planFileName)) { + addApplicationClientPlanPages(editor); + } + } + } + + abstract public void triggerGeronimoServerInfoUpdate() throws PartInitException; + + abstract public void addWebPlanPages(FormEditor editor) throws PartInitException; + + abstract public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException; + + abstract public void addConnectorPlanPages(FormEditor editor) throws PartInitException; + + abstract public void addApplicationPlanPages(FormEditor editor) throws PartInitException; + + abstract public void addApplicationClientPlanPages(FormEditor editor) throws PartInitException; + + public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws Exception { + JAXBUtils.marshalDeploymentPlan(deploymentPlan, file); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/AbstractGeronimoFormContentLoader.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/GeronimoFormContentLoader.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/GeronimoFormContentLoader.java?rev=939152&r1=939151&r2=939152&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/GeronimoFormContentLoader.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/GeronimoFormContentLoader.java Thu Apr 29 00:57:12 2010 @@ -21,12 +21,12 @@ import java.io.IOException; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; -import org.apache.geronimo.st.core.jaxb.JAXBUtils; -import org.apache.geronimo.st.ui.CommonMessages; -import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor; -import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader; import org.apache.geronimo.st.v30.core.GeronimoServerInfo; -import org.apache.geronimo.st.v30.core.GeronimoV30Utils; +import org.apache.geronimo.st.v30.core.GeronimoUtils; +import org.apache.geronimo.st.v30.core.jaxb.JAXBUtils; +import org.apache.geronimo.st.v30.ui.CommonMessages; +import org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoDeploymentPlanEditor; +import org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoFormContentLoader; import org.apache.geronimo.st.v30.ui.pages.AppClientGeneralPage; import org.apache.geronimo.st.v30.ui.pages.AppClientSecurityPage; import org.apache.geronimo.st.v30.ui.pages.AppGeneralPage; @@ -49,7 +49,7 @@ public class GeronimoFormContentLoader e /* * (non-Javadoc) * - * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor) + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor) */ public void addApplicationPlanPages(FormEditor editor) throws PartInitException { editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral)); @@ -61,7 +61,7 @@ public class GeronimoFormContentLoader e /* * (non-Javadoc) * - * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addConnectorPlanPages(org.eclipse.ui.forms.editor.FormEditor) + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoFormContentLoader#addConnectorPlanPages(org.eclipse.ui.forms.editor.FormEditor) */ public void addConnectorPlanPages(FormEditor editor) throws PartInitException { editor.addPage(new ConnectorOverviewPage(editor, "connectoroverview", CommonMessages.editorTabGeneral)); @@ -71,7 +71,7 @@ public class GeronimoFormContentLoader e /* * (non-Javadoc) * - * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor) + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor) */ public void addApplicationClientPlanPages(FormEditor editor) throws PartInitException { editor.addPage(new AppClientGeneralPage(editor, "appclientgeneralpage", CommonMessages.editorTabGeneral)); @@ -83,7 +83,7 @@ public class GeronimoFormContentLoader e /* * (non-Javadoc) * - * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addOpenEjbPlanPages() + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoFormContentLoader#addOpenEjbPlanPages() */ public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException { editor.addPage(new EjbOverviewPage(editor, "ejboverview", CommonMessages.editorTabGeneral)); @@ -95,7 +95,7 @@ public class GeronimoFormContentLoader e /* * (non-Javadoc) * - * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addWebPlanPages() + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoFormContentLoader#addWebPlanPages() */ public void addWebPlanPages(FormEditor editor) throws PartInitException { AbstractGeronimoDeploymentPlanEditor geronimoEditor = (AbstractGeronimoDeploymentPlanEditor)editor; @@ -109,10 +109,10 @@ public class GeronimoFormContentLoader e /* * (non-Javadoc) * - * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#loadDeploymentPlan(org.eclipse.core.resources.IFile) + * @see org.apache.geronimo.st.v30.ui.editors.IGeronimoFormContentLoader#loadDeploymentPlan(org.eclipse.core.resources.IFile) */ public JAXBElement loadDeploymentPlan(IFile file) throws Exception { - return GeronimoV30Utils.getDeploymentPlan(file); + return GeronimoUtils.getDeploymentPlan(file); } public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws Exception { Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.editors; + +import java.io.IOException; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; + +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.forms.editor.FormEditor; + +/** + * @version $Rev$ $Date$ + */ +public interface IGeronimoFormContentLoader { + + public JAXBElement loadDeploymentPlan(IFile file) throws Exception; + public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws Exception; + + public void doAddPages(FormEditor editor) throws PartInitException; + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/IGeronimoFormContentLoader.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,139 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.editors; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; + +import org.apache.geronimo.st.v30.ui.Activator; +import org.apache.geronimo.st.v30.ui.internal.Trace; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jst.server.core.FacetUtil; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.PartInitException; +import org.eclipse.wst.common.project.facet.core.IFacetedProject; +import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; +import org.eclipse.wst.server.core.IRuntime; + +/** + * @version $Rev$ $Date$ + */ +public class SharedDeploymentPlanEditor extends AbstractGeronimoDeploymentPlanEditor { + + private static Map loaders = new HashMap(); + + private IGeronimoFormContentLoader currentLoader = null; + + static { + loadExtensionPoints(); + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages() + */ + public void doAddPages() throws PartInitException { + Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.doAddPages"); + + if (getDeploymentPlan() != null && getLoader() != null) { + currentLoader.doAddPages(this); + } + addSourcePage(); + + Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.doAddPages"); + } + + private static synchronized void loadExtensionPoints() { + Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.loadExtensionPoints"); + + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IConfigurationElement[] cf = registry.getConfigurationElementsFor(Activator.PLUGIN_ID, "loader"); + for (int i = 0; i < cf.length; i++) { + IConfigurationElement element = cf[i]; + if ("loader".equals(element.getName())) { + try { + IGeronimoFormContentLoader loader = (IGeronimoFormContentLoader) element.createExecutableExtension("class"); + String version = element.getAttribute("version"); + loaders.put(version, loader); + } catch (CoreException e) { + Trace.tracePoint("CoreException", "SharedDeploymentPlanEditor.loadExtensionPoints"); + e.printStackTrace(); + } + } + } + + Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.loadExtensionPoints"); + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile) + */ + public JAXBElement loadDeploymentPlan(IFile file) throws Exception { + Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.loadDeploymentPlan", file); + JAXBElement jaxbElement = getLoader() != null ? currentLoader.loadDeploymentPlan(file) : null; + Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.loadDeploymentPlan", jaxbElement); + return jaxbElement; + } + + public void saveDeploymentPlan(IFile file) throws Exception { + if (getLoader() != null) { + getLoader().saveDeploymentPlan(deploymentPlan, file); + } + } + + private IGeronimoFormContentLoader getLoader() { + Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.getLoader"); + + if (currentLoader == null) { + IEditorInput input = getEditorInput(); + if (input instanceof IFileEditorInput) { + IProject project = ((IFileEditorInput) input).getFile().getProject(); + try { + IFacetedProject fp = ProjectFacetsManager.create(project); + if (fp == null) return null; + IRuntime runtime = FacetUtil.getRuntime(fp.getPrimaryRuntime()); + if (runtime == null) return null; + String version = runtime.getRuntimeType().getVersion(); + currentLoader = (IGeronimoFormContentLoader) loaders.get(version); + } catch (CoreException e) { + Trace.tracePoint("CoreException", "SharedDeploymentPlanEditor.getLoader"); + e.printStackTrace(); + } catch (IllegalArgumentException ie) { + Trace.tracePoint("IllegalArgumentException", "SharedDeploymentPlanEditor.getLoader"); + throw new IllegalArgumentException("The project [" + project.getName() + "] does not have a Targeted Runtime specified."); + } + } + } + + Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.getLoader", currentLoader); + return currentLoader; + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/editors/SharedDeploymentPlanEditor.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadGeronimo.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadGeronimo.java?rev=939152&r1=939151&r2=939152&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadGeronimo.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadGeronimo.java Thu Apr 29 00:57:12 2010 @@ -19,8 +19,8 @@ package org.apache.geronimo.st.v30.ui.ha import java.net.MalformedURLException; import java.net.URL; -import org.apache.geronimo.st.core.internal.Trace; -import org.apache.geronimo.st.ui.internal.Messages; +import org.apache.geronimo.st.v30.ui.internal.Messages; +import org.apache.geronimo.st.v30.ui.internal.Trace; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadOSGi.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadOSGi.java?rev=939152&r1=939151&r2=939152&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadOSGi.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/handlers/DownloadOSGi.java Thu Apr 29 00:57:12 2010 @@ -16,7 +16,7 @@ */ package org.apache.geronimo.st.v30.ui.handlers; -import org.apache.geronimo.st.core.internal.Trace; +import org.apache.geronimo.st.v30.ui.internal.Trace; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.internal; + +import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; +import org.eclipse.debug.ui.CommonTab; +import org.eclipse.debug.ui.EnvironmentTab; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.ui.ILaunchConfigurationTab; +import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; +import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab; +import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab; +import org.eclipse.wst.server.ui.ServerLaunchConfigurationTab; + +/** + * @version $Rev$ $Date$ + */ +public class GeronimoLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { + + /* + * (non-Javadoc) + * + * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, + * java.lang.String) + */ + public void createTabs(ILaunchConfigurationDialog dialog, String mode) { + ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[6]; + tabs[0] = new ServerLaunchConfigurationTab(new String[] { "org.apache.geronimo" }); + tabs[0].setLaunchConfigurationDialog(dialog); + tabs[1] = new JavaArgumentsTab(); + tabs[1].setLaunchConfigurationDialog(dialog); + tabs[2] = new JavaClasspathTab(); + tabs[2].setLaunchConfigurationDialog(dialog); + tabs[3] = new SourceLookupTab(); + tabs[3].setLaunchConfigurationDialog(dialog); + tabs[4] = new EnvironmentTab(); + tabs[4].setLaunchConfigurationDialog(dialog); + tabs[5] = new CommonTab(); + tabs[5].setLaunchConfigurationDialog(dialog); + setTabs(tabs); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java?rev=939152&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java Thu Apr 29 00:57:12 2010 @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.v30.ui.internal; + +import org.apache.geronimo.st.v30.core.GeronimoRuntimeDelegate; +import org.apache.geronimo.st.v30.ui.Activator; +import org.eclipse.core.runtime.IPath; +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.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.FileDialog; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.wst.server.core.IRuntimeWorkingCopy; +import org.eclipse.wst.server.core.TaskModel; +import org.eclipse.wst.server.ui.internal.SWTUtil; +import org.eclipse.wst.server.ui.wizard.IWizardHandle; +import org.eclipse.wst.server.ui.wizard.WizardFragment; + +/** + * @version $Rev$ $Date$ + */ +public class GeronimoRuntimeSourceWizardFragment extends WizardFragment { + + protected Text srcLoc; + + public GeronimoRuntimeSourceWizardFragment() { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.wst.server.ui.wizard.WizardFragment#hasComposite() + */ + public boolean hasComposite() { + return true; + } + + public Composite createComposite(Composite parent, IWizardHandle handle) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout grid = new GridLayout(1, false); + grid.marginWidth = 0; + container.setLayout(grid); + container.setLayoutData(new GridData(GridData.FILL_BOTH)); + handle.setImageDescriptor(Activator.getImageDescriptor((Activator.IMG_WIZ_GERONIMO))); + handle.setTitle(Messages.sourceLocWizTitle); + handle.setDescription(Messages.sourceLocWizDescription); + createContent(container, handle); + return container; + } + + public void createContent(Composite parent, IWizardHandle handle) { + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(3, false); + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + addInstallDirSection(composite); + } + + protected void addInstallDirSection(Composite composite) { + Label label = new Label(composite, SWT.NONE); + label.setText(Messages.sourceZipFile); + GridData data = new GridData(); + data.horizontalSpan = 3; + label.setLayoutData(data); + String tooltipLoc = Messages.bind(Messages.tooltipLoc, getRuntimeName()); + label.setToolTipText(tooltipLoc); + + srcLoc = new Text(composite, SWT.BORDER); + + IPath currentLocation = getRuntimeDelegate().getRuntimeSourceLocation(); + if (currentLocation != null) { + srcLoc.setText(currentLocation.toOSString()); + } + + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 2; + srcLoc.setLayoutData(data); + srcLoc.setToolTipText(tooltipLoc); + srcLoc.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + getRuntimeDelegate().setRuntimeSourceLocation(srcLoc.getText()); + } + }); + + final Composite browseComp = composite; + Button browse = SWTUtil.createButton(composite, Messages.browse); + browse.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent se) { + FileDialog dialog = new FileDialog(browseComp.getShell()); + dialog.setText(Messages.browseSrcDialog); + dialog.setFilterPath(srcLoc.getText()); + String selected = dialog.open(); + if (selected != null) + srcLoc.setText(selected); + } + }); + } + + private GeronimoRuntimeDelegate getRuntimeDelegate() { + IRuntimeWorkingCopy wc = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME); + if (wc == null) + return null; + return (GeronimoRuntimeDelegate) wc.loadAdapter(GeronimoRuntimeDelegate.class, new NullProgressMonitor()); + } + + protected String getRuntimeName() { + if (getRuntimeDelegate() != null + && getRuntimeDelegate().getRuntime() != null) + return getRuntimeDelegate().getRuntime().getName(); + return null; + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeSourceWizardFragment.java ------------------------------------------------------------------------------ svn:mime-type = text/plain