You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2008/06/05 19:02:55 UTC
svn commit: r663660 - in /servicemix/sandbox/gshell-web: ./ gshell-gwt/
gshell-gwt/.settings/ gshell-gwt/src/ gshell-gwt/src/org/
gshell-gwt/src/org/apache/ gshell-gwt/src/org/apache/servicemix/
gshell-gwt/src/org/apache/servicemix/gshellweb/ gshell-gw...
Author: chirino
Date: Thu Jun 5 10:02:54 2008
New Revision: 663660
URL: http://svn.apache.org/viewvc?rev=663660&view=rev
Log:
Adding my fist cut of the client side the gwt bits needed to implement a web based gshell console
Added:
servicemix/sandbox/gshell-web/gshell-gwt/
servicemix/sandbox/gshell-web/gshell-gwt/.classpath
servicemix/sandbox/gshell-web/gshell-gwt/.project
servicemix/sandbox/gshell-web/gshell-gwt/.settings/
servicemix/sandbox/gshell-web/gshell-gwt/.settings/org.eclipse.jdt.core.prefs
servicemix/sandbox/gshell-web/gshell-gwt/README.txt
servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-compile (with props)
servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-shell (with props)
servicemix/sandbox/gshell-web/gshell-gwt/WebConsole.launch
servicemix/sandbox/gshell-web/gshell-gwt/pom.xml
servicemix/sandbox/gshell-web/gshell-gwt/src/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/WebConsole.gwt.xml
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/Console.java
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/WebConsole.java
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.css
servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.html
servicemix/sandbox/gshell-web/gshell-gwt/test/
servicemix/sandbox/gshell-web/gshell-gwt/tools.html
servicemix/sandbox/gshell-web/gshell-gwt/webapp/
servicemix/sandbox/gshell-web/gshell-gwt/webapp/WEB-INF/
servicemix/sandbox/gshell-web/gshell-gwt/webapp/WEB-INF/web.xml
servicemix/sandbox/gshell-web/gshell-gwt/webapp/index.html
servicemix/sandbox/gshell-web/pom.xml
Added: servicemix/sandbox/gshell-web/gshell-gwt/.classpath
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/.classpath?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/.classpath (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/.classpath Thu Jun 5 10:02:54 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="/Users/chirino/opt/gwt-mac-1.5.0/gwt-user.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: servicemix/sandbox/gshell-web/gshell-gwt/.project
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/.project?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/.project (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/.project Thu Jun 5 10:02:54 2008
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<projectDescription>
+ <name>gshell-gwt</name>
+ <comment>web-console project</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments/>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: servicemix/sandbox/gshell-web/gshell-gwt/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/.settings/org.eclipse.jdt.core.prefs?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/.settings/org.eclipse.jdt.core.prefs (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/.settings/org.eclipse.jdt.core.prefs Thu Jun 5 10:02:54 2008
@@ -0,0 +1,12 @@
+#Thu Jun 05 12:16:21 EDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: servicemix/sandbox/gshell-web/gshell-gwt/README.txt
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/README.txt?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/README.txt (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/README.txt Thu Jun 5 10:02:54 2008
@@ -0,0 +1 @@
+Please also see tools.html for details of the libraries and tools we use.
\ No newline at end of file
Added: servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-compile
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-compile?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-compile (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-compile Thu Jun 5 10:02:54 2008
@@ -0,0 +1,3 @@
+#!/bin/sh
+APPDIR=`dirname $0`;
+java -XstartOnFirstThread -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:/Users/chirino/opt/gwt-mac-1.5.0/gwt-user.jar:/Users/chirino/opt/gwt-mac-1.5.0/gwt-dev-mac.jar" com.google.gwt.dev.GWTCompiler -out "$APPDIR/www" "$@" org.apache.servicemix.gshellweb.WebConsole;
Propchange: servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-compile
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-shell
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-shell?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-shell (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-shell Thu Jun 5 10:02:54 2008
@@ -0,0 +1,3 @@
+#!/bin/sh
+APPDIR=`dirname $0`;
+java -XstartOnFirstThread -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:/Users/chirino/opt/gwt-mac-1.5.0/gwt-user.jar:/Users/chirino/opt/gwt-mac-1.5.0/gwt-dev-mac.jar" com.google.gwt.dev.GWTShell -out "$APPDIR/www" "$@" org.apache.servicemix.gshellweb.WebConsole/WebConsole.html;
Propchange: servicemix/sandbox/gshell-web/gshell-gwt/WebConsole-shell
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/sandbox/gshell-web/gshell-gwt/WebConsole.launch
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/WebConsole.launch?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/WebConsole.launch (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/WebConsole.launch Thu Jun 5 10:02:54 2008
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/gshell-gwt"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="gshell-gwt" path="1" type="4"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry externalArchive="/Users/chirino/opt/gwt-mac-1.5.0/gwt-dev-mac.jar" path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="gshell-gwt"/> </runtimeClasspathEntry> "/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.GWTShell"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-out www org.apache.servicemix.gshellweb.WebConsole/WebConsole.html"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="gshell-gwt"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XstartOnFirstThread -Xmx256M"/>
+</launchConfiguration>
Added: servicemix/sandbox/gshell-web/gshell-gwt/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/pom.xml?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/pom.xml (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/pom.xml Thu Jun 5 10:02:54 2008
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.gshell-web</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gshell-gwt</artifactId>
+ <packaging>war</packaging>
+
+ <name>ServiceMix GWT :: console</name>
+ <description>Gwt Shell Console</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>1.5-RC1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>1.5-RC1</version>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+<!--
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <scope>test</scope>
+ <version>2.0.6</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring</artifactId>
+ <version>3.1.0.2-fuse</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>qdox</groupId>
+ <artifactId>qdox</artifactId>
+ </exclusion>
+ </exclusions>
+
+ </dependency>
+-->
+
+ </dependencies>
+
+
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <testSourceDirectory>test</testSourceDirectory>
+ <testResources>
+ <testResource>
+ <directory>test</directory>
+ <includes>
+ <include>*.xml</include>
+ <include>*.log</include>
+ </includes>
+
+ </testResource>
+ </testResources>
+ <!--
+ <resources>
+ <resource>
+ <directory>src/webapp</directory>
+ </resource>
+ </resources>
+ -->
+
+ <plugins>
+<!-- We might have to manually install the gwt plugins into maven
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.2</version>
+ <executions>
+ <execution>
+ <id>gwt-servlet</id>
+ <goals>
+ <goal>install-file</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>1.5-snapshot</version>
+ <packaging>jar</packaging>
+ <pomFile>gwt-servlet-1.5-snapshot.pom</pomFile>
+ <file>dependencies/gwt-servlet-1.5-snapshot.jar</file>
+ </configuration>
+ </execution>
+ <execution>
+ <id>gwt-user</id>
+ <goals>
+ <goal>install-file</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>1.5-snapshot</version>
+ <packaging>jar</packaging>
+ <pomFile>gwt-user-1.5-snapshot.pom</pomFile>
+ <file>dependencies/gwt-user-1.5-snapshot.jar</file>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+-->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>gwtforge.gwtplugin</groupId>
+ <artifactId>gwtforge.gwtplugin</artifactId>
+ <!-- <version>1.4.61</version> -->
+ <version>1.5-dev-27-01-2008</version>
+
+ <!--Associate the plugin to the maven compile phase-->
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ <configuration>
+ <!-- The plugin will discover the modules by itself -->
+ <!-- Define here the target compilation directory -->
+ <out>.</out>
+ <!-- Define here the log level of the gwt compiler -->
+ <!-- Could be : INFO , ERROR , WARN , SPAM -->
+ <loglevel>ALL</loglevel>
+
+ <!-- OPTIONAL JVM OPTIONS -->
+ <!-- See http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html#0.0.0.0./Heap/Size/7Coutline -->
+ <!-- Define the java heap size -->
+ <initialheapsize>500m</initialheapsize>
+ <!-- Define the maximum java heap size -->
+ <maximumheapsize>500m</maximumheapsize>
+ <!-- Define the heap size for young generation -->
+ <younggenerationheapsize>250m</younggenerationheapsize>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <webXml>webapp/WEB-INF/web.xml</webXml>
+ <warSourceDirectory>webapp</warSourceDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <configuration>
+ <webAppSourceDirectory>${basedir}/target/${pom.artifactId}-${pom.version}</webAppSourceDirectory>
+ <webXml>${basedir}/target/${pom.artifactId}-${pom.version}/WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <background>true</background>
+ <logOutput>true</logOutput>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/WebConsole.gwt.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/WebConsole.gwt.xml?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/WebConsole.gwt.xml (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/WebConsole.gwt.xml Thu Jun 5 10:02:54 2008
@@ -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.
+-->
+<module>
+
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User'/>
+
+ <!-- Inherit the default GWT style sheet. You can change -->
+ <!-- the theme of your GWT application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <inherits name='com.google.gwt.user.theme.standard.Standard'/>
+ <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
+ <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> -->
+
+ <!-- Other module inherits -->
+
+
+ <!-- Specify the app entry point class. -->
+ <entry-point class='org.apache.servicemix.gshellweb.client.WebConsole'/>
+
+ <!-- Specify the application specific style sheet. -->
+ <stylesheet src='WebConsole.css' />
+
+</module>
Added: servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/Console.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/Console.java?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/Console.java (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/Console.java Thu Jun 5 10:02:54 2008
@@ -0,0 +1,194 @@
+/*
+ * 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.servicemix.gshellweb.client;
+
+import java.util.ArrayList;
+
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.WindowResizeListener;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.KeyboardListenerAdapter;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+public class Console extends PopupPanel {
+
+ private HTML output;
+ private HTML prompt;
+ private TextBox input;
+
+ public interface CommandListener {
+ public void onCommand(Console source, String command);
+ }
+
+ CommandListener commandListener;
+ ArrayList<String> commandHistory = new ArrayList<String>();
+ int historyIndex=0;
+ private boolean showing;
+
+ public Console() {
+
+ addStyleName("console");
+ addStyleName("console-pro");
+ setAnimationEnabled(true);
+
+ FlowPanel panel = new FlowPanel();
+ add(panel);
+
+ // Setup the output area.
+ output = new HTML();
+ output.setStyleName("output");
+ panel.add(output);
+
+ // Setup the prompt Area..
+ prompt = new HTML();
+ prompt.setStyleName("prompt");
+ input = new TextBox();
+ input.setStyleName("input");
+ Grid promptTable = new Grid(1, 2);
+ promptTable.setWidget(0, 0, prompt);
+ promptTable.getCellFormatter().setStyleName(0, 0, "prompt");
+ promptTable.setWidget(0, 1, input);
+ promptTable.getCellFormatter().setStyleName(0, 1, "input");
+ panel.add(promptTable);
+
+ input.addKeyboardListener(new KeyboardListenerAdapter() {
+ public void onKeyPress(Widget sender, char keyCode, int modifiers) {
+ switch (keyCode) {
+ case KEY_TAB:
+ onTab();
+ input.cancelKey();
+ break;
+ case KEY_UP:
+ onUpHistory();
+ input.cancelKey();
+ break;
+ case KEY_DOWN:
+ onDownHistroy();
+ input.cancelKey();
+ break;
+ case KEY_ENTER:
+ onEnter();
+ input.cancelKey();
+ break;
+ }
+ }
+
+ });
+
+ getElement().getStyle().setProperty("margin","20px");
+ getElement().getStyle().setProperty("minWidth", (Window.getClientWidth()-100)+"px");
+ getElement().getStyle().setProperty("minHeight", (Window.getClientHeight()-100)+"px");
+
+ Window.addWindowResizeListener(new WindowResizeListener() {
+ public void onWindowResized(int width, int height) {
+ getElement().getStyle().setProperty("minWidth", (Window.getClientWidth()-100)+"px");
+ getElement().getStyle().setProperty("minHeight", (Window.getClientHeight()-100)+"px");
+ input.getElement().scrollIntoView();
+ }
+ });
+
+ }
+
+ protected void onTab() {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void onEnter() {
+
+ String command = input.getText();
+ input.setText("");
+ commandHistory.add(command);
+
+ println(prompt.getHTML()+command);
+
+ if( commandListener!=null ) {
+ commandListener.onCommand(this, command);
+ } else {
+ println("Internal Error.. no command listener configured.");
+ }
+
+ }
+
+ private void println(String line) {
+ output.setHTML(output.getHTML()+line+"\n");
+ input.getElement().scrollIntoView();
+ }
+
+ protected void onDownHistroy() {
+ // TODO Auto-generated method stub
+ }
+
+ protected void onUpHistory() {
+ }
+
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ input.setFocus(true);
+ }
+ }
+
+ public CommandListener getCommandListener() {
+ return commandListener;
+ }
+
+ public void setCommandListener(CommandListener commandListener) {
+ this.commandListener = commandListener;
+ }
+
+ public void setOutputHTML(String text) {
+ output.setHTML(text);
+ }
+
+ public void setPromptHTML(String text) {
+ prompt.setHTML(text);
+ }
+
+ public void toggleShowing() {
+ if (showing) {
+ hide();
+ } else {
+ show();
+ }
+ }
+
+ @Override
+ public void show() {
+ super.show();
+ input.getElement().scrollIntoView();
+ input.setFocus(true);
+ showing=true;
+
+ }
+
+ @Override
+ public void hide() {
+ super.hide();
+ showing=false;
+ }
+
+ public boolean isShowing() {
+ return showing;
+ }
+}
Added: servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/WebConsole.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/WebConsole.java?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/WebConsole.java (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/client/WebConsole.java Thu Jun 5 10:02:54 2008
@@ -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.servicemix.gshellweb.client;
+
+import com.google.gwt.core.client.EntryPoint;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class WebConsole implements EntryPoint {
+
+ private static Console console;
+
+ public void onModuleLoad() {
+ installKeyHook();
+ }
+
+ public static native void installKeyHook() /*-{
+ function keyHandler(e)
+ {
+ var keyCode = e.which || e.keyCode || -1;
+ if( keyCode == 126 ) {
+ @org.apache.servicemix.gshellweb.client.WebConsole::toggleConsole()();
+ return false;
+ }
+ return true;
+ }
+ $wnd.document.onkeypress = keyHandler;
+ }-*/;
+
+ public static void toggleConsole() {
+ if (console == null) {
+ console = new Console();
+ console.setOutputHTML("Hello world\nthis rocks...\n");
+ console.setPromptHTML("<b>activemq></b> ");
+ console.show();
+ } else {
+ console.toggleShowing();
+ }
+ }
+
+
+}
Added: servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.css
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.css?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.css (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.css Thu Jun 5 10:02:54 2008
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+/*
+ * The standard console look
+ */
+div.console {
+ padding:10px;
+}
+div.console * {
+ font-family:monospace;
+ font-size:12px;
+
+ margin:0px;
+ padding:0px;
+ border:0px none;
+ border-collapse:collapse;
+ border-spacing:0px;
+ outline-style:none;
+ outline-width:0pt;
+ white-space: pre;
+}
+div.console td {
+ vertical-align:top;
+}
+div.console td.input, div.console td.input * {
+ width:100%;
+ background: black;
+}
+
+/*
+ * Define an optional pro color style that makes
+ * the console white on black with a slightly transparent background
+ */
+div.console-pro {
+
+ filter:alpha(opacity=50);
+ -moz-opacity:0.85;
+ -khtml-opacity: 0.85;
+ opacity: 0.85;
+
+ background: black;
+}
+div.console-pro * {
+ color: white;
+}
+div.console-pro td.input, div.console-pro td.input * {
+ background: black;
+}
+
Added: servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.html
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.html?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.html (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/src/org/apache/servicemix/gshellweb/public/WebConsole.html Thu Jun 5 10:02:54 2008
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>WebConsole</title>
+ <script type="text/javascript" language="javascript" src="org.apache.servicemix.gshellweb.WebConsole.nocache.js"></script>
+ <link href="WebConsole.css" type="text/css" rel="stylesheet">
+ </head>
+ <body>
+
+ <h2> GWT Shell Demo </h2>
+ <p>
+
+ Ideally this page would be a cool little web based admin GUI for the ServiceMix 4 runtime. But since that does not exist yet,
+ this static page is all you get.<br/>
+ <br/>
+ But don't fear, just press '~' (the tilda key), to bring up a cool little command line interface that
+ can access the ServiceMix command line. This will remain a permanent feature of the ServiceMix admin GUI so that
+ hard core admins can always easily access all the servicemix commands even over the web.
+
+ </p>
+
+ </body>
+</html>
Added: servicemix/sandbox/gshell-web/gshell-gwt/tools.html
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/tools.html?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/tools.html (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/tools.html Thu Jun 5 10:02:54 2008
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+ 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.
+-->
+<html>
+<head>
+ <title>Tools</title>
+</head>
+<body>
+<h1>Tools</h1>
+
+<p>
+ The ServiceMix Web Console is based on
+ <a href="http://code.google.com/webtoolkit/">GWT</a> to provide the UI framework and RPC
+</p>
+
+<h2>Libraries</h2>
+<p>
+ The following libraries are used
+</p>
+<ul>
+ <li>
+ <a href="http://code.google.com/webtoolkit/">GWT</a> to provide the UI framework and RPC
+ </li>
+</ul>
+
+<h2>Other Tools</h2>
+<ul>
+ <li>
+ <a href="http://code.google.com/p/gwt-maven/">maven-gwt-plugin</a> for compiling and building the WAR. See the
+ <a href="http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/index.html">reference guide</a>
+ </li>
+</ul>
+</body>
+</html>
\ No newline at end of file
Added: servicemix/sandbox/gshell-web/gshell-gwt/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/webapp/WEB-INF/web.xml?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/webapp/WEB-INF/web.xml (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/webapp/WEB-INF/web.xml Thu Jun 5 10:02:54 2008
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>ServiceMix Web Console</description>
+ <display-name>ServiceMix Console</display-name>
+
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added: servicemix/sandbox/gshell-web/gshell-gwt/webapp/index.html
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/gshell-gwt/webapp/index.html?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/gshell-gwt/webapp/index.html (added)
+++ servicemix/sandbox/gshell-web/gshell-gwt/webapp/index.html Thu Jun 5 10:02:54 2008
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta HTTP-EQUIV="REFRESH" content="0; url=org.apache.servicemix.gshellweb.WebConsole/WebConsole.html">
+</head>
+</html>
\ No newline at end of file
Added: servicemix/sandbox/gshell-web/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gshell-web/pom.xml?rev=663660&view=auto
==============================================================================
--- servicemix/sandbox/gshell-web/pom.xml (added)
+++ servicemix/sandbox/gshell-web/pom.xml Thu Jun 5 10:02:54 2008
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.features</groupId>
+ <artifactId>features</artifactId>
+ <version>4.0-m2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.gshell-web</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>ServiceMix 4 Web Console</name>
+
+ <prerequisites>
+ <maven>2.0.6</maven>
+ </prerequisites>
+
+ <repositories>
+ <!-- Default repository -->
+ <repository>
+ <id>central</id>
+ <name>Default maven repo</name>
+ <url>http://repo1.maven.org/maven2</url>
+ </repository>
+ <!-- ServiceMix repo -->
+ <repository>
+ <id>servicemix</id>
+ <name>ServiceMix Repository</name>
+ <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
+ </repository>
+ <!-- Spring Milestone repo -->
+ <repository>
+ <id>spring-milestone</id>
+ <name>Spring Milestone Repository</name>
+ <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url>
+ </repository>
+
+ <repository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
+ </repository>
+ <repository>
+ <id>gwtforge</id>
+ <url>http://gwtforge.com/maven-repository/trunk/</url>
+ </repository>
+
+ <repository>
+ <id>openqa.org</id>
+ <name>Openqa Release Repository</name>
+ <url>http://archiva.openqa.org/repository/releases</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>openqa.org</id>
+ <name>Openqa Snapshot Repository</name>
+ <url>http://archiva.openqa.org/repository/snapshots</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ <checksumPolicy>ignore</checksumPolicy>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>gwtforge</id>
+ <url>http://gwtforge.com/maven-repository/trunk/</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <modules>
+ <module>gshell-gwt</module>
+ </modules>
+
+</project>