Пример #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 JavaScriptSupportGroup(Composite composite, WizardPage projectWizardFirstPage) {
      final int numColumns = 3;
      fGroup = new Group(composite, SWT.NONE);
      fGroup.setFont(composite.getFont());

      fGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      fGroup.setLayout(initGridLayout(new GridLayout(numColumns, false), true));
      fGroup.setText(PHPUIMessages.JavaScriptSupportGroup_OptionBlockTitle); // $NON-NLS-1$

      fEnableJavaScriptSupport = new Button(fGroup, SWT.CHECK | SWT.RIGHT);
      fEnableJavaScriptSupport.setText(
          PHPUIMessages.JavaScriptSupportGroup_EnableSupport); // $NON-NLS-1$
      fEnableJavaScriptSupport.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
      fEnableJavaScriptSupport.addSelectionListener(this);
      fEnableJavaScriptSupport.setSelection(
          PHPUiPlugin.getDefault()
              .getPreferenceStore()
              .getBoolean((PreferenceConstants.JavaScriptSupportEnable)));
    }
Пример #3
0
    public LayoutGroup(Composite composite) {
      final int numColumns = 3;

      fStdRadio = new SelectionButtonDialogField(SWT.RADIO);
      fStdRadio.setLabelText(PHPUIMessages.LayoutGroup_OptionBlock_ProjectSrc); // $NON-NLS-1$
      fStdRadio.setDialogFieldListener(this);

      fSrcBinRadio = new SelectionButtonDialogField(SWT.RADIO);
      fSrcBinRadio.setLabelText(PHPUIMessages.LayoutGroup_OptionBlock_SrcResources); // $NON-NLS-1$
      fSrcBinRadio.setDialogFieldListener(this);

      // getting Preferences default choice
      boolean useSrcBin =
          PreferenceConstants.getPreferenceStore()
              .getBoolean(PreferenceConstants.SRCBIN_FOLDERS_IN_NEWPROJ);

      fSrcBinRadio.setSelection(useSrcBin);
      fStdRadio.setSelection(!useSrcBin);

      // createContent
      fGroup = new Group(composite, SWT.NONE);
      fGroup.setFont(composite.getFont());
      fGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      fGroup.setLayout(initGridLayout(new GridLayout(numColumns, false), true));
      fGroup.setText(PHPUIMessages.LayoutGroup_OptionBlock_Title); // $NON-NLS-1$

      fStdRadio.doFillIntoGrid(fGroup, 3);
      LayoutUtil.setHorizontalGrabbing(fStdRadio.getSelectionButton(null));

      fSrcBinRadio.doFillIntoGrid(fGroup, 2);

      fPreferenceLink = new Link(fGroup, SWT.NONE);
      fPreferenceLink.setText(PHPUIMessages.ToggleLinkingAction_link_description); // $NON-NLS-1$
      fPreferenceLink.setLayoutData(new GridData(SWT.END, SWT.BEGINNING, true, false));
      fPreferenceLink.addSelectionListener(this);
      fPreferenceLink.setEnabled(true);

      updateEnableState();
    }