[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards ...
Robert Stryker
rawblem at gmail.com
Wed Jan 10 14:30:03 EST 2007
User: rawb
Date: 07/01/10 14:30:03
Modified: as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards
NewMBeanWizard.java
Log:
puts the service xml in meta-inf where it belongs
Revision Changes Path
1.2 +39 -4 jbosside/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards/NewMBeanWizard.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NewMBeanWizard.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards/NewMBeanWizard.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- NewMBeanWizard.java 16 Nov 2006 22:45:30 -0000 1.1
+++ NewMBeanWizard.java 10 Jan 2007 19:30:03 -0000 1.2
@@ -16,9 +16,11 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
@@ -51,6 +53,10 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.ContainerGenerator;
+import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
+import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.ui.internal.wizards.NewModelWizard;
@@ -97,10 +103,9 @@
IPath fullPath = newFilePage.getContainerFullPath();
- IPath newPath = new Path(fullPath.segment(0));
+ IPath newPath = new Path(fullPath.segment(0)).append("META-INF");
+ createContainer(newPath);
- // TODO: BLOCKING on eclipse bug 153135
-// IPath newPath = new Path(fullPath.segment(0)).append("META-INF");
newFilePage.setContainerFullPath(newPath);
IFile newFile = newFilePage.createNewFile();
@@ -126,6 +131,36 @@
return true;
}
+ protected void createContainer(final IPath containerPath) {
+ IFile fileHandle = IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getFile(containerPath);
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation(createRule(fileHandle)) {
+ protected void execute(IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ ContainerGenerator generator = new ContainerGenerator(containerPath);
+ generator.generateContainer(new NullProgressMonitor());
+ } catch( Exception e ) {
+ }
+ }
+ };
+
+ try {
+ getContainer().run(true, true, op);
+ } catch( Exception e) {}
+ }
+ protected ISchedulingRule createRule(IResource resource) {
+ IResource parent = resource.getParent();
+ while (parent != null) {
+ if (parent.exists()) {
+ return resource.getWorkspace().getRuleFactory().createRule(resource);
+ }
+ resource = parent;
+ parent = parent.getParent();
+ }
+ return resource.getWorkspace().getRoot();
+ }
+
+
public void init(IWorkbench workbench, IStructuredSelection selection) {
sel = selection;
}
More information about the jboss-cvs-commits
mailing list