summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaloyan Raev2011-02-21 15:53:11 (EST)
committerKaloyan Raev2011-02-21 15:53:11 (EST)
commitcae74a7ac1c3af51af5619dbe61bd41f0b919ace (patch)
tree9afaffe12eebc5ad7a08bd6c87625e4e460ac415
parenta379c3824178ce91739da6bacc3ce527425ca82c (diff)
downloadorg.eclipse.libra-cae74a7ac1c3af51af5619dbe61bd41f0b919ace.zip
org.eclipse.libra-cae74a7ac1c3af51af5619dbe61bd41f0b919ace.tar.gz
org.eclipse.libra-cae74a7ac1c3af51af5619dbe61bd41f0b919ace.tar.bz2
[337762] Externalize all strings of OSGi Facet plugins
-rw-r--r--plugins/org.eclipse.libra.facet.ui/plugin.properties6
-rw-r--r--plugins/org.eclipse.libra.facet.ui/plugin.xml8
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectToBundleOperation.java4
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectsToBundlesOperation.java6
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/ConvertProjectsToBundlesAction.java10
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/Messages.java16
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/messages.properties2
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizard.java2
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizardPage.java25
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/Messages.java31
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetInstallPage.java12
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetUninstallPage.java4
-rw-r--r--plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/messages.properties17
-rw-r--r--plugins/org.eclipse.libra.facet/plugin.properties9
-rw-r--r--plugins/org.eclipse.libra.facet/plugin.xml20
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/Messages.java19
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetEventHandler.java32
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallConfig.java8
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallDelegate.java (renamed from plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleInstallDelegate.java)137
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetRealm.java (renamed from plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleRealm.java)2
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallConfig.java2
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallDelegate.java (renamed from plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleUninstallDelegate.java)14
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallStrategy.java6
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUtils.java (renamed from plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleUtils.java)48
-rw-r--r--plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/messages.properties5
-rw-r--r--tests/org.eclipse.libra.facet.test/src/org/eclipse/libra/facet/test/WabConversionTest.java22
26 files changed, 300 insertions, 167 deletions
diff --git a/plugins/org.eclipse.libra.facet.ui/plugin.properties b/plugins/org.eclipse.libra.facet.ui/plugin.properties
index 64e1316..bce0c68 100644
--- a/plugins/org.eclipse.libra.facet.ui/plugin.properties
+++ b/plugins/org.eclipse.libra.facet.ui/plugin.properties
@@ -10,3 +10,9 @@
###############################################################################
Bundle-Name = OSGi Bundle Facet UI (Incubation)
Bundle-Vendor = Eclipse Web Tools Platform
+
+convert.action.label = Convert to OSGi Bundle Projects...
+
+run.on.server = Run on Server
+debug.on.server = Debug on Server
+profile.on.server = Profile on Server
diff --git a/plugins/org.eclipse.libra.facet.ui/plugin.xml b/plugins/org.eclipse.libra.facet.ui/plugin.xml
index f1a1c94..2e9ada9 100644
--- a/plugins/org.eclipse.libra.facet.ui/plugin.xml
+++ b/plugins/org.eclipse.libra.facet.ui/plugin.xml
@@ -11,7 +11,7 @@
class="org.eclipse.libra.facet.ui.popup.actions.ConvertProjectsToBundlesAction"
enablesFor="+"
id="org.eclipse.libra.facet.ui.popup.actions.ConvertProjectsToBundlesAction"
- label="Convert to OSGi Bundle Projects..."
+ label="%convert.action.label"
menubarPath="org.eclipse.ui.projectConfigure/additions">
</action>
<visibility>
@@ -42,21 +42,21 @@
point="org.eclipse.pde.ui.launchShortcuts">
<shortcut
id="org.eclipse.wst.server.launchShortcut"
- label="Run on Server"
+ label="%run.on.server"
mode="run"
osgi="true"
projectSpecific="true">
</shortcut>
<shortcut
id="org.eclipse.wst.server.launchShortcut"
- label="Debug on Server"
+ label="%debug.on.server"
mode="debug"
osgi="true"
projectSpecific="true">
</shortcut>
<shortcut
id="org.eclipse.wst.server.launchShortcut"
- label="Profile on Server"
+ label="%profile.on.server"
mode="profile"
osgi="true"
projectSpecific="true">
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectToBundleOperation.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectToBundleOperation.java
index 023e409..cbc2f78 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectToBundleOperation.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectToBundleOperation.java
@@ -15,7 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.libra.facet.OSGiBundleUtils;
+import org.eclipse.libra.facet.OSGiBundleFacetUtils;
import org.eclipse.pde.core.project.IBundleProjectDescription;
import org.eclipse.pde.core.project.IBundleProjectService;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@@ -36,7 +36,7 @@ public class ConvertProjectToBundleOperation extends WorkspaceModifyOperation {
protected void execute(IProgressMonitor monitor) throws CoreException,
InvocationTargetException, InterruptedException {
IFacetedProject fproj = ProjectFacetsManager.create(fProject, true, monitor);
- fproj.installProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, null, monitor);
+ fproj.installProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, null, monitor);
}
}
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectsToBundlesOperation.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectsToBundlesOperation.java
index a459219..4b3f4e6 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectsToBundlesOperation.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/operations/ConvertProjectsToBundlesOperation.java
@@ -15,7 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.libra.facet.OSGiBundleUtils;
+import org.eclipse.libra.facet.OSGiBundleFacetUtils;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@@ -33,7 +33,7 @@ public class ConvertProjectsToBundlesOperation extends WorkspaceModifyOperation
// first convert non-Web projects
for (IProject project : fProjects) {
- if (!OSGiBundleUtils.isWebProject(project)) {
+ if (!OSGiBundleFacetUtils.isWebProject(project)) {
new ConvertProjectToBundleOperation(project).execute(monitor);
}
}
@@ -41,7 +41,7 @@ public class ConvertProjectsToBundlesOperation extends WorkspaceModifyOperation
// then convert the Web projects
// this will make the dependencies from referenced libraries to be calculated correctly
for (IProject project : fProjects) {
- if (OSGiBundleUtils.isWebProject(project)) {
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
new ConvertProjectToBundleOperation(project).execute(monitor);
}
}
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/ConvertProjectsToBundlesAction.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/ConvertProjectsToBundlesAction.java
index 28a0dd1..7aea9e6 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/ConvertProjectsToBundlesAction.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/ConvertProjectsToBundlesAction.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.libra.facet.OSGiBundleUtils;
+import org.eclipse.libra.facet.OSGiBundleFacetUtils;
import org.eclipse.libra.facet.ui.wizards.ConvertProjectsToBundlesWizard;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
@@ -59,7 +59,7 @@ public class ConvertProjectsToBundlesAction implements IObjectActionDelegate {
public void run(IAction action) {
IProject[] unconverted = getUnconvertedProjects();
if (unconverted.length == 0) {
- MessageDialog.openInformation(getDisplay().getActiveShell(), "Find Project to Convert", "There are no projects to convert. ");
+ MessageDialog.openInformation(getDisplay().getActiveShell(), Messages.ConvertProjectsToBundlesAction_NoProjectToConvertTitle, Messages.ConvertProjectsToBundlesAction_NoProjectToConvertDescription);
return;
}
@@ -102,9 +102,9 @@ public class ConvertProjectsToBundlesAction implements IObjectActionDelegate {
for (IProject project : projects) {
try {
if (project.isOpen() &&
- !OSGiBundleUtils.hasFeatureNature(project) &&
- !OSGiBundleUtils.hasUpdateSiteNature(project) &&
- !OSGiBundleUtils.isOSGiBundle(project)) {
+ !OSGiBundleFacetUtils.hasFeatureNature(project) &&
+ !OSGiBundleFacetUtils.hasUpdateSiteNature(project) &&
+ !OSGiBundleFacetUtils.isOSGiBundle(project)) {
unconverted.add(project);
}
} catch (CoreException e) {
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/Messages.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/Messages.java
new file mode 100644
index 0000000..1535695
--- /dev/null
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/Messages.java
@@ -0,0 +1,16 @@
+package org.eclipse.libra.facet.ui.popup.actions;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.libra.facet.ui.popup.actions.messages"; //$NON-NLS-1$
+ public static String ConvertProjectsToBundlesAction_NoProjectToConvertDescription;
+ public static String ConvertProjectsToBundlesAction_NoProjectToConvertTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/messages.properties b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/messages.properties
new file mode 100644
index 0000000..fd2e597
--- /dev/null
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/popup/actions/messages.properties
@@ -0,0 +1,2 @@
+ConvertProjectsToBundlesAction_NoProjectToConvertDescription=There is no project to convert.
+ConvertProjectsToBundlesAction_NoProjectToConvertTitle=Find Project to Convert
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizard.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizard.java
index 473e07f..1a9104e 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizard.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizard.java
@@ -30,7 +30,7 @@ public class ConvertProjectsToBundlesWizard extends Wizard {
this.fSelected = selected;
// setDefaultPageImageDescriptor(PDEPluginImages.DESC_CONVJPPRJ_WIZ);
- setWindowTitle("Convert to OSGi Bundle Projects");
+ setWindowTitle(Messages.ConvertProjectsToBundlesWizard_Title);
// setDialogSettings(PDEPlugin.getDefault().getDialogSettings());
setNeedsProgressMonitor(true);
}
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizardPage.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizardPage.java
index ac78911..7c0d7e7 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizardPage.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/ConvertProjectsToBundlesWizardPage.java
@@ -31,7 +31,8 @@ import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.libra.facet.OSGiBundleUtils;
+import org.eclipse.libra.facet.OSGiBundleFacetUtils;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -53,7 +54,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
if (fSelected.size() == 0) {
return ValidationStatus.cancel(getDescription());
} else if (missingReferences()) {
- return ValidationStatus.warning("Some of the selected projects have references to other projects, which are not in the selection. Click the Add References button to add them too. ");
+ return ValidationStatus.warning(Messages.ConvertProjectsToBundlesWizardPage_ReferencedProjectsNotSelected);
}
return ValidationStatus.ok();
}
@@ -69,7 +70,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
try {
if (refProject != null &&
refProject != project &&
- !OSGiBundleUtils.isOSGiBundle(refProject) &&
+ !OSGiBundleFacetUtils.isOSGiBundle(refProject) &&
!fSelected.contains(refProject)) {
return true;
}
@@ -88,10 +89,10 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
private IObservableSet fSelected;
public ConvertProjectsToBundlesWizardPage(IProject[] unconverted, IProject[] selected) {
- super("converToWAB");
+ super("converToWAB"); //$NON-NLS-1$
- setTitle("Select Projects to Convert");
- setDescription("Select the projects to convert to OSGi Bundle projects.");
+ setTitle(Messages.ConvertProjectsToBundlesWizardPage_Title);
+ setDescription(Messages.ConvertProjectsToBundlesWizardPage_Description);
this.fUnconverted = new WritableSet(Arrays.asList(unconverted), IProject.class);
this.fSelected = new WritableSet(Arrays.asList(selected), IProject.class);
@@ -117,7 +118,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
WizardPageSupport.create(this, dbc);
Label projectsLabel = new Label(parent, SWT.NONE);
- projectsLabel.setText("&Available projects: ");
+ projectsLabel.setText(Messages.ConvertProjectsToBundlesWizardPage_AvailableProjects);
GridDataFactory.swtDefaults().span(2, 1).applyTo(projectsLabel);
final CheckboxTableViewer projectsViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
@@ -133,7 +134,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
GridLayoutFactory.fillDefaults().generateLayout(buttonGroup);
Button selectAllButton = new Button(buttonGroup, SWT.PUSH);
- selectAllButton.setText("&Select All");
+ selectAllButton.setText(Messages.ConvertProjectsToBundlesWizardPage_SelectAll);
selectAllButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
fSelected.addAll(fUnconverted);
@@ -142,7 +143,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
GridDataFactory.fillDefaults().applyTo(selectAllButton);
Button deselectAllButton = new Button(buttonGroup, SWT.PUSH);
- deselectAllButton.setText("&Deselect All");
+ deselectAllButton.setText(Messages.ConvertProjectsToBundlesWizardPage_DeselectAll);
deselectAllButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
for (Object o : fUnconverted) {
@@ -154,7 +155,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
GridDataFactory.fillDefaults().applyTo(deselectAllButton);
Button addReferencesButton = new Button(buttonGroup, SWT.PUSH);
- addReferencesButton.setText("Add &References");
+ addReferencesButton.setText(Messages.ConvertProjectsToBundlesWizardPage_AddReferences);
addReferencesButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
selectReferences();
@@ -167,7 +168,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
dbc.bindValue(SWTObservables.observeText(selectedCountLabel), new ComputedValue(String.class) {
@Override
protected Object calculate() {
- return String.format("%d of %d selected.", fSelected.size(), fUnconverted.size());
+ return NLS.bind(Messages.ConvertProjectsToBundlesWizardPage_SelectionCounter, fSelected.size(), fUnconverted.size());
}
});
}
@@ -181,7 +182,7 @@ public class ConvertProjectsToBundlesWizardPage extends WizardPage {
for (IVirtualReference ref : references) {
IProject refProject = ref.getReferencedComponent().getProject();
try {
- if (refProject != null && refProject != project && !OSGiBundleUtils.isOSGiBundle(refProject)) {
+ if (refProject != null && refProject != project && !OSGiBundleFacetUtils.isOSGiBundle(refProject)) {
fSelected.add(refProject);
}
} catch (CoreException e) {
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/Messages.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/Messages.java
new file mode 100644
index 0000000..e24340d
--- /dev/null
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/Messages.java
@@ -0,0 +1,31 @@
+package org.eclipse.libra.facet.ui.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.libra.facet.ui.wizards.messages"; //$NON-NLS-1$
+ public static String ConvertProjectsToBundlesWizard_Title;
+ public static String ConvertProjectsToBundlesWizardPage_AddReferences;
+ public static String ConvertProjectsToBundlesWizardPage_AvailableProjects;
+ public static String ConvertProjectsToBundlesWizardPage_Description;
+ public static String ConvertProjectsToBundlesWizardPage_DeselectAll;
+ public static String ConvertProjectsToBundlesWizardPage_ReferencedProjectsNotSelected;
+ public static String ConvertProjectsToBundlesWizardPage_SelectAll;
+ public static String ConvertProjectsToBundlesWizardPage_SelectionCounter;
+ public static String ConvertProjectsToBundlesWizardPage_Title;
+ public static String OSGiBundleFacetInstallPage_Description;
+ public static String OSGiBundleFacetInstallPage_Name;
+ public static String OSGiBundleFacetInstallPage_SymbolicName;
+ public static String OSGiBundleFacetInstallPage_Title;
+ public static String OSGiBundleFacetInstallPage_Vendor;
+ public static String OSGiBundleFacetInstallPage_Version;
+ public static String OSGiBundleFacetUninstallPage_Description;
+ public static String OSGiBundleFacetUninstallPage_Title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetInstallPage.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetInstallPage.java
index ecd889e..0cd9974 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetInstallPage.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetInstallPage.java
@@ -36,8 +36,8 @@ public class OSGiBundleFacetInstallPage extends AbstractFacetWizardPage {
public OSGiBundleFacetInstallPage() {
super(WIZARD_PAGE_NAME);
- setTitle("OSGi Bundle");
- setDescription("Configure bundle metadata. ");
+ setTitle(Messages.OSGiBundleFacetInstallPage_Title);
+ setDescription(Messages.OSGiBundleFacetInstallPage_Description);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, IMG_PATH_BUNDLE_WIZBAN));
}
@@ -52,7 +52,7 @@ public class OSGiBundleFacetInstallPage extends AbstractFacetWizardPage {
Composite container = new Composite(parent, SWT.NONE);
Label symbolicNameLabel = new Label(container, SWT.NONE);
- symbolicNameLabel.setText("&Symbolic name: ");
+ symbolicNameLabel.setText(Messages.OSGiBundleFacetInstallPage_SymbolicName);
Text symbolicNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
dbc.bindValue(
SWTObservables.observeText(symbolicNameText, SWT.Modify),
@@ -61,7 +61,7 @@ public class OSGiBundleFacetInstallPage extends AbstractFacetWizardPage {
null);
Label versionLabel = new Label(container, SWT.NONE);
- versionLabel.setText("&Version: ");
+ versionLabel.setText(Messages.OSGiBundleFacetInstallPage_Version);
Text versionText = new Text(container, SWT.BORDER | SWT.SINGLE);
dbc.bindValue(
SWTObservables.observeText(versionText, SWT.Modify),
@@ -70,7 +70,7 @@ public class OSGiBundleFacetInstallPage extends AbstractFacetWizardPage {
null);
Label nameLabel = new Label(container, SWT.NONE);
- nameLabel.setText("Na&me: ");
+ nameLabel.setText(Messages.OSGiBundleFacetInstallPage_Name);
Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
dbc.bindValue(
SWTObservables.observeText(nameText, SWT.Modify),
@@ -79,7 +79,7 @@ public class OSGiBundleFacetInstallPage extends AbstractFacetWizardPage {
null);
Label vendorLabel = new Label(container, SWT.NONE);
- vendorLabel.setText("Ven&dor: ");
+ vendorLabel.setText(Messages.OSGiBundleFacetInstallPage_Vendor);
Text vendorText = new Text(container, SWT.BORDER | SWT.SINGLE);
dbc.bindValue(
SWTObservables.observeText(vendorText, SWT.Modify),
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetUninstallPage.java b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetUninstallPage.java
index 0caeedd..96b6cbd 100644
--- a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetUninstallPage.java
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/OSGiBundleFacetUninstallPage.java
@@ -35,8 +35,8 @@ public class OSGiBundleFacetUninstallPage extends AbstractFacetWizardPage {
public OSGiBundleFacetUninstallPage() {
super(WIZARD_PAGE_NAME);
- setTitle("OSGi Bundle");
- setDescription("Choose uninstall strategy.");
+ setTitle(Messages.OSGiBundleFacetUninstallPage_Title);
+ setDescription(Messages.OSGiBundleFacetUninstallPage_Description);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, IMG_PATH_BUNDLE_WIZBAN));
}
diff --git a/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/messages.properties b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/messages.properties
new file mode 100644
index 0000000..d82266a
--- /dev/null
+++ b/plugins/org.eclipse.libra.facet.ui/src/org/eclipse/libra/facet/ui/wizards/messages.properties
@@ -0,0 +1,17 @@
+ConvertProjectsToBundlesWizard_Title=Convert to OSGi Bundle Projects
+ConvertProjectsToBundlesWizardPage_AddReferences=Add &References
+ConvertProjectsToBundlesWizardPage_AvailableProjects=&Available projects:
+ConvertProjectsToBundlesWizardPage_Description=Select the projects to convert to OSGi Bundle projects.
+ConvertProjectsToBundlesWizardPage_DeselectAll=&Deselect All
+ConvertProjectsToBundlesWizardPage_ReferencedProjectsNotSelected=Some of the selected projects have references to other projects, which are not in the selection. Click the Add References button to add them too.
+ConvertProjectsToBundlesWizardPage_SelectAll=&Select All
+ConvertProjectsToBundlesWizardPage_SelectionCounter={0} of {1} selected.
+ConvertProjectsToBundlesWizardPage_Title=Select Projects to Convert
+OSGiBundleFacetInstallPage_Description=Configure bundle metadata.
+OSGiBundleFacetInstallPage_Name=Na&me:
+OSGiBundleFacetInstallPage_SymbolicName=&Symbolic name:
+OSGiBundleFacetInstallPage_Title=OSGi Bundle
+OSGiBundleFacetInstallPage_Vendor=Ven&dor:
+OSGiBundleFacetInstallPage_Version=&Version:
+OSGiBundleFacetUninstallPage_Description=Choose uninstall strategy.
+OSGiBundleFacetUninstallPage_Title=OSGi Bundle
diff --git a/plugins/org.eclipse.libra.facet/plugin.properties b/plugins/org.eclipse.libra.facet/plugin.properties
index 182433a..07c75b5 100644
--- a/plugins/org.eclipse.libra.facet/plugin.properties
+++ b/plugins/org.eclipse.libra.facet/plugin.properties
@@ -10,3 +10,12 @@
###############################################################################
Bundle-Name = OSGi Bundle Facet Core (Incubation)
Bundle-Vendor = Eclipse Web Tools Platform
+
+osgi.bundle.facet.label = OSGi Bundle
+osgi.bundle.facet.description = Enables OSGi Bundle nature for projects.
+osgi.java.bundle.preset.label = OSGi Java Bundle
+osgi.java.bundle.preset.description = Configures a Java project as a OSGi Bundle project.
+osgi.web.bundle.preset.label = OSGi Web Application Bundle
+osgi.web.bundle.preset.description = Configures a Dynamic Web application as a OSGi Web Application Bundle project.
+osgi.persistent.bundle.preset.label = OSGi Persistent Bundle
+osgi.persistent.bundle.preset.description = Configures a JPA application as a OSGi Persistent Bundle project.
diff --git a/plugins/org.eclipse.libra.facet/plugin.xml b/plugins/org.eclipse.libra.facet/plugin.xml
index 15f0f37..590a3f7 100644
--- a/plugins/org.eclipse.libra.facet/plugin.xml
+++ b/plugins/org.eclipse.libra.facet/plugin.xml
@@ -6,10 +6,10 @@
<project-facet
id="osgi.bundle">
<label>
- OSGi Bundle
+ %osgi.bundle.facet.label
</label>
<description>
- Enables OSGi Bundle nature for projects.
+ %osgi.bundle.facet.description
</description>
</project-facet>
<project-facet-version
@@ -19,7 +19,7 @@
id="osgi.bundle.install"
type="install">
<delegate
- class="org.eclipse.libra.facet.OSGiBundleInstallDelegate">
+ class="org.eclipse.libra.facet.OSGiBundleFacetInstallDelegate">
</delegate>
<config-factory
class="org.eclipse.libra.facet.OSGiBundleFacetInstallConfigFactory">
@@ -29,7 +29,7 @@
id="osgi.bundle.uninstall"
type="uninstall">
<delegate
- class="org.eclipse.libra.facet.OSGiBundleUninstallDelegate">
+ class="org.eclipse.libra.facet.OSGiBundleFacetUninstallDelegate">
</delegate>
<config-factory
class="org.eclipse.libra.facet.OSGiBundleFacetUninstallConfigFactory">
@@ -49,10 +49,10 @@
<static-preset
id="osgi.java.bundle.preset">
<label>
- OSGi Bundle
+ %osgi.java.bundle.preset.label
</label>
<description>
- Configures a Java project as a OSGi Bundle project.
+ %osgi.java.bundle.preset.description
</description>
<facet
id="java"
@@ -66,10 +66,10 @@
<static-preset
id="osgi.web.bundle.preset">
<label>
- OSGi Web Application Bundle
+ %osgi.web.bundle.preset.label
</label>
<description>
- Configures a Dynamic Web application as a OSGi Web Application Bundle project.
+ %osgi.web.bundle.preset.description
</description>
<facet
id="java"
@@ -87,10 +87,10 @@
<static-preset
id="osgi.persistent.bundle.preset">
<label>
- OSGi Persistent Bundle
+ %osgi.persistent.bundle.preset.label
</label>
<description>
- Configures a JPA application as a OSGi Persistent Bundle project.
+ %osgi.persistent.bundle.preset.description
</description>
<facet
id="java"
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/Messages.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/Messages.java
new file mode 100644
index 0000000..5f1a29a
--- /dev/null
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/Messages.java
@@ -0,0 +1,19 @@
+package org.eclipse.libra.facet;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.libra.facet.messages"; //$NON-NLS-1$
+ public static String OSGiBundleFacetInstallConfig_EmptySymbolicName;
+ public static String OSGiBundleFacetInstallConfig_EmptyVersion;
+ public static String OSGiBundleFacetUninstallStrategy_FacetAndPluginNatureAndManifest;
+ public static String OSGiBundleFacetUninstallStrategy_FacetAndPluginNatureButNotManifest;
+ public static String OSGiBundleFacetUninstallStrategy_FacetOnly;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetEventHandler.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetEventHandler.java
index b11ecd4..a40e4cb 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetEventHandler.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetEventHandler.java
@@ -9,15 +9,19 @@
* Kaloyan Raev (SAP AG) - initial API and implementation
*******************************************************************************/
package org.eclipse.libra.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.pde.core.project.IBundleProjectDescription;
-import org.eclipse.pde.core.project.IBundleProjectService;
-import org.eclipse.pde.core.project.IPackageImportDescription;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_PERSISTENCE_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JPA_FACET;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.META_PERSISTENCE_HEADER;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.pde.core.project.IBundleProjectDescription;
+import org.eclipse.pde.core.project.IBundleProjectService;
+import org.eclipse.pde.core.project.IPackageImportDescription;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
public class OSGiBundleFacetEventHandler implements IDelegate {
@@ -25,13 +29,13 @@ public class OSGiBundleFacetEventHandler implements IDelegate {
public void execute(IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
- if ("jpt.jpa".equals(fv.getProjectFacet().getId()) && OSGiBundleUtils.isOSGiBundle(project)) {
+ if (JPA_FACET.equals(fv.getProjectFacet().getId()) && OSGiBundleFacetUtils.isOSGiBundle(project)) {
IBundleProjectService bundleProjectService = Activator.getDefault().getBundleProjectService();
IBundleProjectDescription bundleProjectDescription = bundleProjectService.getDescription(project);
// add the Meta-Persistence manifest header
- if (null == bundleProjectDescription.getHeader("Meta-Persistence")) {
- bundleProjectDescription.setHeader("Meta-Persistence", "");
+ if (null == bundleProjectDescription.getHeader(META_PERSISTENCE_HEADER)) {
+ bundleProjectDescription.setHeader(META_PERSISTENCE_HEADER, ""); //$NON-NLS-1$
}
// add the javax.persistence package import
@@ -39,14 +43,14 @@ public class OSGiBundleFacetEventHandler implements IDelegate {
boolean found = false;
if (imports != null) {
for (IPackageImportDescription imp : imports) {
- if ("javax.persistence".equals(imp.getName())) {
+ if (JAVAX_PERSISTENCE_PACKAGE.equals(imp.getName())) {
found = true;
break;
}
}
}
if (!found) {
- IPackageImportDescription imp = bundleProjectService.newPackageImport("javax.persistence", null, false);
+ IPackageImportDescription imp = bundleProjectService.newPackageImport(JAVAX_PERSISTENCE_PACKAGE, null, false);
IPackageImportDescription[] newImports;
if (imports == null) {
newImports = new IPackageImportDescription[1];
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallConfig.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallConfig.java
index 0919832..8bb9a3b 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallConfig.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallConfig.java
@@ -30,7 +30,7 @@ import org.osgi.framework.Version;
public class OSGiBundleFacetInstallConfig extends ActionConfig implements IFacetedProjectListener {
- private static final String QUALIFIER = "qualifier";
+ private static final String QUALIFIER = "qualifier"; //$NON-NLS-1$
private IObservableValue symbolicNameValue;
private IObservableValue versionValue;
@@ -38,7 +38,7 @@ public class OSGiBundleFacetInstallConfig extends ActionConfig implements IFacet
private IObservableValue vendorValue;
public OSGiBundleFacetInstallConfig() {
- Realm realm = OSGiBundleRealm.getRealm();
+ Realm realm = OSGiBundleFacetRealm.getRealm();
symbolicNameValue = new WritableValue(realm, getDefaultSymbolicName(), String.class);
versionValue = new WritableValue(realm, getDefaultVersion(), String.class);
@@ -204,7 +204,7 @@ public class OSGiBundleFacetInstallConfig extends ActionConfig implements IFacet
String symbolicName = (String) value;
if (symbolicName == null || symbolicName.trim().length() == 0) {
- return ValidationStatus.error("Symbolic name cannot be empty.");
+ return ValidationStatus.error(Messages.OSGiBundleFacetInstallConfig_EmptySymbolicName);
}
return ValidationStatus.ok();
@@ -218,7 +218,7 @@ public class OSGiBundleFacetInstallConfig extends ActionConfig implements IFacet
String version = (String) value;
if (version == null || version.trim().length() == 0) {
- return ValidationStatus.error("Version cannot be empty.");
+ return ValidationStatus.error(Messages.OSGiBundleFacetInstallConfig_EmptyVersion);
}
return ValidationStatus.ok();
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleInstallDelegate.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallDelegate.java
index 24f86c7..c4d4634 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleInstallDelegate.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetInstallDelegate.java
@@ -8,46 +8,55 @@
* Contributors:
* Kaloyan Raev (SAP AG) - initial API and implementation
*******************************************************************************/
-package org.eclipse.libra.facet;
+package org.eclipse.libra.facet;
+
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_EL_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_PERSISTENCE_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_SERVLET_HTTP_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_SERVLET_JSP_EL_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_SERVLET_JSP_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_SERVLET_JSP_TAGEXT_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.JAVAX_SERVLET_PACKAGE;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.META_PERSISTENCE_HEADER;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.WEB_CONTEXT_PATH_HEADER;
+import static org.eclipse.libra.facet.OSGiBundleFacetUtils.WEB_INF_CLASSES;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.osgi.service.resolver.VersionRange;
+import org.eclipse.pde.core.project.IBundleClasspathEntry;
+import org.eclipse.pde.core.project.IBundleProjectDescription;
+import org.eclipse.pde.core.project.IBundleProjectService;
+import org.eclipse.pde.core.project.IPackageExportDescription;
+import org.eclipse.pde.core.project.IPackageImportDescription;
+import org.eclipse.pde.internal.core.PDECore;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.osgi.framework.Version;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.pde.core.project.IBundleClasspathEntry;
-import org.eclipse.pde.core.project.IBundleProjectDescription;
-import org.eclipse.pde.core.project.IBundleProjectService;
-import org.eclipse.pde.core.project.IPackageExportDescription;
-import org.eclipse.pde.core.project.IPackageImportDescription;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.osgi.framework.Version;
-
-
-public class OSGiBundleInstallDelegate implements IDelegate {
-
- private static final String WEB_INF_CLASSES = "WEB-INF/classes/"; //$NON-NLS-1$
+public class OSGiBundleFacetInstallDelegate implements IDelegate {
public void execute(IProject project, IProjectFacetVersion fv,
Object configObject, IProgressMonitor monitor) throws CoreException {
@@ -65,7 +74,7 @@ public class OSGiBundleInstallDelegate implements IDelegate {
private void setBundleRoot(IProject project) throws CoreException {
IPath bundleRoot = null;
- if (OSGiBundleUtils.isWebProject(project)) {
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
IVirtualComponent component = ComponentCore.createComponent(project);
bundleRoot = component.getRootFolder().getProjectRelativePath();
}
@@ -125,10 +134,10 @@ public class OSGiBundleInstallDelegate implements IDelegate {
}
private String[] getLaunchShortcuts(IProject project) throws CoreException {
- if (OSGiBundleUtils.isWebProject(project)) {
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
return new String[] {
- "org.eclipse.pde.ui.EquinoxLaunchShortcut",
- "org.eclipse.wst.server.launchShortcut"
+ "org.eclipse.pde.ui.EquinoxLaunchShortcut", //$NON-NLS-1$
+ "org.eclipse.wst.server.launchShortcut" //$NON-NLS-1$
};
}
// use default OSGi Framework launchers
@@ -138,12 +147,12 @@ public class OSGiBundleInstallDelegate implements IDelegate {
private Map<String, String> getAdditionalHeaders(IProject project) throws CoreException {
Map<String, String> headers = new HashMap<String, String>();
- if (OSGiBundleUtils.isWebProject(project)) {
- headers.put("Web-ContextPath", getContextRoot(project));
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
+ headers.put(WEB_CONTEXT_PATH_HEADER, getContextRoot(project));
}
- if (OSGiBundleUtils.isJpaProject(project)) {
- headers.put("Meta-Persistence", "");
+ if (OSGiBundleFacetUtils.isJpaProject(project)) {
+ headers.put(META_PERSISTENCE_HEADER, ""); //$NON-NLS-1$
}
return headers;
@@ -154,7 +163,7 @@ public class OSGiBundleInstallDelegate implements IDelegate {
String contextRoot = component.getMetaProperties().getProperty(IModuleConstants.CONTEXTROOT);
// add leading slash if not available
if (contextRoot.charAt(0) != '/') {
- contextRoot = "/" + contextRoot;
+ contextRoot = '/' + contextRoot;
}
return contextRoot;
}
@@ -163,7 +172,7 @@ public class OSGiBundleInstallDelegate implements IDelegate {
IBundleProjectService bundleProjectService = Activator.getDefault().getBundleProjectService();
List<IPackageExportDescription> list = new ArrayList<IPackageExportDescription>();
- if (OSGiBundleUtils.isJavaProject(project)) {
+ if (OSGiBundleFacetUtils.isJavaProject(project)) {
IJavaProject javaProject = JavaCore.create(project);
IPackageFragmentRoot[] fragmentRoots = javaProject.getAllPackageFragmentRoots();
for (IPackageFragmentRoot fragmentRoot : fragmentRoots) {
@@ -196,21 +205,21 @@ public class OSGiBundleInstallDelegate implements IDelegate {
IBundleProjectService bundleProjectService = Activator.getDefault().getBundleProjectService();
- if (OSGiBundleUtils.isWebProject(project)) {
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
// add the most popular servlet packages
- addPackageImport(packages, "javax.servlet", null, false);
- addPackageImport(packages, "javax.servlet.http", null, false);
- addPackageImport(packages, "javax.servlet.jsp", null, false);
- addPackageImport(packages, "javax.servlet.jsp.el", null, false);
- addPackageImport(packages, "javax.servlet.jsp.tagext", null, false);
- addPackageImport(packages, "javax.el", null, false);
+ addPackageImport(packages, JAVAX_SERVLET_PACKAGE, null, false);
+ addPackageImport(packages, JAVAX_SERVLET_HTTP_PACKAGE, null, false);
+ addPackageImport(packages, JAVAX_SERVLET_JSP_PACKAGE, null, false);
+ addPackageImport(packages, JAVAX_SERVLET_JSP_EL_PACKAGE, null, false);
+ addPackageImport(packages, JAVAX_SERVLET_JSP_TAGEXT_PACKAGE, null, false);
+ addPackageImport(packages, JAVAX_EL_PACKAGE, null, false);
// add packages exported by referenced components
IVirtualComponent component = ComponentCore.createComponent(project);
IVirtualReference[] references = component.getReferences();
for (IVirtualReference ref : references) {
IProject refProject = ref.getReferencedComponent().getProject();
- if (refProject != null && refProject != project && OSGiBundleUtils.hasPluginNature(refProject)) {
+ if (refProject != null && refProject != project && OSGiBundleFacetUtils.hasPluginNature(refProject)) {
IPackageExportDescription[] exports = bundleProjectService.getDescription(refProject).getPackageExports();
for (IPackageExportDescription export : exports) {
String importName = export.getName();
@@ -222,8 +231,8 @@ public class OSGiBundleInstallDelegate implements IDelegate {
}
}
- if (OSGiBundleUtils.isJpaProject(project)) {
- addPackageImport(packages, "javax.persistence", null, false);
+ if (OSGiBundleFacetUtils.isJpaProject(project)) {
+ addPackageImport(packages, JAVAX_PERSISTENCE_PACKAGE, null, false);
}
return packages.values().toArray(new IPackageImportDescription[packages.size()]);
@@ -241,7 +250,7 @@ public class OSGiBundleInstallDelegate implements IDelegate {
IProject project = bundleProjectDescription.getProject();
IVirtualComponent component = ComponentCore.createComponent(project);
- if (OSGiBundleUtils.isWebProject(project)) {
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
IPath bundleRoot = component.getRootFolder().getProjectRelativePath();
IResource[] resources = project.getFolder(bundleRoot).members();
List<IPath> binPaths = new ArrayList<IPath>();
@@ -249,10 +258,10 @@ public class OSGiBundleInstallDelegate implements IDelegate {
for (int i = 0; i < resources.length; i++) {
String token = resources[i].getName();
if (resources[i].getType() == IResource.FOLDER) {
- token += "/";
+ token += '/';
}
- if (!token.equals(OSGiBundleUtils.BUILD_PROPERTIES)) {
+ if (!token.equals(OSGiBundleFacetUtils.BUILD_PROPERTIES)) {
binPaths.add(new Path(token));
}
}
@@ -268,7 +277,7 @@ public class OSGiBundleInstallDelegate implements IDelegate {
IProject project = bundleProjectDescription.getProject();
IBundleClasspathEntry[] bundleClasspath = bundleProjectDescription.getBundleClasspath();
- if (OSGiBundleUtils.isWebProject(project)) {
+ if (OSGiBundleFacetUtils.isWebProject(project)) {
IJavaProject javaProject = JavaCore.create(project);
if (bundleClasspath == null) {
IBundleProjectService bundleProjectService = Activator.getDefault().getBundleProjectService();
@@ -290,10 +299,10 @@ public class OSGiBundleInstallDelegate implements IDelegate {
}
private void addRequiredPluginsClasspathContainer(IProject project, IProgressMonitor monitor) throws CoreException {
- if (OSGiBundleUtils.isJavaProject(project)) {
+ if (OSGiBundleFacetUtils.isJavaProject(project)) {
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] entries = javaProject.getRawClasspath();
- if (!OSGiBundleUtils.hasRequiredPlugins(entries)) {
+ if (!OSGiBundleFacetUtils.hasRequiredPlugins(entries)) {
IClasspathEntry[] newEntries = new IClasspathEntry[entries.length + 1];
for (int i = 0; i < entries.length; i++) {
newEntries[i] = entries[i];
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleRealm.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetRealm.java
index 780825a..66610ff 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleRealm.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetRealm.java
@@ -12,7 +12,7 @@ package org.eclipse.libra.facet;
import org.eclipse.core.databinding.observable.Realm;
-class OSGiBundleRealm {
+class OSGiBundleFacetRealm {
private static Realm realm;
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallConfig.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallConfig.java
index c9d445d..2336336 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallConfig.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallConfig.java
@@ -21,7 +21,7 @@ public class OSGiBundleFacetUninstallConfig extends ActionConfig {
private WritableValue[] optionValues;
public OSGiBundleFacetUninstallConfig() {
- Realm realm = OSGiBundleRealm.getRealm();
+ Realm realm = OSGiBundleFacetRealm.getRealm();
strategyValue = new SelectObservableValue(realm, OSGiBundleFacetUninstallStrategy.class);
optionValues = new WritableValue[OSGiBundleFacetUninstallStrategy.values().length];
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleUninstallDelegate.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallDelegate.java
index c285008..45c06c1 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleUninstallDelegate.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallDelegate.java
@@ -27,7 +27,7 @@ import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-public class OSGiBundleUninstallDelegate implements IDelegate {
+public class OSGiBundleFacetUninstallDelegate implements IDelegate {
public void execute(IProject project, IProjectFacetVersion fv,
Object configObject, IProgressMonitor monitor) throws CoreException {
@@ -70,14 +70,14 @@ public class OSGiBundleUninstallDelegate implements IDelegate {
}
private void removeRequiredBundlesClasspathContainer(IProject project, IProgressMonitor monitor) throws CoreException {
- if (OSGiBundleUtils.isJavaProject(project)) {
+ if (OSGiBundleFacetUtils.isJavaProject(project)) {
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] entries = javaProject.getRawClasspath();
- if (OSGiBundleUtils.hasRequiredPlugins(entries)) {
+ if (OSGiBundleFacetUtils.hasRequiredPlugins(entries)) {
IClasspathEntry[] newEntries = new IClasspathEntry[entries.length - 1];
int i = 0;
for (IClasspathEntry entry : entries) {
- if (!OSGiBundleUtils.isRequiredPlugins(entry)) {
+ if (!OSGiBundleFacetUtils.isRequiredPlugins(entry)) {
newEntries[i++] = entry;
}
}
@@ -87,12 +87,12 @@ public class OSGiBundleUninstallDelegate implements IDelegate {
}
private void deleteBuildProperties(IProject project, IProgressMonitor monitor) throws CoreException {
- IResource buildPropertiesFile = findResource(project, OSGiBundleUtils.BUILD_PROPERTIES);
+ IResource buildPropertiesFile = findResource(project, OSGiBundleFacetUtils.BUILD_PROPERTIES);
buildPropertiesFile.delete(IResource.KEEP_HISTORY, monitor);
}
private void cleanUpManifest(IProject project, IProgressMonitor monitor) throws CoreException {
- IResource manifestFile = findResource(project, OSGiBundleUtils.MANIFEST_URI);
+ IResource manifestFile = findResource(project, OSGiBundleFacetUtils.MANIFEST_URI);
manifestFile.delete(IResource.KEEP_HISTORY, monitor);
// delete the META-INF folder if empty
@@ -108,7 +108,7 @@ public class OSGiBundleUninstallDelegate implements IDelegate {
IPath bundleRoot = bundleProjectDescription.getBundleRoot();
IPath memberPath = bundleRoot;
if (memberPath == null) {
- memberPath = new Path("");
+ memberPath = new Path(""); //$NON-NLS-1$
}
memberPath = memberPath.append(memberURI);
return project.findMember(memberPath);
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallStrategy.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallStrategy.java
index aa5698e..34ba5eb 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallStrategy.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUninstallStrategy.java
@@ -12,9 +12,9 @@ package org.eclipse.libra.facet;
public enum OSGiBundleFacetUninstallStrategy {
- FACET_ONLY("Uninstall the facet only and keep the plugin nature"),
- FACET_AND_PLUGIN_NATURE_BUT_NOT_MANIFEST("Uninstall the facet and the plugin nature, but keep the MANIFEST.MF"),
- FACET_AND_PLUGIN_NATURE_AND_MANIFEST("Uninstall the facet and the plugin nature, and remove the MANIFEST.MF");
+ FACET_ONLY(Messages.OSGiBundleFacetUninstallStrategy_FacetOnly),
+ FACET_AND_PLUGIN_NATURE_BUT_NOT_MANIFEST(Messages.OSGiBundleFacetUninstallStrategy_FacetAndPluginNatureButNotManifest),
+ FACET_AND_PLUGIN_NATURE_AND_MANIFEST(Messages.OSGiBundleFacetUninstallStrategy_FacetAndPluginNatureAndManifest);
private final String description;
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleUtils.java b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUtils.java
index a8107fd..61cdafa 100644
--- a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleUtils.java
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/OSGiBundleFacetUtils.java
@@ -10,27 +10,41 @@
*******************************************************************************/
package org.eclipse.libra.facet;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.pde.core.project.IBundleProjectDescription;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.natures.PDE;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.pde.core.project.IBundleProjectDescription;
+import org.eclipse.pde.internal.core.PDECore;
+import org.eclipse.pde.internal.core.natures.PDE;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-public class OSGiBundleUtils {
+public class OSGiBundleFacetUtils {
public static final String OSGI_BUNDLE = "osgi.bundle"; //$NON-NLS-1$
public static final IProjectFacet OSGI_BUNDLE_FACET = ProjectFacetsManager.getProjectFacet(OSGI_BUNDLE);
- public static final IProjectFacetVersion OSGI_BUNDLE_FACET_42 = OSGI_BUNDLE_FACET.getVersion("4.2"); //$NON-NLS-1$
+ public static final IProjectFacetVersion OSGI_BUNDLE_FACET_42 = OSGI_BUNDLE_FACET.getVersion("4.2"); //$NON-NLS-1$
+
+ public static final String WEB_FACET = "jst.web"; //$NON-NLS-1$
+ public static final String JPA_FACET = "jpt.jpa"; //$NON-NLS-1$
public static final String BUILD_PROPERTIES = "build.properties"; //$NON-NLS-1$
- public static final String MANIFEST_URI = "META-INF/MANIFEST.MF"; //$NON-NLS-1$
+ public static final String MANIFEST_URI = "META-INF/MANIFEST.MF"; //$NON-NLS-1$
+ public static final String WEB_INF_CLASSES = "WEB-INF/classes/"; //$NON-NLS-1$
+
+ public static final String WEB_CONTEXT_PATH_HEADER = "Web-ContextPath"; //$NON-NLS-1$
+ public static final String META_PERSISTENCE_HEADER = "Meta-Persistence"; //$NON-NLS-1$
+
+ public static final String JAVAX_SERVLET_PACKAGE = "javax.servlet"; //$NON-NLS-1$
+ public static final String JAVAX_SERVLET_HTTP_PACKAGE = "javax.servlet.http"; //$NON-NLS-1$
+ public static final String JAVAX_SERVLET_JSP_PACKAGE = "javax.servlet.jsp"; //$NON-NLS-1$
+ public static final String JAVAX_SERVLET_JSP_EL_PACKAGE = "javax.servlet.jsp.el"; //$NON-NLS-1$
+ public static final String JAVAX_SERVLET_JSP_TAGEXT_PACKAGE = "javax.servlet.jsp.tagext"; //$NON-NLS-1$
+ public static final String JAVAX_EL_PACKAGE = "javax.el"; //$NON-NLS-1$
+ public static final String JAVAX_PERSISTENCE_PACKAGE = "javax.persistence"; //$NON-NLS-1$
public static boolean hasPluginNature(IProject project) throws CoreException {
return project.hasNature(IBundleProjectDescription.PLUGIN_NATURE);
@@ -53,11 +67,11 @@ public class OSGiBundleUtils {
}
public static boolean isWebProject(IProject project) throws CoreException {
- return FacetedProjectFramework.hasProjectFacet(project, IModuleConstants.JST_WEB_MODULE);
+ return FacetedProjectFramework.hasProjectFacet(project, WEB_FACET);
}
public static boolean isJpaProject(IProject project) throws CoreException {
- return FacetedProjectFramework.hasProjectFacet(project, "jpt.jpa");
+ return FacetedProjectFramework.hasProjectFacet(project, JPA_FACET);
}
public static boolean isRequiredPlugins(IClasspathEntry entry) {
diff --git a/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/messages.properties b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/messages.properties
new file mode 100644
index 0000000..8d04446
--- /dev/null
+++ b/plugins/org.eclipse.libra.facet/src/org/eclipse/libra/facet/messages.properties
@@ -0,0 +1,5 @@
+OSGiBundleFacetInstallConfig_EmptySymbolicName=Symbolic name cannot be empty.
+OSGiBundleFacetInstallConfig_EmptyVersion=Version cannot be empty.
+OSGiBundleFacetUninstallStrategy_FacetAndPluginNatureAndManifest=Uninstall the facet and the plugin nature, and remove the MANIFEST.MF
+OSGiBundleFacetUninstallStrategy_FacetAndPluginNatureButNotManifest=Uninstall the facet and the plugin nature, but keep the MANIFEST.MF
+OSGiBundleFacetUninstallStrategy_FacetOnly=Uninstall the facet only and keep the plugin nature
diff --git a/tests/org.eclipse.libra.facet.test/src/org/eclipse/libra/facet/test/WabConversionTest.java b/tests/org.eclipse.libra.facet.test/src/org/eclipse/libra/facet/test/WabConversionTest.java
index d0abcb3..9a3e3d2 100644
--- a/tests/org.eclipse.libra.facet.test/src/org/eclipse/libra/facet/test/WabConversionTest.java
+++ b/tests/org.eclipse.libra.facet.test/src/org/eclipse/libra/facet/test/WabConversionTest.java
@@ -30,7 +30,7 @@ import org.eclipse.libra.facet.Activator;
import org.eclipse.libra.facet.OSGiBundleFacetInstallConfig;
import org.eclipse.libra.facet.OSGiBundleFacetUninstallConfig;
import org.eclipse.libra.facet.OSGiBundleFacetUninstallStrategy;
-import org.eclipse.libra.facet.OSGiBundleUtils;
+import org.eclipse.libra.facet.OSGiBundleFacetUtils;
import org.eclipse.libra.facet.ui.operations.ConvertProjectsToBundlesOperation;
import org.eclipse.pde.core.project.IBundleClasspathEntry;
import org.eclipse.pde.core.project.IBundleProjectDescription;
@@ -110,7 +110,7 @@ public class WabConversionTest {
IProject javaProject = importProjectInWorkspace(JAVA_PRJ_COPY_LOCATION, JAVA_PRJ_COPY_NAME);
OSGiBundleFacetInstallConfig osgiBundleFacetInstallConfig = setupOSGiBundleFacetInstallConfig("customSymbolicName", "CustomBundleName", "customVendor", "1.0.1.qualifier");
IFacetedProject fproj = ProjectFacetsManager.create(javaProject, true, monitor);
- fproj.installProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, osgiBundleFacetInstallConfig, monitor);
+ fproj.installProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, osgiBundleFacetInstallConfig, monitor);
IBundleProjectService bundleProjectService = Activator.getDefault().getBundleProjectService();
IBundleProjectDescription description = bundleProjectService.getDescription(javaProject);
@@ -175,7 +175,7 @@ public class WabConversionTest {
OSGiBundleFacetInstallConfig osgiBundleFacetInstallConfig = setupOSGiBundleFacetInstallConfig("customSymbolicName", "CustomBundleName", "customVendor", "1.0.1.qualifier");
IFacetedProject fproj = ProjectFacetsManager.create(webProject, true, monitor);
- fproj.installProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, osgiBundleFacetInstallConfig, monitor);
+ fproj.installProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, osgiBundleFacetInstallConfig, monitor);
IBundleProjectService bundleProjectService = Activator.getDefault().getBundleProjectService();
IBundleProjectDescription description = bundleProjectService.getDescription(webProject);
@@ -216,10 +216,10 @@ public class WabConversionTest {
IFacetedProject fproj = ProjectFacetsManager.create(webProject, true, monitor);
OSGiBundleFacetUninstallConfig config = new OSGiBundleFacetUninstallConfig();
config.setStrategy(OSGiBundleFacetUninstallStrategy.FACET_AND_PLUGIN_NATURE_AND_MANIFEST);
- fproj.uninstallProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, config, monitor);
+ fproj.uninstallProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, config, monitor);
Assert.assertFalse(webProject.hasNature(IBundleProjectDescription.PLUGIN_NATURE));
Assert.assertFalse(hasPluginDependenciesCP(webProject));
- IFile buildPropertiesFile = webProject.getFile("WebContent/" + OSGiBundleUtils.BUILD_PROPERTIES);
+ IFile buildPropertiesFile = webProject.getFile("WebContent/" + OSGiBundleFacetUtils.BUILD_PROPERTIES);
Assert.assertFalse(buildPropertiesFile.exists());
}
@@ -229,10 +229,10 @@ public class WabConversionTest {
IFacetedProject fproj = ProjectFacetsManager.create(javaProject, true, monitor);
OSGiBundleFacetUninstallConfig config = new OSGiBundleFacetUninstallConfig();
config.setStrategy(OSGiBundleFacetUninstallStrategy.FACET_AND_PLUGIN_NATURE_AND_MANIFEST);
- fproj.uninstallProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, config, monitor);
+ fproj.uninstallProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, config, monitor);
Assert.assertFalse(javaProject.hasNature(IBundleProjectDescription.PLUGIN_NATURE));
Assert.assertFalse(hasPluginDependenciesCP(javaProject));
- IFile buildPropertiesFile = javaProject.getFile(OSGiBundleUtils.BUILD_PROPERTIES);
+ IFile buildPropertiesFile = javaProject.getFile(OSGiBundleFacetUtils.BUILD_PROPERTIES);
Assert.assertFalse(buildPropertiesFile.exists());
}
@@ -242,10 +242,10 @@ public class WabConversionTest {
IFacetedProject fproj = ProjectFacetsManager.create(pluginProject, true, monitor);
OSGiBundleFacetUninstallConfig config = new OSGiBundleFacetUninstallConfig();
config.setStrategy(OSGiBundleFacetUninstallStrategy.FACET_ONLY);
- fproj.uninstallProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, config, monitor);
+ fproj.uninstallProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, config, monitor);
Assert.assertTrue(pluginProject.hasNature(IBundleProjectDescription.PLUGIN_NATURE));
Assert.assertTrue(hasPluginDependenciesCP(pluginProject));
- IFile buildPropertiesFile = pluginProject.getFile(OSGiBundleUtils.BUILD_PROPERTIES);
+ IFile buildPropertiesFile = pluginProject.getFile(OSGiBundleFacetUtils.BUILD_PROPERTIES);
Assert.assertTrue(buildPropertiesFile.exists());
}
@@ -255,9 +255,9 @@ public class WabConversionTest {
IFacetedProject fproj = ProjectFacetsManager.create(simpleProject, true, monitor);
OSGiBundleFacetUninstallConfig config = new OSGiBundleFacetUninstallConfig();
config.setStrategy(OSGiBundleFacetUninstallStrategy.FACET_AND_PLUGIN_NATURE_AND_MANIFEST);
- fproj.uninstallProjectFacet(OSGiBundleUtils.OSGI_BUNDLE_FACET_42, config, monitor);
+ fproj.uninstallProjectFacet(OSGiBundleFacetUtils.OSGI_BUNDLE_FACET_42, config, monitor);
Assert.assertFalse(simpleProject.hasNature(IBundleProjectDescription.PLUGIN_NATURE));
- IFile buildPropertiesFile = simpleProject.getFile(OSGiBundleUtils.BUILD_PROPERTIES);
+ IFile buildPropertiesFile = simpleProject.getFile(OSGiBundleFacetUtils.BUILD_PROPERTIES);
Assert.assertFalse(buildPropertiesFile.exists());
}