Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2007-09-30 14:11:02 -0400
committerJohn Arthorne2007-09-30 14:11:02 -0400
commit2ccb446cc885495686cc9eb430c4a98031b3cfc5 (patch)
tree207e30d5f61856ece926ed3548297aa3958132c9 /bundles/org.eclipse.equinox.p2.ui.admin.rcp/src
parentc4f6662ccd02bb75cba95a6ae56a2da38c6cadde (diff)
downloadrt.equinox.p2-2ccb446cc885495686cc9eb430c4a98031b3cfc5.tar.gz
rt.equinox.p2-2ccb446cc885495686cc9eb430c4a98031b3cfc5.tar.xz
rt.equinox.p2-2ccb446cc885495686cc9eb430c4a98031b3cfc5.zip
Renamed prov bundles to p2
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin.rcp/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Activator.java69
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Application.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationActionBarAdvisor.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchAdvisor.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchWindowAdvisor.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ProvisioningRCPPerspective.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/ProvAdminUIMessages.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/messages.properties15
8 files changed, 324 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Activator.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Activator.java
new file mode 100644
index 000000000..832c8a5ba
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Activator.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.ui.admin.rcp;
+
+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 = "org.eclipse.equinox.prov.ui.admin.rcp"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public Activator() {
+ // contstructor
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ super.start(bundleContext);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ plugin = null;
+ super.stop(bundleContext);
+ }
+
+ /**
+ * 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);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Application.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Application.java
new file mode 100644
index 000000000..08892b0b0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Application.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.ui.admin.rcp;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class Application implements IApplication {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
+ */
+ public Object start(IApplicationContext context) throws Exception {
+ Display display = PlatformUI.createDisplay();
+ try {
+ int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
+ if (returnCode == PlatformUI.RETURN_RESTART)
+ return IApplication.EXIT_RESTART;
+ return IApplication.EXIT_OK;
+ } finally {
+ display.dispose();
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.app.IApplication#stop()
+ */
+ public void stop() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ if (workbench == null)
+ return;
+ final Display display = workbench.getDisplay();
+ display.syncExec(new Runnable() {
+ public void run() {
+ if (!display.isDisposed())
+ workbench.close();
+ }
+ });
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationActionBarAdvisor.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationActionBarAdvisor.java
new file mode 100644
index 000000000..ed92eb3df
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationActionBarAdvisor.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.ui.admin.rcp;
+
+import org.eclipse.equinox.prov.ui.admin.rcp.internal.ProvAdminUIMessages;
+import org.eclipse.jface.action.*;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+ IAction prefsAction, aboutAction, quitAction;
+
+ public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
+ super(configurer);
+ }
+
+ protected void makeActions(IWorkbenchWindow window) {
+ quitAction = ActionFactory.QUIT.create(window);
+ prefsAction = ActionFactory.PREFERENCES.create(window);
+ aboutAction = ActionFactory.ABOUT.create(window);
+ }
+
+ protected void fillMenuBar(IMenuManager menuBar) {
+ IMenuManager fileMenu = new MenuManager(ProvAdminUIMessages.ApplicationActionBarAdvisor_FileMenuName, "file"); //$NON-NLS-1$
+ menuBar.add(fileMenu);
+ fileMenu.add(quitAction);
+
+ IMenuManager windowMenu = new MenuManager(ProvAdminUIMessages.ApplicationActionBarAdvisor_WindowMenuName, "window"); //$NON-NLS-1$
+ menuBar.add(windowMenu);
+ windowMenu.add(prefsAction);
+
+ IMenuManager helpMenu = new MenuManager(ProvAdminUIMessages.ApplicationActionBarAdvisor_HelpMenuName, "help"); //$NON-NLS-1$
+ menuBar.add(helpMenu);
+ helpMenu.add(aboutAction);
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchAdvisor.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchAdvisor.java
new file mode 100644
index 000000000..2d1e4ba9f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchAdvisor.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.ui.admin.rcp;
+
+import org.eclipse.ui.application.*;
+
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ return new ApplicationWorkbenchWindowAdvisor(configurer);
+ }
+
+ public String getInitialWindowPerspectiveId() {
+ return "org.eclipse.equinox.prov.ui.admin.rcp.ProvisioningRCPPerspective"; //$NON-NLS-1$
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchWindowAdvisor.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchWindowAdvisor.java
new file mode 100644
index 000000000..2b3fd8179
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchWindowAdvisor.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.ui.admin.rcp;
+
+import org.eclipse.equinox.prov.ui.admin.rcp.internal.ProvAdminUIMessages;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.application.*;
+
+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(800, 600));
+ configurer.setShowCoolBar(false);
+ configurer.setShowStatusLine(false);
+ configurer.setTitle(ProvAdminUIMessages.ApplicationWindowTitle);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ProvisioningRCPPerspective.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ProvisioningRCPPerspective.java
new file mode 100644
index 000000000..80498e8b9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ProvisioningRCPPerspective.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.ui.admin.rcp;
+
+import org.eclipse.ui.*;
+
+/**
+ * Perspective which makes the standard provisioning views available.
+ *
+ * @since 3.4
+ *
+ */
+public class ProvisioningRCPPerspective implements IPerspectiveFactory {
+
+ private IPageLayout factory;
+ private static final String METADATA_REPOSITORIES = "org.eclipse.prov.ui.admin.MetadataRepositoriesView"; //$NON-NLS-1$
+ private static final String ARTIFACT_REPOSITORIES = "org.eclipse.prov.ui.admin.ArtifactRepositoriesView"; //$NON-NLS-1$
+ private static final String PROFILES = "org.eclipse.prov.ui.admin.ProfilesView"; //$NON-NLS-1$
+
+ public ProvisioningRCPPerspective() {
+ super();
+ }
+
+ public void createInitialLayout(IPageLayout layout) {
+ this.factory = layout;
+ addViews();
+ }
+
+ private void addViews() {
+ IFolderLayout top = factory.createFolder("top", //$NON-NLS-1$
+ IPageLayout.TOP, 0.5f, factory.getEditorArea());
+ top.addView(METADATA_REPOSITORIES);
+ factory.getViewLayout(METADATA_REPOSITORIES).setCloseable(false);
+ top.addView(ARTIFACT_REPOSITORIES);
+ factory.getViewLayout(ARTIFACT_REPOSITORIES).setCloseable(false);
+ factory.addView(PROFILES, IPageLayout.BOTTOM, 0.65f, "top"); //$NON-NLS-1$
+ factory.getViewLayout(PROFILES).setCloseable(false);
+ factory.setEditorAreaVisible(false);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/ProvAdminUIMessages.java b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/ProvAdminUIMessages.java
new file mode 100644
index 000000000..d24ca11c6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/ProvAdminUIMessages.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.prov.ui.admin.rcp.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Message class for provisioning UI messages.
+ *
+ * @since 3.4
+ */
+public class ProvAdminUIMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.equinox.prov.ui.admin.rcp.internal.messages"; //$NON-NLS-1$
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, ProvAdminUIMessages.class);
+ }
+ public static String ApplicationActionBarAdvisor_FileMenuName;
+ public static String ApplicationActionBarAdvisor_HelpMenuName;
+ public static String ApplicationActionBarAdvisor_WindowMenuName;
+ public static String ApplicationWindowTitle;
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/messages.properties b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/messages.properties
new file mode 100644
index 000000000..e5decd174
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/messages.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+ApplicationWindowTitle=Eclipse Provisioning
+ApplicationActionBarAdvisor_FileMenuName=&File
+ApplicationActionBarAdvisor_WindowMenuName=&Window
+ApplicationActionBarAdvisor_HelpMenuName=&Help

Back to the top