Author: akazakov
Date: 2009-11-27 12:26:32 -0500 (Fri, 27 Nov 2009)
New Revision: 18894
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/AddCDISupportAction.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/RemoveCDISupportAction.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.ui/build.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5276
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2009-11-27 17:24:20 UTC
(rev 18893)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2009-11-27 17:26:32 UTC
(rev 18894)
@@ -1,13 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Context and Dependency Injection UI
-Bundle-SymbolicName: org.jboss.tools.cdi.ui
-Bundle-Version: 1.0.0
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.cdi.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.cdi.ui.CDIUIPlugin
+Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.cdi.core,
- org.jboss.tools.common
+ org.jboss.tools.common,
+ org.eclipse.core.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: JBoss by Red Hat
+Bundle-Vendor: %Bundle-Vendor.0
+Export-Package: org.jboss.tools.cdi.ui
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/build.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/build.properties 2009-11-27 17:24:20 UTC (rev
18893)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/build.properties 2009-11-27 17:26:32 UTC (rev
18894)
@@ -1,7 +1,9 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml,\
+ plugin.properties
src.includes = src/,\
build.properties,\
META-INF/,\
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
(rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2009-11-27 17:26:32 UTC
(rev 18894)
@@ -0,0 +1,7 @@
+# Menus
+PreferencePage_CDISettings=CDI Settings
+ConfigureMenu_AddCDISupport=Add CDI support...
+ConfigureMenu_RemoveCDISupport=Remove CDI support...
+
+Bundle-Vendor.0 = JBoss by Red Hat
+Bundle-Name.0 = Context and Dependency Injection UI
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2009-11-27 17:26:32 UTC (rev
18894)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ name="%PreferencePage_CDISettings"
+
class="org.jboss.tools.cdi.ui.preferences.CDISettingsPreferencePage"
+
id="org.jboss.tools.cdi.ui.propertyPages.CDISettingsPreferencePage">
+ <enabledWhen>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.jdt.core.javanature"/>
+ </adapt>
+ </enabledWhen>
+ </page>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+
+ <objectContribution
+ id="org.jboss.tools.cdi.ui.project.configure.enable"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <visibility>
+ <and>
+ <objectState
+ name="projectNature"
+ value="org.eclipse.jdt.core.javanature"/>
+ <not>
+ <objectState
+ name="projectNature"
+ value="org.jboss.tools.cdi.core.cdinature"/>
+ </not>
+ </and>
+ </visibility>
+
+ <action
+ id="org.jboss.tools.cdi.ui.AddCDISupport"
+ label="%ConfigureMenu_AddCDISupport"
+ class="org.jboss.tools.cdi.ui.preferences.AddCDISupportAction"
+ enablesFor="1"
+ menubarPath="org.eclipse.ui.projectConfigure/additions"/>
+
+ </objectContribution>
+
+ <objectContribution
+ id="org.jboss.tools.cdi.ui.project.configure.disable"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <visibility>
+ <objectState
+ name="projectNature"
+ value="org.jboss.tools.cdi.core.cdinature"/>
+ </visibility>
+
+ <action
+ id="org.jboss.tools.cdi.ui.RemoveCDISupport"
+ label="%ConfigureMenu_RemoveCDISupport"
+ class="org.jboss.tools.cdi.ui.preferences.RemoveCDISupportAction"
+ enablesFor="1"
+ menubarPath="org.eclipse.ui.projectConfigure/additions"/>
+
+ </objectContribution>
+
+ </extension>
+
+</plugin>
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/AddCDISupportAction.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/AddCDISupportAction.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/AddCDISupportAction.java 2009-11-27
17:26:32 UTC (rev 18894)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.cdi.ui.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AddCDISupportAction implements IObjectActionDelegate {
+
+ private ISelection currentSelection;
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IProject project = (IProject) ((IStructuredSelection)
currentSelection).getFirstElement();
+ PreferenceDialog dialog =
PreferencesUtil.createPropertyDialogOn(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
project, CDISettingsPreferencePage.ID, new String[] {CDISettingsPreferencePage.ID},
null);
+ CDISettingsPreferencePage page = (CDISettingsPreferencePage)dialog.getSelectedPage();
+ page.setEnabledCDISuport(shouldEnable());
+ dialog.open();
+ }
+
+ protected boolean shouldEnable() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.currentSelection = selection;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/AddCDISupportAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java 2009-11-27
17:26:32 UTC (rev 18894)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.cdi.ui.preferences;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPropertyPage;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDISettingsPreferencePage extends PropertyPage implements
IWorkbenchPropertyPage {
+
+ public static final String ID =
"org.jboss.tools.cdi.ui.propertyPages.CDISettingsPreferencePage";
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ return null;
+ }
+
+ public void setEnabledCDISuport(boolean shouldEnable) {
+ // TODO
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/RemoveCDISupportAction.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/RemoveCDISupportAction.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/RemoveCDISupportAction.java 2009-11-27
17:26:32 UTC (rev 18894)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.cdi.ui.preferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RemoveCDISupportAction extends AddCDISupportAction {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.cdi.ui.preferences.AddCDISupportAction#shouldEnable()
+ */
+ @Override
+ protected boolean shouldEnable() {
+ return false;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/RemoveCDISupportAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain