Author: ajith
Date: Mon May  1 21:21:00 2006
New Revision: 398800

URL: http://svn.apache.org/viewcvs?rev=398800&view=rev
Log:
1. Added idea plugin code to tcpmon. These classes are excluded from the build 
but the relevant idea project can be created by running the create-project.xml
2. Promoted AdminPane from being package to public

Added:
    webservices/commons/trunk/modules/tcpmon/create-project.xml
    webservices/commons/trunk/modules/tcpmon/resources/
    webservices/commons/trunk/modules/tcpmon/resources/idea/
    webservices/commons/trunk/modules/tcpmon/resources/idea/plugin.xml
    
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/
    
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/ComponentHandler.java
    
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaPlugin.java
    
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaTCPMonToolWindow.java
Modified:
    webservices/commons/trunk/modules/tcpmon/project.properties
    webservices/commons/trunk/modules/tcpmon/project.xml
    
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java

Added: webservices/commons/trunk/modules/tcpmon/create-project.xml
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/create-project.xml?rev=398800&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/create-project.xml (added)
+++ webservices/commons/trunk/modules/tcpmon/create-project.xml Mon May  1 
21:21:00 2006
@@ -0,0 +1,37 @@
+<project basedir="." default="generate-tcpmon-project">
+
+       <property name="src" value="./src"/>
+       <property name="output" value="./idea_projects"/>
+       <property name="tcpmon.output.dir" value="${output}/tcpmon"/>
+       <property name="source.dir.name" value="src"/>
+       <property name="lib.dir.name" value="lib"/>
+       <property name="bin.dir.name" value="bin"/>
+       <property name="tcpmon.resource.dir" value="./resources/idea"/>
+       <!-- init-->
+       <target name="init">
+               <mkdir dir="${output}"/>
+               <mkdir dir="${tcpmon.output.dir}"/>
+       </target>
+       
+       <!-- generate the tcpmon project -->
+       <target name="generate-tcpmon-project" depends="init">
+               <mkdir dir="${tcpmon.output.dir}/${source.dir.name}"/>
+               <!-- copy the source to src -->
+               <copy todir="${tcpmon.output.dir}/${source.dir.name}">
+                       <fileset dir="${src}"/>
+               </copy>
+               
+               <!-- Copy the other stuff -->
+               <copy todir="${tcpmon.output.dir}/META-INF">
+                       <fileset dir="${tcpmon.resource.dir}"/>
+               </copy>
+               <!-- create bin directory -->
+               <mkdir dir="${tcpmon.output.dir}/${bin.dir.name}"/>
+               
+       </target>
+       
+       <!-- Clean the directory -->
+       <target name="clean">
+               <delete dir="${output}"/>
+       </target>
+</project>

Modified: webservices/commons/trunk/modules/tcpmon/project.properties
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/project.properties?rev=398800&r1=398799&r2=398800&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/project.properties (original)
+++ webservices/commons/trunk/modules/tcpmon/project.properties Mon May  1 
21:21:00 2006
@@ -19,7 +19,7 @@
 # -------------------------------------------------------------------
 #                Project Information
 # -------------------------------------------------------------------
-tcpmon.version=SNAPSHOT
+tcpmon.version=1.0
 # -------------------------------------------------------------------
 #                Compile
 # -------------------------------------------------------------------

Modified: webservices/commons/trunk/modules/tcpmon/project.xml
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/project.xml?rev=398800&r1=398799&r2=398800&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/project.xml (original)
+++ webservices/commons/trunk/modules/tcpmon/project.xml Mon May  1 21:21:00 
2006
@@ -171,6 +171,15 @@
        <build>
                <nagEmailAddress>[email protected]</nagEmailAddress>
                <sourceDirectory>src</sourceDirectory>
+                <!-- exclude the tcpmon plugin classes-->
+                 <sourceModifications>
+            <sourceModification>
+                <className>fakeClass</className>
+                <excludes>
+                    <exclude>**/idea/**/*.java</exclude>
+                 </excludes>
+            </sourceModification>
+        </sourceModifications>
        </build>
  <!-- maven site fails if this dummy report is not there -->
     <reports>

Added: webservices/commons/trunk/modules/tcpmon/resources/idea/plugin.xml
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/resources/idea/plugin.xml?rev=398800&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/resources/idea/plugin.xml (added)
+++ webservices/commons/trunk/modules/tcpmon/resources/idea/plugin.xml Mon May  
1 21:21:00 2006
@@ -0,0 +1,15 @@
+<!DOCTYPE idea-plugin PUBLIC "Plugin/DTD" 
"http://plugins.intellij.net/plugin.dtd";>
+<idea-plugin>
+  <name>TCPMon</name>
+  <description>TCPMon from Apache - WS commons project. The original code
+               comes from the Axis 1.1 source</description>
+  <version>1.0</version>
+  <vendor>Apache Software Foundation</vendor>
+  <idea-version since-build="3000"/>
+   <project-components>
+       <component>
+           
<interface-class>org.apache.ws.commons.tcpmon.idea.IdeaPlugin</interface-class>
+           
<implementation-class>org.apache.ws.commons.tcpmon.idea.IdeaPlugin</implementation-class>
+       </component>
+   </project-components>
+</idea-plugin>
\ No newline at end of file

Modified: 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java?rev=398800&r1=398799&r2=398800&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java
 (original)
+++ 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java
 Mon May  1 21:21:00 2006
@@ -42,7 +42,7 @@
 /**
  * this is the admin page
  */
-class AdminPane extends JPanel {
+public class AdminPane extends JPanel {
        
     /**
      * Field listenerButton, proxyButton

Added: 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/ComponentHandler.java
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/ComponentHandler.java?rev=398800&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/ComponentHandler.java
 (added)
+++ 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/ComponentHandler.java
 Mon May  1 21:21:00 2006
@@ -0,0 +1,33 @@
+package org.apache.ws.commons.tcpmon.idea;
+
+import javax.swing.*;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class ComponentHandler {
+
+    private static IdeaTCPMonToolWindow tcpMonitorInstance;
+
+    public static JComponent getTCPMonTabbedPane(){
+        if (tcpMonitorInstance==null){
+            tcpMonitorInstance = new IdeaTCPMonToolWindow();
+        }
+
+        return tcpMonitorInstance;
+    }
+
+
+}

Added: 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaPlugin.java
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaPlugin.java?rev=398800&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaPlugin.java
 (added)
+++ 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaPlugin.java
 Mon May  1 21:21:00 2006
@@ -0,0 +1,70 @@
+package org.apache.ws.commons.tcpmon.idea;
+
+import com.intellij.openapi.components.ProjectComponent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.wm.ToolWindow;
+import com.intellij.openapi.wm.ToolWindowManager;
+import com.intellij.openapi.wm.ToolWindowAnchor;
+
+import javax.swing.*;
+import java.net.URL;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class IdeaPlugin implements ProjectComponent {
+
+    private static final String TCPMON_NAME = "TCPMon";
+    private Project project;
+
+
+    public IdeaPlugin(Project project) {
+        this.project = project;
+    }
+
+    public void projectOpened() {
+        initToolWindow();
+    }
+
+    public void projectClosed() {
+       unregisterToolWindow();
+    }
+
+    public String getComponentName() {
+        return TCPMON_NAME;
+    }
+
+    public void initComponent() {
+        //nothing to do here
+    }
+
+    public void disposeComponent() {
+        //nothing to do here
+    }
+
+    private void initToolWindow() {
+        ToolWindowManager toolWindowManager = 
ToolWindowManager.getInstance(project);
+        toolWindowManager.registerToolWindow(
+                TCPMON_NAME,
+                ComponentHandler.getTCPMonTabbedPane(),
+                ToolWindowAnchor.RIGHT);
+//        URL resource = 
getClass().getClassLoader().getResource("images/tcpmonitor.gif");
+//        toolWindow.setIcon(new ImageIcon(resource));
+    }
+
+    private void unregisterToolWindow() {
+        //do nothing
+    }
+}

Added: 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaTCPMonToolWindow.java
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaTCPMonToolWindow.java?rev=398800&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaTCPMonToolWindow.java
 (added)
+++ 
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/idea/IdeaTCPMonToolWindow.java
 Mon May  1 21:21:00 2006
@@ -0,0 +1,31 @@
+package org.apache.ws.commons.tcpmon.idea;
+
+import org.apache.ws.commons.tcpmon.TCPMon;
+import org.apache.ws.commons.tcpmon.AdminPane;
+
+import javax.swing.*;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class IdeaTCPMonToolWindow extends JTabbedPane {
+
+    public IdeaTCPMonToolWindow() {
+        new AdminPane(this, TCPMon.getMessage("admin00", "Admin"));
+    }
+}
+
+
+


Reply via email to