Author: vrubezhny
Date: 2007-08-21 14:01:36 -0400 (Tue, 21 Aug 2007)
New Revision: 3257
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/CreateProjectAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java
Log:
http://jira.jboss.org/jira/browse/RHDS-110 Create Welcome screen
Create Seam Project Action is added
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-08-21 17:31:03
UTC (rev 3256)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-08-21 18:01:36
UTC (rev 3257)
@@ -46,7 +46,8 @@
org.eclipse.datatools.connectivity,
org.eclipse.datatools.connectivity.ui.dse,
org.eclipse.datatools.connectivity.db.generic.ui,
- org.eclipse.datatools.connectivity.db.generic
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.common.model.ui
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.builder,
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-08-21
18:01:36 UTC (rev 3257)
@@ -0,0 +1,35 @@
+package org.jboss.tools.seam.ui;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+
+public class SeamUIMessages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.seam.ui.messages";//$NON-NLS-1$
+
+ private static ResourceBundle fResourceBundle;
+
+ public static String CREATE_NEW_SEAM_PROJECT;
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, SeamUIMessages.class);
+ }
+
+ private SeamUIMessages() {
+ // cannot create new instance of this class
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ try {
+ if (fResourceBundle == null)
+ fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
+ }
+ catch (MissingResourceException x) {
+ fResourceBundle = null;
+ }
+ return fResourceBundle;
+ }
+}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java 2007-08-21
17:31:03 UTC (rev 3256)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java 2007-08-21
18:01:36 UTC (rev 3257)
@@ -37,6 +37,9 @@
public static Image JAVA_IMAGE = getImage("view/java.gif");
public static Image JAVA_BINARY_IMAGE = getImage("view/java_binary.gif");
public static Image PACKAGE_IMAGE = getImage("view/package.gif");
+
+ public static String SEAM_CREATE_PROJECT_ACTION =
"view/seam_project_new.gif";
+
public static Image getImage(String key) {
return INSTANCE.createImageDescriptor(key).createImage();
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/CreateProjectAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/CreateProjectAction.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/CreateProjectAction.java 2007-08-21
18:01:36 UTC (rev 3257)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.ui.actions;
+
+import org.jboss.tools.common.model.ui.util.ExtensionPointUtils;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.SeamUiImages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.internal.ide.IIDEHelpContextIds;
+
+/**
+ * @author Jeremy
+ *
+ */
+public class CreateProjectAction extends Action implements IWorkbenchWindowActionDelegate
{
+
+ private final static String SEAM_CREATE_PROJECT_WIZARD_ID =
"org.jboss.tools.seam.ui.wizards.SeamProjectWizard";
+ /**
+ * The wizard dialog width
+ */
+ private static final int SIZING_WIZARD_WIDTH = 500;
+
+ /**
+ * The wizard dialog height
+ */
+ private static final int SIZING_WIZARD_HEIGHT = 500;
+
+ public CreateProjectAction() {
+ super(SeamUIMessages.CREATE_NEW_SEAM_PROJECT);
+ setToolTipText(SeamUIMessages.CREATE_NEW_SEAM_PROJECT);
+ setImageDescriptor(SeamUiImages.getImageDescriptor(SeamUiImages.SEAM_CREATE_PROJECT_ACTION));
+ }
+
+ public void run() {
+ INewWizard wizard = ExtensionPointUtils.findNewWizardsItem(
+ SeamGuiPlugin.PLUGIN_ID,
+ SEAM_CREATE_PROJECT_WIZARD_ID
+ );
+ if (wizard != null) {
+ wizard.init(PlatformUI.getWorkbench(), null);
+ WizardDialog dialog = new
WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ dialog.getShell().setSize(
+ Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x),
+ SIZING_WIZARD_HEIGHT);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(),
+ IIDEHelpContextIds.NEW_PROJECT_WIZARD);
+
+ dialog.open();
+ } else {
+ SeamGuiPlugin.getPluginLog().logError("Unable to create wizard '" +
SEAM_CREATE_PROJECT_WIZARD_ID + "'");
+ }
+ }
+
+ public void dispose() {}
+
+ public void init(IWorkbenchWindow window) {}
+
+ public void run(IAction action) {
+ run();
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {}
+
+}
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-08-21
18:01:36 UTC (rev 3257)
@@ -0,0 +1 @@
+CREATE_NEW_SEAM_PROJECT = Create New Seam Project