コード例 #1
0
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    final Composite composite = new Composite(parent, SWT.NULL);
    composite.setFont(parent.getFont());
    composite.setLayout(initGridLayout(new GridLayout(1, false), false));
    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    // create UI elements
    fNameGroup = new NameGroup(composite, fInitialName, getShell());
    fPHPLocationGroup = new LocationGroup(composite, fNameGroup, getShell());

    CompositeData data = new CompositeData();
    data.setParetnt(composite);
    data.setSettings(getDialogSettings());
    data.setObserver(fPHPLocationGroup);
    fragment =
        (WizardFragment)
            Platform.getAdapterManager()
                .loadAdapter(data, PHPProjectWizardFirstPage.class.getName());

    fVersionGroup = new VersionGroup(composite);
    fLayoutGroup = new LayoutGroup(composite);
    fJavaScriptSupportGroup = new JavaScriptSupportGroup(composite, this);

    fDetectGroup = new DetectGroup(composite, fPHPLocationGroup, fNameGroup);

    // establish connections
    fNameGroup.addObserver(fPHPLocationGroup);
    fDetectGroup.addObserver(fLayoutGroup);

    fPHPLocationGroup.addObserver(fDetectGroup);
    // initialize all elements
    fNameGroup.notifyObservers();
    // create and connect validator
    fPdtValidator = new Validator();

    fNameGroup.addObserver(fPdtValidator);
    fPHPLocationGroup.addObserver(fPdtValidator);

    setControl(composite);
    Dialog.applyDialogFont(composite);

    // set the focus to the project name
    fNameGroup.postSetFocus();

    setHelpContext(composite);
  }
コード例 #2
0
 public String getProjectName() {
   return fNameGroup.getName();
 }
コード例 #3
0
 /**
  * Creates a project resource handle for the current project name field value.
  *
  * <p>This method does not create the project resource; this is the responsibility of <code>
  * IProject::create</code> invoked by the new project resource wizard.
  *
  * @return the new project resource handle
  */
 public IProject getProjectHandle() {
   return ResourcesPlugin.getWorkspace().getRoot().getProject(fNameGroup.getName());
 }