org.eclipse.pde.ds.ui_1.0.100.v20111213-1754

 if (value != null) {
            fDSImplementationClassText.setText(value);
          }
        }
        
        private String handleLinkActivated(String value, boolean isInter)
        {
          Object object = fSelection.getFirstElement();
          if (object != null)
          {
            IProject project = DSFileWizardPage.this.getProject(object);
            try
            {
              if (project != null) {
                if (project.hasNature("org.eclipse.jdt.core.javanature"))
                {
                  IJavaProject javaProject = 
                    JavaCore.create(project);
                  IJavaElement element = javaProject
                    .findType(value.replace('$', '.'));
                  if (element != null)
                  {
                    JavaUI.openInEditor(element);
                  }
                  else
                  {
                    DSNewClassCreationWizard wizard = new DSNewClassCreationWizard(
                      project, isInter, value);
                    WizardDialog dialog = new WizardDialog(
                    
                      Activator.getActiveWorkbenchShell(), 
                      wizard);
                    dialog.create();
                    SWTUtil.setDialogSize(dialog, 400, 500);
                    if (dialog.open() == 0) {
                      return wizard.getQualifiedName();
                    }
                  }
                }
              }
            }
            catch (PartInitException localPartInitException) {}catch (CoreException localCoreException) {}
          }
          return null;
        }
      });
    fDSImplementationClassText = new Text(fGroup, 2052);
    GridData classTextGridData = new GridData(768);
    horizontalSpan = 1;
    horizontalIndent = 3;
    fDSImplementationClassText.setLayoutData(classTextGridData);
    fDSImplementationClassText.setText("Component");
    fDSImplementationClassText.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e)
      {
        setPageComplete(isPageComplete());
      }
    });
    fDSImplementationClassButton = new Button(fGroup, 0);
    fDSImplementationClassButton.setText(Messages.DSFileWizardPage_browse);
    fDSImplementationClassButton.addMouseListener(new MouseListener()
    {
      public void mouseDoubleClick(MouseEvent e) {}
      
      public void mouseDown(MouseEvent e) {}
      
      public void mouseUp(MouseEvent e)
      {
        doOpenSelectionDialog(
          2, 
          fDSImplementationClassText);
      }
      
      private void doOpenSelectionDialog(int scopeType, Text entry)
      {
        try
        {
          String filter = entry.getText();
          filter = filter.substring(filter.lastIndexOf(".") + 1);
          SelectionDialog dialog = JavaUI.createTypeDialog(
            Activator.getActiveWorkbenchShell(), 
            PlatformUI.getWorkbench().getProgressService(), 
            SearchEngine.createWorkspaceScope(), scopeType, false, filter);
          dialog.setTitle(Messages.DSFileWizardPage_selectType);
          if (dialog.open() == 0)
          {
            IType type = (IType)dialog.getResult()[0];
            entry.setText(type.getFullyQualifiedName('$'));
          }
        }
        catch (CoreException e)
        {
          Activator.logException(e);
        }
      }
    });
  }
  
  public String getDSComponentNameValue()
  {
    return fDSComponentNameText.getText();
  }
  
  public String getDSImplementationClassValue()
  {
    return fDSImplementationClassText.getText();
  }
  
  protected IStatus validateLinkedResource()
  {
    return new Status(0, "org.eclipse.pde.ds.ui", 0, "", null);
  }
  
  protected void createLinkTarget() {}
  
  public void createControl(Composite parent)
  {
    super.createControl(parent);
    Dialog.applyDialogFont(fGroup);
  }
  
  public boolean isPageComplete()
  {
    return validatePage();
  }
  
  public void saveSettings(IDialogSettings settings)
  {
    settings.put("component", getFileName());
  }
  
  protected boolean validatePage()
  {
    if ((fDSComponentNameText == null) || (fDSImplementationClassText == null)) {
      return false;
    }
    if ((getFileName() == null) || (getFileName().length() == 0))
    {
      setErrorMessage(Messages.DSFileWizardPage_ComponentNeedsFileName);
      return false;
    }
    if (fDSComponentNameText.getText().trim().length() == 0)
    {
      setErrorMessage(Messages.DSFileWizardPage_ComponentNeedsName);
      return false;
    }
    IStatus status = ResourcesPlugin.getWorkspace().validateName(fDSImplementationClassText.getText().trim(), 1);
    if (!status.isOK())
    {
      setErrorMessage(Messages.DSFileWizardPage_ComponentNeedsClass);
      return false;
    }
    return super.validatePage();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ds.ui.wizards.DSFileWizardPage
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ds.ui.wizards;

import org.eclipse.core.resources.IProject;
import org.eclipse.pde.internal.ui.editor.schema.NewClassCreationWizard;

public class DSNewClassCreationWizard
  extends NewClassCreationWizard
{
  public DSNewClassCreationWizard(IProject project, boolean isInterface, String value)
  {
    super(project, isInterface, value);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ds.ui.wizards.DSNewClassCreationWizard
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ds.ui.wizards;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.pde.internal.ds.ui.Activator;
import org.eclipse.pde.internal.ds.ui.Messages;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

public class DSNewWizard
  extends Wizard
  implements INewWizard
{
  protected DSFileWizardPage fMainPage;
  
  public void addPages()
  {
    addPage(fMainPage);
  }
  
  public void init(IWorkbench workbench, IStructuredSelection currentSelection)
  {
    setWindowTitle(Messages.DSNewWizard_title);
    setDialogSettings(Activator.getDefault().getDialogSettings());
    fMainPage = new DSFileWizardPage(currentSelection);
  }
  
  public boolean performFinish()
  {
    try
    {
      IDialogSettings settings = getDialogSettings();
      if (settings != null) {
        fMainPage.saveSettings(settings);
      }
      IRunnableWithProgress op = new DSCreationOperation(fMainPage
        .createNewFile(), fMainPage.getDSComponentNameValue(), 
        fMainPage.getDSImplementationClassValue());
      
      getContainer().run(false, true, op);
    }
    catch (InvocationTargetException e)
    {
      Activator.logException(e, null, null);
      return false;
    }
    catch (InterruptedException localInterruptedException)
    {
      return false;
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ds.ui.wizards.DSNewWizard
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
1 2 3 4 5 6 7 8

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd