Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 10073 invoked from network); 18 Aug 2010 10:14:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Aug 2010 10:14:15 -0000 Received: (qmail 56722 invoked by uid 500); 18 Aug 2010 10:14:15 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 56658 invoked by uid 500); 18 Aug 2010 10:14:14 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 56651 invoked by uid 99); 18 Aug 2010 10:14:14 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 10:14:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 10:13:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7F46223889E9; Wed, 18 Aug 2010 10:12:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r986618 - in /directory/sandbox/kayyagari/studio-http: ./ META-INF/ src/ src/studio_http/ src/studiohttp/ Date: Wed, 18 Aug 2010 10:12:28 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100818101228.7F46223889E9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kayyagari Date: Wed Aug 18 10:12:27 2010 New Revision: 986618 URL: http://svn.apache.org/viewvc?rev=986618&view=rev Log: o experimenting for a web based studio Added: directory/sandbox/kayyagari/studio-http/ (with props) directory/sandbox/kayyagari/studio-http/META-INF/ directory/sandbox/kayyagari/studio-http/META-INF/MANIFEST.MF directory/sandbox/kayyagari/studio-http/build.properties directory/sandbox/kayyagari/studio-http/plugin.xml directory/sandbox/kayyagari/studio-http/src/ directory/sandbox/kayyagari/studio-http/src/studio_http/ directory/sandbox/kayyagari/studio-http/src/studio_http/Activator.java directory/sandbox/kayyagari/studio-http/src/studiohttp/ directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationActionBarAdvisor.java directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchAdvisor.java directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchWindowAdvisor.java directory/sandbox/kayyagari/studio-http/src/studiohttp/HttpStudio.java directory/sandbox/kayyagari/studio-http/src/studiohttp/Perspective.java directory/sandbox/kayyagari/studio-http/src/studiohttp/View.java directory/sandbox/kayyagari/studio-http/studio-http.launch Propchange: directory/sandbox/kayyagari/studio-http/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Aug 18 10:12:27 2010 @@ -0,0 +1,2 @@ +bin +.settings Added: directory/sandbox/kayyagari/studio-http/META-INF/MANIFEST.MF URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/META-INF/MANIFEST.MF?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/META-INF/MANIFEST.MF (added) +++ directory/sandbox/kayyagari/studio-http/META-INF/MANIFEST.MF Wed Aug 18 10:12:27 2010 @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Studio-http +Bundle-SymbolicName: studio-http; singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: studio_http.Activator +Require-Bundle: org.eclipse.rap.ui +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Import-Package: javax.servlet;version="2.4.0", + javax.servlet.http;version="2.4.0" Added: directory/sandbox/kayyagari/studio-http/build.properties URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/build.properties?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/build.properties (added) +++ directory/sandbox/kayyagari/studio-http/build.properties Wed Aug 18 10:12:27 2010 @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + . Added: directory/sandbox/kayyagari/studio-http/plugin.xml URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/plugin.xml?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/plugin.xml (added) +++ directory/sandbox/kayyagari/studio-http/plugin.xml Wed Aug 18 10:12:27 2010 @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + Added: directory/sandbox/kayyagari/studio-http/src/studio_http/Activator.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studio_http/Activator.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studio_http/Activator.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studio_http/Activator.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,61 @@ +package studio_http; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "studio-http"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} Added: directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationActionBarAdvisor.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationActionBarAdvisor.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationActionBarAdvisor.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationActionBarAdvisor.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,41 @@ +package studiohttp; + +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.actions.ActionFactory; +import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; +import org.eclipse.ui.application.ActionBarAdvisor; +import org.eclipse.ui.application.IActionBarConfigurer; + +/** + * Creates, adds and disposes actions for the menus and action bars of + * each workbench window. + */ +public class ApplicationActionBarAdvisor extends ActionBarAdvisor { + + public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { + super(configurer); + } + + // Actions - important to allocate these only in makeActions, and then use + // them in the fill methods. This ensures that the actions aren't recreated + // in the fill methods. + private IWorkbenchAction exitAction; + + protected void makeActions(IWorkbenchWindow window) { + // Creates the actions and registers them. Registering also + // provides automatic disposal of the actions when the window is closed. + exitAction = ActionFactory.QUIT.create(window); + register(exitAction); + } + + protected void fillMenuBar(IMenuManager menuBar) { + MenuManager fileMenu + = new MenuManager("&File",IWorkbenchActionConstants.M_FILE); + menuBar.add(fileMenu); + fileMenu.add(exitAction); + } + +} Added: directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchAdvisor.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchAdvisor.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchAdvisor.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchAdvisor.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,22 @@ +package studiohttp; + +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.application.WorkbenchAdvisor; +import org.eclipse.ui.application.WorkbenchWindowAdvisor; + +/** + * This workbench advisor creates the window advisor, and specifies + * the perspective id for the initial window. + */ +public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { + + private static final String PERSPECTIVE_ID = "studio-http.perspective"; + + public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { + return new ApplicationWorkbenchWindowAdvisor(configurer); + } + + public String getInitialWindowPerspectiveId() { + return PERSPECTIVE_ID; + } +} Added: directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchWindowAdvisor.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchWindowAdvisor.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchWindowAdvisor.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studiohttp/ApplicationWorkbenchWindowAdvisor.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,29 @@ +package studiohttp; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.ui.application.ActionBarAdvisor; +import org.eclipse.ui.application.IActionBarConfigurer; +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.application.WorkbenchWindowAdvisor; + +/** + * Configures the initial size and appearance of a workbench window. + */ +public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { + + public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { + super(configurer); + } + + public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) { + return new ApplicationActionBarAdvisor(configurer); + } + + public void preWindowOpen() { + IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); + configurer.setInitialSize(new Point(400, 300)); + configurer.setShowCoolBar(false); + configurer.setShowStatusLine(false); + configurer.setTitle("Studio on web using RAP"); + } +} Added: directory/sandbox/kayyagari/studio-http/src/studiohttp/HttpStudio.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studiohttp/HttpStudio.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studiohttp/HttpStudio.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studiohttp/HttpStudio.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,19 @@ +package studiohttp; + +import org.eclipse.rwt.lifecycle.IEntryPoint; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.application.WorkbenchAdvisor; + +/** + * This class controls all aspects of the application's execution + * and is contributed through the plugin.xml. + */ +public class HttpStudio implements IEntryPoint { + + public int createUI() { + Display display = PlatformUI.createDisplay(); + WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); + return PlatformUI.createAndRunWorkbench( display, advisor ); + } +} Added: directory/sandbox/kayyagari/studio-http/src/studiohttp/Perspective.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studiohttp/Perspective.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studiohttp/Perspective.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studiohttp/Perspective.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,20 @@ +package studiohttp; + +import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPerspectiveFactory; + +/** + * Configures the perspective layout. This class is contributed through the + * plugin.xml. + */ +public class Perspective implements IPerspectiveFactory { + + public void createInitialLayout(IPageLayout layout) { + String editorArea = layout.getEditorArea(); + layout.setEditorAreaVisible(false); + layout.setFixed(true); + + layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 1.0f, + editorArea); + } +} Added: directory/sandbox/kayyagari/studio-http/src/studiohttp/View.java URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/src/studiohttp/View.java?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/src/studiohttp/View.java (added) +++ directory/sandbox/kayyagari/studio-http/src/studiohttp/View.java Wed Aug 18 10:12:27 2010 @@ -0,0 +1,73 @@ +package studiohttp; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.ViewPart; + +public class View extends ViewPart { + public static final String ID = "studio-http.view"; + + private TableViewer viewer; + + /** + * The content provider class is responsible for providing objects to the + * view. It can wrap existing objects in adapters or simply return objects + * as-is. These objects may be sensitive to the current input of the view, + * or ignore it and always show the same content (like Task List, for + * example). + */ + class ViewContentProvider implements IStructuredContentProvider { + public void inputChanged(Viewer v, Object oldInput, Object newInput) { + } + + public void dispose() { + } + + public Object[] getElements(Object parent) { + return new String[] { "One", "Two", "Three" }; + } + } + + class ViewLabelProvider extends LabelProvider implements + ITableLabelProvider { + public String getColumnText(Object obj, int index) { + return getText(obj); + } + + public Image getColumnImage(Object obj, int index) { + return getImage(obj); + } + + public Image getImage(Object obj) { + return PlatformUI.getWorkbench().getSharedImages().getImage( + ISharedImages.IMG_OBJ_ELEMENT); + } + } + + /** + * This is a callback that will allow us to create the viewer and initialize + * it. + */ + public void createPartControl(Composite parent) { + int style = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL; + viewer = new TableViewer(parent, style); + viewer.setContentProvider(new ViewContentProvider()); + viewer.setLabelProvider(new ViewLabelProvider()); + viewer.setInput(getViewSite()); + } + + /** + * Passing the focus request to the viewer's control. + */ + public void setFocus() { + viewer.getControl().setFocus(); + } +} \ No newline at end of file Added: directory/sandbox/kayyagari/studio-http/studio-http.launch URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/studio-http/studio-http.launch?rev=986618&view=auto ============================================================================== --- directory/sandbox/kayyagari/studio-http/studio-http.launch (added) +++ directory/sandbox/kayyagari/studio-http/studio-http.launch Wed Aug 18 10:12:27 2010 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +