Author: rombert
Date: Fri Jul 19 15:02:12 2013
New Revision: 1504892

URL: http://svn.apache.org/r1504892
Log:
SLING-2793 - [Tooling] Align Eclipse tooling to proposed structure

WIP on getting a WST server definition

Added:
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/META-INF/
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/META-INF/MANIFEST.MF
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/build.properties   
(with props)
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/logo.png   
(with props)
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/sling.gif   
(with props)
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml   (with 
props)
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml   (with 
props)
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java
   (with props)
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java
   (with props)
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java
   (with props)
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java
   (with props)
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java
   (with props)
Modified:
    sling/whiteboard/asanso/plugins/eclipse/pom.xml
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-feature/feature.xml
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-target-definition/org.apache.sling.slingclipse.target-definition.target

Modified: sling/whiteboard/asanso/plugins/eclipse/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/pom.xml?rev=1504892&r1=1504891&r2=1504892&view=diff
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/pom.xml (original)
+++ sling/whiteboard/asanso/plugins/eclipse/pom.xml Fri Jul 19 15:02:12 2013
@@ -13,6 +13,7 @@
                <module>slingclipse-api</module>
                <module>slingclipse-http</module>
                <module>slingclipse-plugin</module>
+               <module>slingclipse-wst</module>
                <module>slingclipse-feature</module>
                <module>slingclipse-p2update</module>
        </modules>

Modified: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-feature/feature.xml
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-feature/feature.xml?rev=1504892&r1=1504891&r2=1504892&view=diff
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-feature/feature.xml 
(original)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-feature/feature.xml Fri 
Jul 19 15:02:12 2013
@@ -33,4 +33,11 @@
          version="0.0.0"
          unpack="false"/>
 
+   <plugin
+         id="org.apache.sling.slingclipse-wst"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>

Modified: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-target-definition/org.apache.sling.slingclipse.target-definition.target
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-target-definition/org.apache.sling.slingclipse.target-definition.target?rev=1504892&r1=1504891&r2=1504892&view=diff
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-target-definition/org.apache.sling.slingclipse.target-definition.target
 (original)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-target-definition/org.apache.sling.slingclipse.target-definition.target
 Fri Jul 19 15:02:12 2013
@@ -1,16 +1,15 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.6"?>
-
-<target>
+<?pde version="3.8"?><target sequenceNumber="3">
 <locations>
-<location includeAllPlatforms="false" includeMode="planner" 
includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.platform.feature.group" 
version="3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q"/>
-<repository location="http://download.eclipse.org/releases/indigo"/>
-</location>
-<location includeAllPlatforms="false" includeMode="planner" 
includeSource="true" type="InstallableUnit">
+<location includeAllPlatforms="false" includeConfigurePhase="false" 
includeMode="planner" includeSource="true" type="InstallableUnit">
 <unit id="org.apache.commons.httpclient" version="3.1.0.v201012070820"/>
 <unit id="org.json" version="1.0.0.v201011060100"/>
 <repository 
location="http://download.eclipse.org/tools/orbit/downloads/drops/R20120526062928/repository"/>
 </location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" 
includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.wst.server_adapters.feature.feature.group" 
version="3.2.100.v20110303-51EoAkF77g8HBSc"/>
+<unit id="org.eclipse.platform.feature.group" 
version="3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q"/>
+<repository location="http://download.eclipse.org/releases/indigo"/>
+</location>
 </locations>
 </target>

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/META-INF/MANIFEST.MF
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/META-INF/MANIFEST.MF?rev=1504892&view=auto
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/META-INF/MANIFEST.MF 
(added)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/META-INF/MANIFEST.MF 
Fri Jul 19 15:02:12 2013
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Slingclipse-WST-plugin
+Bundle-SymbolicName: org.apache.sling.slingclipse-wst;singleton:=true
+Bundle-Version: 0.0.1.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .
+Import-Package: org.eclipse.core.runtime;version="3.4.0",
+ org.eclipse.jface.viewers,
+ org.eclipse.swt,
+ org.eclipse.swt.events,
+ org.eclipse.swt.layout,
+ org.eclipse.swt.widgets,
+ org.eclipse.ui,
+ org.eclipse.ui.forms,
+ org.eclipse.ui.forms.widgets,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.server.core.model,
+ org.eclipse.wst.server.ui.editor,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime.jobs

Added: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/build.properties
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/build.properties?rev=1504892&view=auto
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/build.properties 
(added)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/build.properties 
Fri Jul 19 15:02:12 2013
@@ -0,0 +1,5 @@
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               icons/
+source.. = src/

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/logo.png
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/logo.png?rev=1504892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/logo.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/sling.gif
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/sling.gif?rev=1504892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/icons/obj16/sling.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml?rev=1504892&view=auto
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml (added)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml Fri Jul 
19 15:02:12 2013
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+  <extension point="org.eclipse.wst.server.core.runtimeTypes">
+  
+    <runtimeType
+       id="org.apache.sling.ide.eclipse.wst.slingLaunchpad"
+       name="Sling Launchpad"
+       description="Sling Launchpad"
+       vendor="Sling"
+       version="2.4"
+       class="org.apache.sling.ide.eclipse.wst.internal.SlingLaunchpadRuntime">
+       
+       <!-- TODO do we need a Sling module type ? -->
+       
+       <!--
+       <moduleType
+         types="jst.web"
+         versions="2.2, 2.3, 2.4, 2.5"/>
+       <moduleType
+         types="jst.utility"
+         versions="1.0"/>
+         -->
+    </runtimeType>
+  </extension>
+  
+  <!-- TODO remove launchConfigId for now ? -->
+  <extension point="org.eclipse.wst.server.core.serverTypes">
+     <serverType
+       id="org.apache.sling.ide.eclipse.wst.slingLaunchpad"
+       name="Sling Launchpad"
+       description="Sling Launchpad"
+       supportsRemoteHosts="true"
+       runtime="true"
+       startTimeout="30000"
+       stopTimeout="15000"
+       initialState="stopped"
+       hasConfiguration="true"
+       
launchConfigId="org.apache.sling.ide.eclipse.wst.slingLaunchpadConfigurationType"
+       runtimeTypeId="org.apache.sling.ide.eclipse.wst.slingLaunchpad"
+       class="org.apache.sling.ide.eclipse.wst.internal.SlingLaunchpadServer"
+       
behaviourClass="org.apache.sling.ide.eclipse.wst.internal.SlingLaunchpadBehaviour">
+     </serverType>
+  </extension>
+
+<!-- TODO move to wst.ui bundle -->  
+       <extension point="org.eclipse.wst.server.ui.serverImages">      
+             <image
+                id="org.apache.sling.ide.eclipse.wst.launchpad"
+                icon="icons/obj16/sling.gif"
+                typeIds="org.apache.sling.ide.eclipse.wst.slingLaunchpad"/>
+       </extension>  
+       
+   <extension point="org.eclipse.wst.server.ui.editorPageSections">      
+      <section
+         id="org.apache.sling.ide.eclipse.configuration.editor.port"
+         order="10"
+         insertionId="org.eclipse.wst.server.editor.overview.right"
+         typeIds="org.apache.sling.ide.eclipse.wst.*"
+         
class="org.apache.sling.ide.eclipse.wst.ui.internal.ConnectionEditorSection">
+      </section>
+   </extension>        
+</plugin>    

Propchange: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml?rev=1504892&view=auto
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml (added)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml Fri Jul 19 
15:02:12 2013
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"; 
xmlns="http://maven.apache.org/POM/4.0.0";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.sling.slingclipse</groupId>
+    <artifactId>slingclipse</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+  <artifactId>org.apache.sling.slingclipse-wst</artifactId>
+  <packaging>eclipse-plugin</packaging>
+</project>

Propchange: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java?rev=1504892&view=auto
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java
 (added)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java
 Fri Jul 19 15:02:12 2013
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.ide.eclipse.wst.internal;
+
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+
+public class SlingLaunchpadBehaviour extends ServerBehaviourDelegate {
+
+    @Override
+    public void stop(boolean arg0) {
+    }
+
+}

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadBehaviour.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java?rev=1504892&view=auto
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java
 (added)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java
 Fri Jul 19 15:02:12 2013
@@ -0,0 +1,108 @@
+/*
+ * 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.sling.ide.eclipse.wst.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public class SlingLaunchpadConfiguration {
+
+    private final IFolder path;
+
+    private int port = 8080;
+    private String contextPath = "/";
+    private String username = "admin";
+    private String password = "admin";
+
+    public SlingLaunchpadConfiguration(IFolder path) {
+        this.path = path;
+    }
+
+    public void load(IProgressMonitor monitor) {
+
+        IFile configFile = path.getFile("config.ini");
+        if (!configFile.exists()) {
+            return;
+        }
+
+        Properties p = new Properties();
+        InputStream contents = null;
+        try {
+            contents = configFile.getContents();
+            p.load(contents);
+
+            port = Integer.parseInt(p.getProperty("launchpad.port"));
+            contextPath = p.getProperty("launchpad.contextPath", "/");
+            username = p.getProperty("launchpad.username");
+            password = p.getProperty("launchpad.password");
+
+        } catch (CoreException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } finally {
+            try {
+                contents.close();
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public String getContextPath() {
+        return contextPath;
+    }
+
+    public void setContextPath(String contextPath) {
+        this.contextPath = contextPath;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+}

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java?rev=1504892&view=auto
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java
 (added)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java
 Fri Jul 19 15:02:12 2013
@@ -0,0 +1,24 @@
+/*
+ * 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.sling.ide.eclipse.wst.internal;
+
+import org.eclipse.wst.server.core.model.RuntimeDelegate;
+
+public class SlingLaunchpadRuntime extends RuntimeDelegate {
+
+
+}

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadRuntime.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java?rev=1504892&view=auto
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java
 (added)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java
 Fri Jul 19 15:02:12 2013
@@ -0,0 +1,87 @@
+/*
+ * 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.sling.ide.eclipse.wst.internal;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+
+public class SlingLaunchpadServer extends ServerDelegate {
+
+    private SlingLaunchpadConfiguration config;
+
+    public SlingLaunchpadConfiguration getConfiguration() {
+
+        if (config != null) {
+            return config;
+        }
+
+        IFolder folder = getServer().getServerConfiguration();
+
+        config = new SlingLaunchpadConfiguration(folder);
+        config.load(new NullProgressMonitor()); // TODO progress monitor
+
+        return config;
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see 
org.eclipse.wst.server.core.model.ServerDelegate#canModifyModules(org.eclipse.wst.server.core.IModule[],
+     * org.eclipse.wst.server.core.IModule[])
+     */
+    @Override
+    public IStatus canModifyModules(IModule[] arg0, IModule[] arg1) {
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see 
org.eclipse.wst.server.core.model.ServerDelegate#getChildModules(org.eclipse.wst.server.core.IModule[])
+     */
+    @Override
+    public IModule[] getChildModules(IModule[] arg0) {
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see 
org.eclipse.wst.server.core.model.ServerDelegate#getRootModules(org.eclipse.wst.server.core.IModule)
+     */
+    @Override
+    public IModule[] getRootModules(IModule arg0) throws CoreException {
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see 
org.eclipse.wst.server.core.model.ServerDelegate#modifyModules(org.eclipse.wst.server.core.IModule[],
+     * org.eclipse.wst.server.core.IModule[], 
org.eclipse.core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void modifyModules(IModule[] arg0, IModule[] arg1, IProgressMonitor 
arg2) throws CoreException {
+    }
+
+}

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/internal/SlingLaunchpadServer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java?rev=1504892&view=auto
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java
 (added)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java
 Fri Jul 19 15:02:12 2013
@@ -0,0 +1,149 @@
+/*
+ * 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.sling.ide.eclipse.wst.ui.internal;
+
+import java.beans.PropertyChangeListener;
+
+import org.apache.sling.ide.eclipse.wst.internal.SlingLaunchpadConfiguration;
+import org.apache.sling.ide.eclipse.wst.internal.SlingLaunchpadServer;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+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.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+public class ConnectionEditorSection extends ServerEditorSection {
+    protected boolean _updating;
+    protected PropertyChangeListener _listener;
+
+    private Text portText;
+    private Text contextPathText;
+    private Text usernameText;
+    private Text passwordText;
+    private SlingLaunchpadServer launchpadServer;
+
+    @Override
+    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("Connection");
+        section.setDescription("Specify how to connect to the launchpad 
instace");
+        section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | 
GridData.VERTICAL_ALIGN_FILL));
+
+        // ports
+        Composite composite = toolkit.createComposite(section);
+
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.marginHeight = 8;
+        layout.marginWidth = 8;
+        composite.setLayout(layout);
+        GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | 
GridData.FILL_HORIZONTAL);
+        composite.setLayoutData(gridData);
+        toolkit.paintBordersFor(composite);
+        section.setClient(composite);
+
+        createLabel(toolkit, composite, "Port");
+        portText = createText(toolkit, composite, SWT.SINGLE);
+
+        createLabel(toolkit, composite, "Context path");
+        contextPathText = createText(toolkit, composite, SWT.SINGLE);
+
+        // TODO wrong parent
+        Label separator = toolkit.createSeparator(parent, SWT.HORIZONTAL);
+        GridData data = new GridData(GridData.FILL_HORIZONTAL);
+        data.horizontalSpan = 2;
+        separator.setLayoutData(data);
+
+        createLabel(toolkit, composite, "Username");
+        usernameText = createText(toolkit, composite, SWT.SINGLE);
+
+        createLabel(toolkit, composite, "Password");
+        passwordText = createText(toolkit, composite, SWT.PASSWORD);
+
+        initialize();
+    }
+
+    private void createLabel(FormToolkit toolkit, Composite composite, String 
label) {
+        Label portLabel = toolkit.createLabel(composite, label);
+        
portLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+        GridData data = new GridData(GridData.FILL_HORIZONTAL);
+        data.horizontalIndent = 20;
+        data.widthHint = 20;
+        portLabel.setLayoutData(data);
+    }
+
+    private Text createText(FormToolkit toolkit, Composite composite, int 
flags) {
+        Text port = toolkit.createText(composite, "", flags);
+        GridData data = new GridData(GridData.FILL_HORIZONTAL);
+        data.widthHint = 30;
+        port.setLayoutData(data);
+
+        return port;
+    }
+
+    public void init(IEditorSite site, IEditorInput input) {
+        super.init(site, input);
+
+        launchpadServer = (SlingLaunchpadServer) 
server.getAdapter(SlingLaunchpadServer.class);
+        if (launchpadServer == null) {
+            // TODO progress monitor
+            launchpadServer = (SlingLaunchpadServer) 
server.loadAdapter(SlingLaunchpadServer.class,
+                    new NullProgressMonitor());
+        }
+    }
+
+    private void initialize() {
+
+        final SlingLaunchpadConfiguration config = 
launchpadServer.getConfiguration();
+
+        portText.setText(String.valueOf(config.getPort()));
+        contextPathText.setText(config.getContextPath());
+
+        usernameText.setText(config.getUsername());
+        passwordText.setText(config.getPassword());
+
+        portText.addModifyListener(new ModifyListener() {
+
+            @Override
+            public void modifyText(ModifyEvent e) {
+
+                try {
+                    config.setPort(Integer.parseInt(portText.getText()));
+                    // TODO persist change
+                } catch (NumberFormatException ex) {
+                    // shucks
+                }
+            }
+        });
+    }
+
+}

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-wst/src/org/apache/sling/ide/eclipse/wst/ui/internal/ConnectionEditorSection.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL


Reply via email to