[jbpm-commits] JBoss JBPM SVN: r3657 - in projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client: mapsplugin and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Jan 15 16:21:48 EST 2009
Author: heiko.braun at jboss.com
Date: 2009-01-15 16:21:47 -0500 (Thu, 15 Jan 2009)
New Revision: 3657
Added:
projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/
projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java
projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java
Log:
maps editor impl
Added: projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java
===================================================================
--- projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java (rev 0)
+++ projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java 2009-01-15 21:21:47 UTC (rev 3657)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.mapsplugin;
+
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.View;
+import com.google.gwt.user.client.ui.Frame;
+
+/**
+ * An example editor that embeds google maps into the console
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MapsEditor extends Editor
+{
+ public final static String ID = "org.jboss.bpm.console.plugin.MapsEditor";
+
+ public MapsEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+
+ // an example view component added to the editor
+ final View defaultView = new View(appContext) {
+
+ public String getViewId()
+ {
+ return ID+".defaultView";
+ }
+
+ public String getIconCSS()
+ {
+ return "";
+ }
+ };
+
+ // keep it simple, just use an iframe
+ Frame frame = new Frame();
+ frame.setWidth("660");
+ frame.setHeight("448");
+ frame.setUrl("http://maps.google.com");
+
+ // assemble the view
+ defaultView.add(frame);
+ defaultView.setPaddings(10,0,0,0);
+ defaultView.setTitle("Maps");
+
+ // add it to the editor
+ addView(defaultView, false);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Google Maps Plugin Example";
+ }
+
+ public String getIconCSS()
+ {
+ return "";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ return new MenuSection("Maps Plugin", "", new MapsNavigationTree(appContext));
+ }
+}
Added: projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java
===================================================================
--- projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java (rev 0)
+++ projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java 2009-01-15 21:21:47 UTC (rev 3657)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.mapsplugin;
+
+import com.gwtext.client.widgets.tree.TreePanel;
+import com.gwtext.client.widgets.tree.TreeNode;
+import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
+import com.gwtext.client.data.Node;
+import com.gwtext.client.core.EventObject;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+class MapsNavigationTree extends TreePanel
+{
+
+ public MapsNavigationTree(final ApplicationContext appContext)
+ {
+
+ TreeNode root = new TreeNode("Google Maps");
+
+ TreeNode navEntry = new TreeNode("Open maps");
+ navEntry.setExpanded(true);
+ navEntry.addListener(
+ new TreeNodeListenerAdapter()
+ {
+ public void onClick(Node node, EventObject eventObject)
+ {
+ if (appContext.hasEditor(MapsEditor.ID))
+ {
+ appContext.showEditor(MapsEditor.ID);
+ }
+ else
+ {
+ appContext.addEditor(new MapsEditor(appContext));
+ }
+
+ }
+ }
+ );
+
+ root.appendChild(navEntry);
+
+ setRootVisible(true);
+ setRootNode(root);
+ root.setExpanded(true);
+ }
+}
More information about the jbpm-commits
mailing list