Changeset 4055 for devel-tools/trunk


Ignore:
Timestamp:
Jan 10, 2009, 5:48:24 PM (12 years ago)
Author:
yura
Message:
  • Eclipse 3.2 compatibility (second step).
  • No warnings in Mainfest.mf and plugin.xml.
  • Refactoring.
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  
    1515 org.refal.rfpdt.lib
    1616Eclipse-LazyStart: true
     17Bundle-ActivationPolicy: lazy
    1718Bundle-RequiredExecutionEnvironment: J2SE-1.5
    1819Bundle-ClassPath: .
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/META-INF/MANIFEST.MF

    r4035 r4055  
    2424 org.refal.rfpdt.core
    2525Eclipse-LazyStart: true
     26Bundle-ActivationPolicy: lazy
    2627Bundle-RequiredExecutionEnvironment: J2SE-1.5
    2728Bundle-ClassPath: .
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/plugin.xml

    r3870 r4055  
    5656      <key
    5757            commandId="org.refal.rfpdt.launch.shortcut.debug"
    58             contextId="org.eclipse.ui.globalScope"
    5958            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
    6059            sequence="M3+M2+D R"/>
    6160      <key
    6261            commandId="org.refal.rfpdt.launch.shortcut.run"
    63             contextId="org.eclipse.ui.globalScope"
    6462            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
    6563            sequence="M3+M2+X R"/>
     
    409407         point="org.eclipse.jdt.ui.classpathContainerPage">
    410408      <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"
    413411            name="Refal Plus Library">
    414412      </classpathContainerPage>
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/wizards/NewRfpModuleWizard.java

    r3818 r4055  
    1717    private IWorkbench workbench;
    1818    private IStructuredSelection selection;
    19     private NewRfpModulePage page;
     19    private NewRfpModuleWizardPage page;
    2020
    2121    public NewRfpModuleWizard () {
     
    2828    public void addPages () {
    2929        super.addPages();
    30         page = new NewRfpModulePage();
     30        page = new NewRfpModuleWizardPage();
    3131        page.setTitle("Refal Plus Module");
    3232        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  
    33import java.io.ByteArrayInputStream;
    44import java.io.InputStream;
    5 import java.lang.reflect.InvocationTargetException;
    6 
    7 import org.eclipse.core.commands.ExecutionException;
     5
    86import org.eclipse.core.resources.IFile;
     7import org.eclipse.core.resources.IFolder;
    98import org.eclipse.core.resources.IProject;
     9import org.eclipse.core.resources.IResource;
     10import org.eclipse.core.resources.IResourceStatus;
     11import org.eclipse.core.resources.IWorkspaceRoot;
    1012import org.eclipse.core.resources.ProjectScope;
     13import org.eclipse.core.resources.ResourcesPlugin;
    1114import org.eclipse.core.runtime.CoreException;
    12 import org.eclipse.core.runtime.IProgressMonitor;
     15import org.eclipse.core.runtime.IPath;
    1316import org.eclipse.core.runtime.IStatus;
    1417import org.eclipse.core.runtime.Platform;
     
    1922import org.eclipse.jdt.core.IPackageFragmentRoot;
    2023import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
    21 import org.eclipse.jface.operation.IRunnableWithProgress;
    2224import org.eclipse.jface.viewers.IStructuredSelection;
    2325import org.eclipse.swt.SWT;
     
    2830import org.eclipse.swt.widgets.Button;
    2931import 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;
    3332import org.refal.rfpdt.core.RfpCore;
    3433import org.refal.rfpdt.parser.RfpCharacter;
    3534import org.refal.rfpdt.ui.RfpUI;
    3635
    37 public class NewRfpModulePage extends NewTypeWizardPage {
     36public class NewRfpModuleWizardPage extends NewTypeWizardPage {
    3837    private Button button;
    3938    private boolean buttonValue = false;
    4039
    41     public NewRfpModulePage () {
     40    public NewRfpModuleWizardPage () {
    4241        super(false, "NewRfpModulePage");
    4342    }
     
    174173
    175174    public IFile createModule () throws CoreException, InterruptedException {
    176         final IFile file = RfpCore.getRfpProject(getProject()).getSource(getPackageFragmentRoot().getPath(),
     175        IFile file = RfpCore.getRfpProject(getProject()).getSource(getPackageFragmentRoot().getPath(),
    177176                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);
    186189                }
     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;
    187198            }
    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;
    197199        }
    198200        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;
     1package org.refal.rfpdt.ui.wizards;
    22
    33import java.net.URL;
Note: See TracChangeset for help on using the changeset viewer.