Changeset 4055 for devel-tools
- Timestamp:
- Jan 10, 2009, 5:48:24 PM (12 years ago)
- Location:
- devel-tools/trunk/eclipse
- Files:
-
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.core/META-INF/MANIFEST.MF
r4035 r4055 15 15 org.refal.rfpdt.lib 16 16 Eclipse-LazyStart: true 17 Bundle-ActivationPolicy: lazy 17 18 Bundle-RequiredExecutionEnvironment: J2SE-1.5 18 19 Bundle-ClassPath: . -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/META-INF/MANIFEST.MF
r4035 r4055 24 24 org.refal.rfpdt.core 25 25 Eclipse-LazyStart: true 26 Bundle-ActivationPolicy: lazy 26 27 Bundle-RequiredExecutionEnvironment: J2SE-1.5 27 28 Bundle-ClassPath: . -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/plugin.xml
r3870 r4055 56 56 <key 57 57 commandId="org.refal.rfpdt.launch.shortcut.debug" 58 contextId="org.eclipse.ui.globalScope"59 58 schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" 60 59 sequence="M3+M2+D R"/> 61 60 <key 62 61 commandId="org.refal.rfpdt.launch.shortcut.run" 63 contextId="org.eclipse.ui.globalScope"64 62 schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" 65 63 sequence="M3+M2+X R"/> … … 409 407 point="org.eclipse.jdt.ui.classpathContainerPage"> 410 408 <classpathContainerPage 411 class="org.refal.rfpdt.ui. launching.RfpContainerWizardPage"412 id="org.refal.rfpdt. ui.rfpContainerPage"409 class="org.refal.rfpdt.ui.wizards.RfpContainerWizardPage" 410 id="org.refal.rfpdt.launching.rfpContainer" 413 411 name="Refal Plus Library"> 414 412 </classpathContainerPage> -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/wizards/NewRfpModuleWizard.java
r3818 r4055 17 17 private IWorkbench workbench; 18 18 private IStructuredSelection selection; 19 private NewRfpModule Page page;19 private NewRfpModuleWizardPage page; 20 20 21 21 public NewRfpModuleWizard () { … … 28 28 public void addPages () { 29 29 super.addPages(); 30 page = new NewRfpModule Page();30 page = new NewRfpModuleWizardPage(); 31 31 page.setTitle("Refal Plus Module"); 32 32 page.setDescription("Create a Refal Plus module"); -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/wizards/NewRfpModuleWizardPage.java
r4053 r4055 3 3 import java.io.ByteArrayInputStream; 4 4 import java.io.InputStream; 5 import java.lang.reflect.InvocationTargetException; 6 7 import org.eclipse.core.commands.ExecutionException; 5 8 6 import org.eclipse.core.resources.IFile; 7 import org.eclipse.core.resources.IFolder; 9 8 import org.eclipse.core.resources.IProject; 9 import org.eclipse.core.resources.IResource; 10 import org.eclipse.core.resources.IResourceStatus; 11 import org.eclipse.core.resources.IWorkspaceRoot; 10 12 import org.eclipse.core.resources.ProjectScope; 13 import org.eclipse.core.resources.ResourcesPlugin; 11 14 import org.eclipse.core.runtime.CoreException; 12 import org.eclipse.core.runtime.IP rogressMonitor;15 import org.eclipse.core.runtime.IPath; 13 16 import org.eclipse.core.runtime.IStatus; 14 17 import org.eclipse.core.runtime.Platform; … … 19 22 import org.eclipse.jdt.core.IPackageFragmentRoot; 20 23 import org.eclipse.jdt.ui.wizards.NewTypeWizardPage; 21 import org.eclipse.jface.operation.IRunnableWithProgress;22 24 import org.eclipse.jface.viewers.IStructuredSelection; 23 25 import org.eclipse.swt.SWT; … … 28 30 import org.eclipse.swt.widgets.Button; 29 31 import org.eclipse.swt.widgets.Composite; 30 import org.eclipse.ui.PlatformUI;31 import org.eclipse.ui.ide.undo.CreateFileOperation;32 import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;33 32 import org.refal.rfpdt.core.RfpCore; 34 33 import org.refal.rfpdt.parser.RfpCharacter; 35 34 import org.refal.rfpdt.ui.RfpUI; 36 35 37 public class NewRfpModule Page extends NewTypeWizardPage {36 public class NewRfpModuleWizardPage extends NewTypeWizardPage { 38 37 private Button button; 39 38 private boolean buttonValue = false; 40 39 41 public NewRfpModule Page () {40 public NewRfpModuleWizardPage () { 42 41 super(false, "NewRfpModulePage"); 43 42 } … … 174 173 175 174 public IFile createModule () throws CoreException, InterruptedException { 176 finalIFile file = RfpCore.getRfpProject(getProject()).getSource(getPackageFragmentRoot().getPath(),175 IFile file = RfpCore.getRfpProject(getProject()).getSource(getPackageFragmentRoot().getPath(), 177 176 getPackageText() + '.' + getTypeName(), "rf"); 178 IRunnableWithProgress op = new IRunnableWithProgress() { 179 public void run (IProgressMonitor monitor) { 180 CreateFileOperation op = new CreateFileOperation(file, null, getInputStream(), "NewFile"); 181 try { 182 PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op, monitor, 183 WorkspaceUndoUtil.getUIInfoAdapter(getShell())); 184 } catch (ExecutionException e) { 185 RfpUI.log(e); 177 try { 178 // Create a new file resource in the workspace 179 IPath path = file.getFullPath(); 180 IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); 181 int numSegments = path.segmentCount(); 182 if (numSegments > 2 && !root.getFolder(path.removeLastSegments(1)).exists()) 183 // If the direct parent of the path doesn't exist, try to 184 // create the necessary directories. 185 for (int i = numSegments - 2; i > 0; i--) { 186 IFolder folder = root.getFolder(path.removeLastSegments(i)); 187 if (!folder.exists()) 188 folder.create(false, true, null); 186 189 } 190 file.create(getInputStream(), false, null); 191 } catch (CoreException e) { 192 // If the file already existed locally, just refresh to get contents 193 if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) 194 file.refreshLocal(IResource.DEPTH_ZERO, null); 195 else { 196 RfpUI.log(e); 197 return null; 187 198 } 188 };189 try {190 getContainer().run(true, true, op);191 } catch (InterruptedException e) {192 RfpUI.log(e);193 return null;194 } catch (InvocationTargetException e) {195 RfpUI.log(e);196 return null;197 199 } 198 200 return file; -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/wizards/RfpContainerWizardPage.java
r4052 r4055 1 package org.refal.rfpdt.ui. launching;1 package org.refal.rfpdt.ui.wizards; 2 2 3 3 import java.net.URL;
Note: See TracChangeset
for help on using the changeset viewer.