org.eclipse.ui.ide.IDEEncoding#org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField源码实例Demo

下面列出了org.eclipse.ui.ide.IDEEncoding#org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * Creates a new <code>NewPackageWizardPage</code>
 */
public NewPackageWizardPage() {
	super(PAGE_NAME);

	setTitle(NewWizardMessages.NewPackageWizardPage_title);
	setDescription(NewWizardMessages.NewPackageWizardPage_description);

	fCreatedPackageFragment= null;

	PackageFieldAdapter adapter= new PackageFieldAdapter();

	fPackageDialogField= new StringDialogField();
	fPackageDialogField.setDialogFieldListener(adapter);
	fPackageDialogField.setLabelText(NewWizardMessages.NewPackageWizardPage_package_label);

	fCreatePackageInfoJavaDialogField= new SelectionButtonDialogField(SWT.CHECK);
	fCreatePackageInfoJavaDialogField.setDialogFieldListener(adapter);
	fCreatePackageInfoJavaDialogField.setLabelText(NewWizardMessages.NewPackageWizardPage_package_CreatePackageInfoJava);

	fPackageStatus= new StatusInfo();
}
 
/**
 * {@inheritDoc}
 */
public Control createControl(Composite parent, IPreferencePageContainer container) {
	Composite composite= new Composite(parent, SWT.NONE);
	GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true);
	composite.setLayoutData(gridData);
	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	composite.setLayout(layout);

	fEnableField= new SelectionButtonDialogField(SWT.CHECK);
	fEnableField.setLabelText(getPostSaveListenerName());
	fEnableField.doFillIntoGrid(composite, 1);

	createConfigControl(composite, container);

	return composite;
}
 
@Override
protected Control createContents(Composite parent) {
	if (!fIsValidElement) {
		return new Composite(parent, SWT.NONE);
	}
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());
	GridLayout topLayout= new GridLayout();
	topLayout.marginWidth= 0;
	topLayout.marginHeight= 0;
	composite.setLayout(topLayout);

	fIgnoreOptionalProblemsField= new SelectionButtonDialogField(SWT.CHECK);
	fIgnoreOptionalProblemsField.setLabelText(PreferencesMessages.JavaCompilerPropertyPage_ignore_optional_problems_label);
	fIgnoreOptionalProblemsField.setSelection(isIgnoringOptionalProblems());
	fIgnoreOptionalProblemsField.doFillIntoGrid(composite, 1);
	return composite;
}
 
public LibraryNameDialog(Shell parent, CPUserLibraryElement elementToEdit, List<CPUserLibraryElement> existingLibraries) {
	super(parent);
	if (elementToEdit == null) {
		setTitle(PreferencesMessages.UserLibraryPreferencePage_LibraryNameDialog_new_title);
	} else {
		setTitle(PreferencesMessages.UserLibraryPreferencePage_LibraryNameDialog_edit_title);
	}

	fElementToEdit= elementToEdit;
	fExistingLibraries= existingLibraries;

	fNameField= new StringDialogField();
	fNameField.setDialogFieldListener(this);
	fNameField.setLabelText(PreferencesMessages.UserLibraryPreferencePage_LibraryNameDialog_name_label);

	fIsSystemField= new SelectionButtonDialogField(SWT.CHECK);
	fIsSystemField.setLabelText(PreferencesMessages.UserLibraryPreferencePage_LibraryNameDialog_issystem_label);

	if (elementToEdit != null) {
		fNameField.setText(elementToEdit.getName());
		fIsSystemField.setSelection(elementToEdit.isSystemLibrary());
	} else {
		fNameField.setText(""); //$NON-NLS-1$
		fIsSystemField.setSelection(false);
	}
}
 
public NativeLibrariesConfigurationBlock(IStatusChangeListener listener, Shell parent, String nativeLibPath, IClasspathEntry parentEntry) {
	fListener= listener;
	fEntry= parentEntry;

	NativeLibrariesAdapter adapter= new NativeLibrariesAdapter();

	fPathField= new StringDialogField();
	fPathField.setLabelText(NewWizardMessages.NativeLibrariesDialog_location_label);
	fPathField.setDialogFieldListener(adapter);

	fBrowseWorkspace= new SelectionButtonDialogField(SWT.PUSH);
	fBrowseWorkspace.setLabelText(NewWizardMessages.NativeLibrariesDialog_workspace_browse);
	fBrowseWorkspace.setDialogFieldListener(adapter);

	fBrowseExternal= new SelectionButtonDialogField(SWT.PUSH);
	fBrowseExternal.setLabelText(NewWizardMessages.NativeLibrariesDialog_external_browse);
	fBrowseExternal.setDialogFieldListener(adapter);

	if (nativeLibPath != null) {
		fPathField.setText(Path.fromPortableString(nativeLibPath).toString());
		fOrginalValue= nativeLibPath;
	} else {
		fOrginalValue= ""; //$NON-NLS-1$
	}
}
 
public NewUiBinderWizardPage() {
  super("UiBinder", "Create a new UiBinder template and owner class.", true,
      "NewUiBinderWizardPage");

  uiTypeButtons = new SelectionButtonDialogFieldGroup(SWT.RADIO,
      new String[] {"GWT widge&ts", "&HTML"}, 4);
  uiTypeButtons.setLabelText("&Create UI based on:");
  uiTypeButtons.setSelection(0, true);

  addSampleContentButton = new SelectionButtonDialogField(SWT.CHECK);
  addSampleContentButton.setLabelText("Generate &sample content");
}
 
public LocationGroup() {
	fUseDefaults= new SelectionButtonDialogField(SWT.CHECK);
	fUseDefaults.setDialogFieldListener(this);
	fUseDefaults.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_location_desc);

	fLocation= new StringButtonDialogField(this);
	fLocation.setDialogFieldListener(this);
	fLocation.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_locationLabel_desc);
	fLocation.setButtonLabel(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_browseButton_desc);

	fUseDefaults.setSelection(true);

	fPreviousExternalLocation= ""; //$NON-NLS-1$
}
 
public LayoutGroup() {
	fStdRadio= new SelectionButtonDialogField(SWT.RADIO);
	fStdRadio.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_option_oneFolder);

	fSrcBinRadio= new SelectionButtonDialogField(SWT.RADIO);
	fSrcBinRadio.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_option_separateFolders);

	boolean useSrcBin= PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.SRCBIN_FOLDERS_IN_NEWPROJ);
	fSrcBinRadio.setSelection(useSrcBin);
	fStdRadio.setSelection(!useSrcBin);
}
 
public JREGroup() {
	fUseDefaultJRE= new SelectionButtonDialogField(SWT.RADIO);
	fUseDefaultJRE.setLabelText(getDefaultJVMLabel());

	fUseProjectJRE= new SelectionButtonDialogField(SWT.RADIO);
	fUseProjectJRE.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_specific_compliance);

	fJRECombo= new ComboDialogField(SWT.READ_ONLY);
	fillInstalledJREs(fJRECombo);
	fJRECombo.setDialogFieldListener(this);

	fUseEEJRE= new SelectionButtonDialogField(SWT.RADIO);
	fUseEEJRE.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_specific_EE);

	fEECombo= new ComboDialogField(SWT.READ_ONLY);
	fillExecutionEnvironments(fEECombo);
	fEECombo.setDialogFieldListener(this);

	switch (getLastSelectedJREKind()) {
		case DEFAULT_JRE:
			fUseDefaultJRE.setSelection(true);
			break;
		case PROJECT_JRE:
			fUseProjectJRE.setSelection(true);
			break;
		case EE_JRE:
			fUseEEJRE.setSelection(true);
			break;
	}

	fJRECombo.setEnabled(fUseProjectJRE.isSelected());
	fEECombo.setEnabled(fUseEEJRE.isSelected());

	fUseDefaultJRE.setDialogFieldListener(this);
	fUseProjectJRE.setDialogFieldListener(this);
	fUseEEJRE.setDialogFieldListener(this);
}
 
public SortMembersMessageDialog(Shell parentShell) {
	super(OPTIONAL_ID, parentShell, DialogsMessages.SortMembersMessageDialog_dialog_title, null, new String(), INFORMATION, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0);

	fDialogSettings= JavaPlugin.getDefault().getDialogSettings();

	boolean isSortAll= fDialogSettings.getBoolean(DIALOG_SETTINGS_SORT_ALL);

	fNotSortAllRadio= new SelectionButtonDialogField(SWT.RADIO);
	fNotSortAllRadio.setLabelText(DialogsMessages.SortMembersMessageDialog_do_not_sort_fields_label);
	fNotSortAllRadio.setSelection(!isSortAll);

	fSortAllRadio= new SelectionButtonDialogField(SWT.RADIO);
	fSortAllRadio.setLabelText(DialogsMessages.SortMembersMessageDialog_sort_all_label);
	fSortAllRadio.setSelection(isSortAll);
}
 
public TodoTaskConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
	super(context, project, getKeys(), container);

	TaskTagAdapter adapter=  new TaskTagAdapter();
	String[] buttons= new String[] {
		PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_add_button,
		PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_edit_button,
		PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_remove_button,
		null,
		PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_setdefault_button,
	};
	fTodoTasksList= new ListDialogField<TodoTask>(adapter, buttons, new TodoTaskLabelProvider());
	fTodoTasksList.setDialogFieldListener(adapter);
	fTodoTasksList.setRemoveButtonIndex(IDX_REMOVE);

	String[] columnsHeaders= new String[] {
		PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_name_column,
		PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_priority_column,
	};

	fTodoTasksList.setTableColumns(new ListDialogField.ColumnsDescription(columnsHeaders, true));
	fTodoTasksList.setViewerComparator(new TodoTaskSorter());


	fCaseSensitiveCheckBox= new SelectionButtonDialogField(SWT.CHECK);
	fCaseSensitiveCheckBox.setLabelText(PreferencesMessages.TodoTaskConfigurationBlock_casesensitive_label);
	fCaseSensitiveCheckBox.setDialogFieldListener(adapter);

	unpackTodoTasks();
	if (fTodoTasksList.getSize() > 0) {
		fTodoTasksList.selectFirstElement();
	} else {
		fTodoTasksList.enableButton(IDX_EDIT, false);
		fTodoTasksList.enableButton(IDX_DEFAULT, false);
	}

	fTaskTagsStatus= new StatusInfo();
}
 
public TypeFilterPreferencePage() {
	super();
	setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
	setDescription(PreferencesMessages.TypeFilterPreferencePage_description);

	String[] buttonLabels= new String[] {
		PreferencesMessages.TypeFilterPreferencePage_add_button,
		PreferencesMessages.TypeFilterPreferencePage_addpackage_button,
		PreferencesMessages.TypeFilterPreferencePage_edit_button,
		PreferencesMessages.TypeFilterPreferencePage_remove_button,
		/* 4 */  null,
		PreferencesMessages.TypeFilterPreferencePage_selectall_button,
		PreferencesMessages.TypeFilterPreferencePage_deselectall_button,
	};

	TypeFilterAdapter adapter= new TypeFilterAdapter();

	fFilterListField= new CheckedListDialogField<String>(adapter, buttonLabels, new LabelProvider());
	fFilterListField.setDialogFieldListener(adapter);
	fFilterListField.setLabelText(PreferencesMessages.TypeFilterPreferencePage_list_label);
	fFilterListField.setCheckAllButtonIndex(IDX_SELECT);
	fFilterListField.setUncheckAllButtonIndex(IDX_DESELECT);
	fFilterListField.setRemoveButtonIndex(IDX_REMOVE);

	fFilterListField.enableButton(IDX_EDIT, false);
	
	fHideForbiddenField= new SelectionButtonDialogField(SWT.CHECK);
	fHideForbiddenField.setLabelText(PreferencesMessages.TypeFilterPreferencePage_hideForbidden_label);
	
	fHideDiscouragedField= new SelectionButtonDialogField(SWT.CHECK);
	fHideDiscouragedField.setLabelText(PreferencesMessages.TypeFilterPreferencePage_hideDiscouraged_label);

	initialize(false);
}
 
public ImportOrganizeInputDialog(Shell parent, List<ImportOrderEntry> existingEntries, boolean isStatic) {
	super(parent);
	fIsStatic= isStatic;
	fExistingEntries= existingEntries;

	String label, title;
	if (isStatic) {
		title= PreferencesMessages.ImportOrganizeInputDialog_title_static;
		label= PreferencesMessages.ImportOrganizeInputDialog_name_group_static_label;
	} else {
		title= PreferencesMessages.ImportOrganizeInputDialog_title;
		label= PreferencesMessages.ImportOrganizeInputDialog_name_group_label;
	}
	setTitle(title);

	ImportOrganizeInputAdapter adapter= new ImportOrganizeInputAdapter();

	fNameDialogField= new StringButtonDialogField(adapter);
	fNameDialogField.setLabelText(label);
	fNameDialogField.setButtonLabel(PreferencesMessages.ImportOrganizeInputDialog_browse_packages_button);
	fNameDialogField.setDialogFieldListener(adapter);
	fNameDialogField.setText(""); //$NON-NLS-1$

	fBrowseTypeButton= new SelectionButtonDialogField(SWT.PUSH);
	fBrowseTypeButton.setLabelText(PreferencesMessages.ImportOrganizeInputDialog_browse_types_label);
	fBrowseTypeButton.setDialogFieldListener(adapter);
}
 
@Override
protected Control createContents(Composite parent) {
	// Create both the dialog lists
	Composite sortComposite= new Composite(parent, SWT.NONE);
	sortComposite.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	sortComposite.setLayout(layout);

	GridData gd= new GridData();
	gd.verticalAlignment= GridData.FILL;
	gd.horizontalAlignment= GridData.FILL_HORIZONTAL;
	sortComposite.setLayoutData(gd);

	createListDialogField(sortComposite, fSortOrderList);

	fUseVisibilitySortField= new SelectionButtonDialogField(SWT.CHECK);
	fUseVisibilitySortField.setDialogFieldListener(new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			fVisibilityOrderList.setEnabled(fUseVisibilitySortField.isSelected());
		}
	});
	fUseVisibilitySortField.setLabelText(PreferencesMessages.MembersOrderPreferencePage_usevisibilitysort_label);
	fUseVisibilitySortField.doFillIntoGrid(sortComposite, 2);
	fUseVisibilitySortField.setSelection(fUseVisibilitySort);

	createListDialogField(sortComposite, fVisibilityOrderList);
	fVisibilityOrderList.setEnabled(fUseVisibilitySortField.isSelected());

	Dialog.applyDialogFont(sortComposite);

	return sortComposite;
}
 
/**
 * {@inheritDoc}
 */
@Override
public Composite createContents(Composite parent) {
    Composite composite= super.createContents(parent);

    if (fCurrContext == null)
    	return composite;

    fShowCleanUpWizardDialogField= new SelectionButtonDialogField(SWT.CHECK);
	fShowCleanUpWizardDialogField.setLabelText(CleanUpMessages.CleanUpConfigurationBlock_ShowCleanUpWizard_checkBoxLabel);
    fShowCleanUpWizardDialogField.doFillIntoGrid(composite, 5);

    IEclipsePreferences node= fCurrContext.getNode(JavaUI.ID_PLUGIN);
	boolean showWizard;
	if (node.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null) {
		showWizard= node.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true);
	} else {
		showWizard= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true);
	}
	if (showWizard)
		fShowCleanUpWizardDialogField.setSelection(true);

    fShowCleanUpWizardDialogField.setDialogFieldListener(new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			doShowCleanUpWizard(fShowCleanUpWizardDialogField.isSelected());
           }
    });

	return composite;
}
 
public NewSourceFolderWizardPage() {
	super(PAGE_NAME);

	setTitle(NewWizardMessages.NewSourceFolderWizardPage_title);
	setDescription(NewWizardMessages.NewSourceFolderWizardPage_description);

	fWorkspaceRoot= ResourcesPlugin.getWorkspace().getRoot();

	RootFieldAdapter adapter= new RootFieldAdapter();

	fProjectField= new StringButtonDialogField(adapter);
	fProjectField.setDialogFieldListener(adapter);
	fProjectField.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_project_label);
	fProjectField.setButtonLabel(NewWizardMessages.NewSourceFolderWizardPage_project_button);

	fRootDialogField= new StringButtonDialogField(adapter);
	fRootDialogField.setDialogFieldListener(adapter);
	fRootDialogField.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_root_label);
	fRootDialogField.setButtonLabel(NewWizardMessages.NewSourceFolderWizardPage_root_button);

	fExcludeInOthersFields= new SelectionButtonDialogField(SWT.CHECK);
	fExcludeInOthersFields.setDialogFieldListener(adapter);
	fExcludeInOthersFields.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_exclude_label);
	fExcludeInOthersFields.setEnabled(JavaCore.ENABLED.equals(JavaCore.getOption(JavaCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS)));

	fIgnoreOptionalProblemsField= new SelectionButtonDialogField(SWT.CHECK);
	fIgnoreOptionalProblemsField.setDialogFieldListener(adapter);
	fIgnoreOptionalProblemsField.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_ignore_optional_problems_label);
	fIgnoreOptionalProblemsField.setSelection(false);

	fRootStatus= new StatusInfo();
	fProjectStatus= new StatusInfo();
}
 
public SourceContainerWorkbookPage(ListDialogField<CPListElement> classPathList, StringDialogField outputLocationField) {
	fClassPathList= classPathList;

	fOutputLocationField= outputLocationField;

	fSWTControl= null;

	SourceContainerAdapter adapter= new SourceContainerAdapter();

	String[] buttonLabels;

	buttonLabels= new String[] {
		NewWizardMessages.SourceContainerWorkbookPage_folders_add_button,
		NewWizardMessages.SourceContainerWorkbookPage_folders_link_source_button,
		/* 1 */ null,
		NewWizardMessages.SourceContainerWorkbookPage_folders_edit_button,
		NewWizardMessages.SourceContainerWorkbookPage_folders_remove_button
	};

	fFoldersList= new TreeListDialogField<CPListElement>(adapter, buttonLabels, new CPListLabelProvider());
	fFoldersList.setDialogFieldListener(adapter);
	fFoldersList.setLabelText(NewWizardMessages.SourceContainerWorkbookPage_folders_label);

	fFoldersList.setViewerComparator(new CPListElementSorter());
	fFoldersList.enableButton(IDX_EDIT, false);

	fUseFolderOutputs= new SelectionButtonDialogField(SWT.CHECK);
	fUseFolderOutputs.setSelection(false);
	fUseFolderOutputs.setLabelText(NewWizardMessages.SourceContainerWorkbookPage_folders_check);
	fUseFolderOutputs.setDialogFieldListener(adapter);
}
 
public OutputLocationDialog(Shell parent, CPListElement entryToEdit, List<CPListElement> classPathList, IPath defaultOutputFolder, boolean allowInvalidClasspath) {
	super(parent);
	fEntryToEdit= entryToEdit;
	fAllowInvalidClasspath= allowInvalidClasspath;
	setTitle(NewWizardMessages.OutputLocationDialog_title);
	fContainerFieldStatus= new StatusInfo();

	OutputLocationAdapter adapter= new OutputLocationAdapter();

	fUseDefault= new SelectionButtonDialogField(SWT.RADIO);
	fUseDefault.setLabelText(Messages.format(NewWizardMessages.OutputLocationDialog_usedefault_label, BasicElementLabels.getPathLabel(defaultOutputFolder, false)));
	fUseDefault.setDialogFieldListener(adapter);

	String label= Messages.format(NewWizardMessages.OutputLocationDialog_usespecific_label, BasicElementLabels.getResourceName(entryToEdit.getPath().segment(0)));
	fUseSpecific= new SelectionButtonDialogField(SWT.RADIO);
	fUseSpecific.setLabelText(label);
	fUseSpecific.setDialogFieldListener(adapter);

	fContainerDialogField= new StringButtonDialogField(adapter);
	fContainerDialogField.setButtonLabel(NewWizardMessages.OutputLocationDialog_location_button);
	fContainerDialogField.setDialogFieldListener(adapter);

	fUseSpecific.attachDialogField(fContainerDialogField);

	IJavaProject javaProject= entryToEdit.getJavaProject();
	fCurrProject= javaProject.getProject();
	fCPJavaProject= new CPJavaProject(javaProject, classPathList, defaultOutputFolder);

	IPath outputLocation= (IPath) entryToEdit.getAttribute(CPListElement.OUTPUT);
	if (outputLocation == null) {
		fUseDefault.setSelection(true);
	} else {
		fUseSpecific.setSelection(true);
		fContainerDialogField.setText(outputLocation.removeFirstSegments(1).makeRelative().toString());
	}
}
 
public VariableCreationDialog(Shell parent, CPVariableElement element, List<CPVariableElement> existingNames) {
	super(parent);
	if (element == null) {
		setTitle(NewWizardMessages.VariableCreationDialog_titlenew);
	} else {
		setTitle(NewWizardMessages.VariableCreationDialog_titleedit);
	}

	fDialogSettings= JavaPlugin.getDefault().getDialogSettings();

	fElement= element;

	fNameStatus= new StatusInfo();
	fPathStatus= new StatusInfo();

	NewVariableAdapter adapter= new NewVariableAdapter();
	fNameField= new StringDialogField();
	fNameField.setDialogFieldListener(adapter);
	fNameField.setLabelText(NewWizardMessages.VariableCreationDialog_name_label);

	fPathField= new StringButtonDialogField(adapter);
	fPathField.setDialogFieldListener(adapter);
	fPathField.setLabelText(NewWizardMessages.VariableCreationDialog_path_label);
	fPathField.setButtonLabel(NewWizardMessages.VariableCreationDialog_path_file_button);

	fDirButton= new SelectionButtonDialogField(SWT.PUSH);
	fDirButton.setDialogFieldListener(adapter);
	fDirButton.setLabelText(NewWizardMessages.VariableCreationDialog_path_dir_button);

	fExistingNames= existingNames;

	if (element != null) {
		fNameField.setText(element.getName());
		fPathField.setText(element.getPath().toString());
		fExistingNames.remove(element.getName());
	} else {
		fNameField.setText(""); //$NON-NLS-1$
		fPathField.setText(""); //$NON-NLS-1$
	}
}
 
/**
   * Constructor of the <code>NewSourceContainerWorkbookPage</code> which consists of
   * a tree representing the project, a toolbar with the available actions, an area
   * containing hyperlinks that perform the same actions as those in the toolbar but
   * additionally with some short description.
   *
   * @param classPathList
   * @param outputLocationField
   * @param context a runnable context, can be <code>null</code>
   * @param buildPathsBlock
   */
  public NewSourceContainerWorkbookPage(ListDialogField<CPListElement> classPathList, StringDialogField outputLocationField, IRunnableContext context, BuildPathsBlock buildPathsBlock) {
      fClassPathList= classPathList;
fOutputLocationField= outputLocationField;
fContext= context;
fBuildPathsBlock= buildPathsBlock;

      fUseFolderOutputs= new SelectionButtonDialogField(SWT.CHECK);
      fUseFolderOutputs.setSelection(false);
      fUseFolderOutputs.setLabelText(NewWizardMessages.SourceContainerWorkbookPage_folders_check);

fPackageExplorer= new DialogPackageExplorer();
fHintTextGroup= new HintTextGroup();
   }
 
public LinkFields() {
	fLinkLocation= new StringButtonDialogField(this);

	fLinkLocation.setLabelText(NewWizardMessages.LinkFolderDialog_dependenciesGroup_locationLabel_desc);
	fLinkLocation.setButtonLabel(NewWizardMessages.LinkFolderDialog_dependenciesGroup_browseButton_desc);
	fLinkLocation.setDialogFieldListener(this);			

	fVariables= new SelectionButtonDialogField(SWT.PUSH);
	fVariables.setLabelText(NewWizardMessages.LinkFolderDialog_dependenciesGroup_variables_desc);
	fVariables.setDialogFieldListener(new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			handleVariablesButtonPressed();
		}
	});
}
 
源代码22 项目: sarl   文件: MainProjectWizardPage.java
LocationGroup() {
	this.useDefaults = new SelectionButtonDialogField(SWT.CHECK);
	this.useDefaults.setDialogFieldListener(this);
	this.useDefaults.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_location_desc);

	this.location = new StringButtonDialogField(this);
	this.location.setDialogFieldListener(this);
	this.location.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_locationLabel_desc);
	this.location.setButtonLabel(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_browseButton_desc);

	this.useDefaults.setSelection(true);

	this.previousExternalLocation = ""; //$NON-NLS-1$
}
 
源代码23 项目: sarl   文件: MainProjectWizardPage.java
JREGroup() {
	this.useDefaultJRE = new SelectionButtonDialogField(SWT.RADIO);
	this.useDefaultJRE.setLabelText(getDefaultJVMLabel());

	this.useProjectJRE = new SelectionButtonDialogField(SWT.RADIO);
	this.useProjectJRE.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_specific_compliance);

	this.jreCombo = new ComboDialogField(SWT.READ_ONLY);
	fillInstalledJREs(this.jreCombo);
	this.jreCombo.setDialogFieldListener(this);

	this.useEEJRE = new SelectionButtonDialogField(SWT.RADIO);
	this.useEEJRE.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_specific_EE);

	this.eeCombo = new ComboDialogField(SWT.READ_ONLY);
	fillExecutionEnvironments(this.eeCombo);
	this.eeCombo.setDialogFieldListener(this);

	switch (getLastSelectedJREKind()) {
	case DEFAULT_JRE:
		this.useDefaultJRE.setSelection(true);
		break;
	case PROJECT_JRE:
		this.useProjectJRE.setSelection(true);
		break;
	case EE_JRE:
		this.useEEJRE.setSelection(true);
		break;
	default:
	}

	this.jreCombo.setEnabled(this.useProjectJRE.isSelected());
	this.eeCombo.setEnabled(this.useEEJRE.isSelected());

	this.useDefaultJRE.setDialogFieldListener(this);
	this.useProjectJRE.setDialogFieldListener(this);
	this.useEEJRE.setDialogFieldListener(this);
}
 
public NameConventionConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
	super(context, project, getAllKeys(), container);

	NameConventionAdapter adapter=  new NameConventionAdapter();
	String[] buttons= new String[] {
		PreferencesMessages.NameConventionConfigurationBlock_list_edit_button
	};
	fNameConventionList= new ListDialogField<NameConventionEntry>(adapter, buttons, new NameConventionLabelProvider()) {
		@Override
		protected int getListStyle() {
			return super.getListStyle() & ~SWT.MULTI | SWT.SINGLE;
		}

	};
	fNameConventionList.setDialogFieldListener(adapter);
	fNameConventionList.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_list_label);

	String[] columnsHeaders= new String[] {
		PreferencesMessages.NameConventionConfigurationBlock_list_name_column,
		PreferencesMessages.NameConventionConfigurationBlock_list_prefix_column,
		PreferencesMessages.NameConventionConfigurationBlock_list_suffix_column,
	};
	ColumnLayoutData[] data= new ColumnLayoutData[] {
		new ColumnWeightData(3),
		new ColumnWeightData(2),
		new ColumnWeightData(2)
	};

	fNameConventionList.setTableColumns(new ListDialogField.ColumnsDescription(data, columnsHeaders, true));

	if (fNameConventionList.getSize() > 0) {
		fNameConventionList.selectFirstElement();
	} else {
		fNameConventionList.enableButton(0, false);
	}

	fExceptionName= new StringDialogField();
	fExceptionName.setDialogFieldListener(adapter);
	fExceptionName.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_exceptionname_label);

	fUseKeywordThisBox= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
	fUseKeywordThisBox.setDialogFieldListener(adapter);
	fUseKeywordThisBox.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_keywordthis_label);

	fUseIsForBooleanGettersBox= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
	fUseIsForBooleanGettersBox.setDialogFieldListener(adapter);
	fUseIsForBooleanGettersBox.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_isforbooleangetters_label);

	fUseOverrideAnnotation= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
	fUseOverrideAnnotation.setDialogFieldListener(adapter);
	fUseOverrideAnnotation.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_use_override_annotation_label);

	updateControls();
}
 
public JavadocConfigurationBlock(Shell shell,  IStatusChangeListener context, URL initURL, boolean forSource) {
	fShell= shell;
	fContext= context;
	fInitialURL= initURL;
	fIsForSource= forSource;

	JDocConfigurationAdapter adapter= new JDocConfigurationAdapter();

	if (!forSource) {
		fURLRadioButton= new SelectionButtonDialogField(SWT.RADIO);
		fURLRadioButton.setDialogFieldListener(adapter);
		fURLRadioButton.setLabelText(PreferencesMessages.JavadocConfigurationBlock_location_type_path_label);
	}

	fURLField= new StringDialogField();
	fURLField.setDialogFieldListener(adapter);
	fURLField.setLabelText(PreferencesMessages.JavadocConfigurationBlock_location_path_label);

	fBrowseFolder= new SelectionButtonDialogField(SWT.PUSH);
	fBrowseFolder.setDialogFieldListener(adapter);
	fBrowseFolder.setLabelText(PreferencesMessages.JavadocConfigurationBlock_browse_folder_button);

	fValidateURLButton= new SelectionButtonDialogField(SWT.PUSH);
	fValidateURLButton.setDialogFieldListener(adapter);
	fValidateURLButton.setLabelText(PreferencesMessages.JavadocConfigurationBlock_validate_button);

	if (!forSource) {
		fArchiveRadioButton= new SelectionButtonDialogField(SWT.RADIO);
		fArchiveRadioButton.setDialogFieldListener(adapter);
		fArchiveRadioButton.setLabelText(PreferencesMessages.JavadocConfigurationBlock_location_type_jar_label);

		fExternalRadio= new SelectionButtonDialogField(SWT.RADIO);
		fExternalRadio.setDialogFieldListener(adapter);
		fExternalRadio.setLabelText(PreferencesMessages.JavadocConfigurationBlock_external_radio);

		fWorkspaceRadio= new SelectionButtonDialogField(SWT.RADIO);
		fWorkspaceRadio.setDialogFieldListener(adapter);
		fWorkspaceRadio.setLabelText(PreferencesMessages.JavadocConfigurationBlock_workspace_radio);

		fArchiveField= new StringDialogField();
		fArchiveField.setDialogFieldListener(adapter);
		fArchiveField.setLabelText(PreferencesMessages.JavadocConfigurationBlock_location_jar_label);

		fBrowseArchive= new SelectionButtonDialogField(SWT.PUSH);
		fBrowseArchive.setDialogFieldListener(adapter);
		fBrowseArchive.setLabelText(PreferencesMessages.JavadocConfigurationBlock_browse_archive_button);

		fArchivePathField= new StringDialogField();
		fArchivePathField.setDialogFieldListener(adapter);
		fArchivePathField.setLabelText(PreferencesMessages.JavadocConfigurationBlock_jar_path_label);

		fBrowseArchivePath= new SelectionButtonDialogField(SWT.PUSH);
		fBrowseArchivePath.setDialogFieldListener(adapter);
		fBrowseArchivePath.setLabelText(PreferencesMessages.JavadocConfigurationBlock_browse_archive_path_button);

		fValidateArchiveButton= new SelectionButtonDialogField(SWT.PUSH);
		fValidateArchiveButton.setDialogFieldListener(adapter);
		fValidateArchiveButton.setLabelText(PreferencesMessages.JavadocConfigurationBlock_validate_button);
	}

	fURLStatus= new StatusInfo();
	fArchiveStatus= new StatusInfo();
	fArchivePathStatus= new StatusInfo();

	initializeSelections();
}
 
@Override
protected Label createDescriptionLabel(Composite parent) {
	fParentComposite= parent;
	if (isProjectPreferencePage()) {
		Composite composite= new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout= new GridLayout();
		layout.marginHeight= 0;
		layout.marginWidth= 0;
		layout.numColumns= 2;
		composite.setLayout(layout);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		IDialogFieldListener listener= new IDialogFieldListener() {
			public void dialogFieldChanged(DialogField field) {
				boolean enabled= ((SelectionButtonDialogField) field).isSelected();
				enableProjectSpecificSettings(enabled);

				if (enabled && getData() != null) {
					applyData(getData());
				}
			}
		};

		fUseProjectSettings= new SelectionButtonDialogField(SWT.CHECK);
		fUseProjectSettings.setDialogFieldListener(listener);
		fUseProjectSettings.setLabelText(PreferencesMessages.PropertyAndPreferencePage_useprojectsettings_label);
		fUseProjectSettings.doFillIntoGrid(composite, 1);
		LayoutUtil.setHorizontalGrabbing(fUseProjectSettings.getSelectionButton(null));

		if (offerLink()) {
			fChangeWorkspaceSettings= createLink(composite, PreferencesMessages.PropertyAndPreferencePage_useworkspacesettings_change);
			fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
		} else {
			LayoutUtil.setHorizontalSpan(fUseProjectSettings.getSelectionButton(null), 2);
		}

		Label horizontalLine= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
		horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
		horizontalLine.setFont(composite.getFont());
	} else if (supportsProjectSpecificOptions() && offerLink()) {
		fChangeWorkspaceSettings= createLink(parent, PreferencesMessages.PropertyAndPreferencePage_showprojectspecificsettings_label);
		fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
	}

	return super.createDescriptionLabel(parent);
   }
 
public ImportOrganizeConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
	super(context, project, getAllKeys(), container);

	String[] buttonLabels= new String[] {
		PreferencesMessages.ImportOrganizeConfigurationBlock_order_add_button,
		PreferencesMessages.ImportOrganizeConfigurationBlock_order_add_static_button,
		PreferencesMessages.ImportOrganizeConfigurationBlock_order_edit_button,
		PreferencesMessages.ImportOrganizeConfigurationBlock_order_remove_button,
		/* 4 */  null,
		PreferencesMessages.ImportOrganizeConfigurationBlock_order_up_button,
		PreferencesMessages.ImportOrganizeConfigurationBlock_order_down_button,
	};

	ImportOrganizeAdapter adapter= new ImportOrganizeAdapter();

	fOrderListField= new ListDialogField<ImportOrderEntry>(adapter, buttonLabels, new ImportOrganizeLabelProvider());
	fOrderListField.setDialogFieldListener(adapter);
	fOrderListField.setLabelText(PreferencesMessages.ImportOrganizeConfigurationBlock_order_label);
	fOrderListField.setUpButtonIndex(IDX_UP);
	fOrderListField.setDownButtonIndex(IDX_DOWN);
	fOrderListField.setRemoveButtonIndex(IDX_REMOVE);

	fOrderListField.enableButton(IDX_EDIT, false);

	fImportButton= new SelectionButtonDialogField(SWT.PUSH);
	fImportButton.setDialogFieldListener(adapter);
	fImportButton.setLabelText(PreferencesMessages.ImportOrganizeConfigurationBlock_order_load_button);

	fExportButton= new SelectionButtonDialogField(SWT.PUSH);
	fExportButton.setDialogFieldListener(adapter);
	fExportButton.setLabelText(PreferencesMessages.ImportOrganizeConfigurationBlock_order_save_button);

	fThresholdField= new StringDialogField();
	fThresholdField.setDialogFieldListener(adapter);
	fThresholdField.setLabelText(PreferencesMessages.ImportOrganizeConfigurationBlock_threshold_label);

	fStaticThresholdField= new StringDialogField();
	fStaticThresholdField.setDialogFieldListener(adapter);
	fStaticThresholdField.setLabelText(PreferencesMessages.ImportOrganizeConfigurationBlock_staticthreshold_label);

	fIgnoreLowerCaseTypesField= new SelectionButtonDialogField(SWT.CHECK);
	fIgnoreLowerCaseTypesField.setDialogFieldListener(adapter);
	fIgnoreLowerCaseTypesField.setLabelText(PreferencesMessages.ImportOrganizeConfigurationBlock_ignoreLowerCase_label);

	updateControls();
}
 
public AppearancePreferencePage() {
	setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
	setDescription(PreferencesMessages.AppearancePreferencePage_description);

	IDialogFieldListener listener= new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			doDialogFieldChanged(field);
		}
	};

	fShowMethodReturnType= new SelectionButtonDialogField(SWT.CHECK);
	fShowMethodReturnType.setDialogFieldListener(listener);
	fShowMethodReturnType.setLabelText(PreferencesMessages.AppearancePreferencePage_methodreturntype_label);

	fShowMethodTypeParameters= new SelectionButtonDialogField(SWT.CHECK);
	fShowMethodTypeParameters.setDialogFieldListener(listener);
	fShowMethodTypeParameters.setLabelText(PreferencesMessages.AppearancePreferencePage_methodtypeparams_label);

	fShowCategory= new SelectionButtonDialogField(SWT.CHECK);
	fShowCategory.setDialogFieldListener(listener);
	fShowCategory.setLabelText(PreferencesMessages.AppearancePreferencePage_showCategory_label);

	fShowMembersInPackageView= new SelectionButtonDialogField(SWT.CHECK);
	fShowMembersInPackageView.setDialogFieldListener(listener);
	fShowMembersInPackageView.setLabelText(PreferencesMessages.AppearancePreferencePage_showMembersInPackagesView);

	fStackBrowsingViewsVertically= new SelectionButtonDialogField(SWT.CHECK);
	fStackBrowsingViewsVertically.setDialogFieldListener(listener);
	fStackBrowsingViewsVertically.setLabelText(PreferencesMessages.AppearancePreferencePage_stackViewsVerticallyInTheJavaBrowsingPerspective);

	fFoldPackagesInPackageExplorer= new SelectionButtonDialogField(SWT.CHECK);
	fFoldPackagesInPackageExplorer.setDialogFieldListener(listener);
	fFoldPackagesInPackageExplorer.setLabelText(PreferencesMessages.AppearancePreferencePage_foldEmptyPackages);

	fCompressPackageNames= new SelectionButtonDialogField(SWT.CHECK);
	fCompressPackageNames.setDialogFieldListener(listener);
	fCompressPackageNames.setLabelText(PreferencesMessages.AppearancePreferencePage_pkgNamePatternEnable_label);

	fPackageNamePattern= new StringDialogField();
	fPackageNamePattern.setDialogFieldListener(listener);
	fPackageNamePattern.setLabelText(PreferencesMessages.AppearancePreferencePage_pkgNamePattern_label);

	fAbbreviatePackageNames= new SelectionButtonDialogField(SWT.CHECK);
	fAbbreviatePackageNames.setDialogFieldListener(listener);
	fAbbreviatePackageNames.setLabelText(PreferencesMessages.AppearancePreferencePage_pkgNamePatternAbbreviateEnable_label);
	
	fAbbreviatePackageNamePattern= new TextBoxDialogField();
	fAbbreviatePackageNamePattern.setDialogFieldListener(listener);
	fAbbreviatePackageNamePattern.setLabelText(PreferencesMessages.AppearancePreferencePage_pkgNamePatternAbbreviate_label);
}
 
public CodeTemplateBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
	super(context, project, getAllKeys(), container);

	fTemplateStore= new ProjectTemplateStore(project);
	try {
		fTemplateStore.load();
	} catch (IOException e) {
		JavaPlugin.log(e);
	}

	fTemplateProcessor= new TemplateVariableProcessor();

	CodeTemplateAdapter adapter= new CodeTemplateAdapter();

	String[] buttonLabels= new String[] {
		PreferencesMessages.CodeTemplateBlock_templates_edit_button,
		/* */ null,
		PreferencesMessages.CodeTemplateBlock_templates_import_button,
		PreferencesMessages.CodeTemplateBlock_templates_export_button,
		PreferencesMessages.CodeTemplateBlock_templates_exportall_button

	};
	fCodeTemplateTree= new TreeListDialogField<String>(adapter, buttonLabels, new CodeTemplateLabelProvider());
	fCodeTemplateTree.setDialogFieldListener(adapter);
	fCodeTemplateTree.setLabelText(PreferencesMessages.CodeTemplateBlock_templates_label);
	fCodeTemplateTree.setViewerComparator(adapter);

	fCodeTemplateTree.enableButton(IDX_EXPORT, false);
	fCodeTemplateTree.enableButton(IDX_EDIT, false);

	fCodeTemplateTree.addElement(COMMENT_NODE);
	fCodeTemplateTree.addElement(CODE_NODE);

	fCodeTemplateTree.selectFirstElement();

	fGenerateComments= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
	fGenerateComments.setDialogFieldListener(adapter);
	fGenerateComments.setLabelText(PreferencesMessages.CodeTemplateBlock_createcomment_label);

	updateControls();
}
 
public NewVariableEntryDialog(Shell parent) {
	super(parent);
	setTitle(NewWizardMessages.NewVariableEntryDialog_title);

	updateStatus(new StatusInfo(IStatus.ERROR, "")); //$NON-NLS-1$

	String[] buttonLabels= new String[] {
		NewWizardMessages.NewVariableEntryDialog_vars_extend,
	};

	VariablesAdapter adapter= new VariablesAdapter();

	CPVariableElementLabelProvider labelProvider= new CPVariableElementLabelProvider(false);

	fVariablesList= new ListDialogField<CPVariableElement>(adapter, buttonLabels, labelProvider);
	fVariablesList.setDialogFieldListener(adapter);
	fVariablesList.setLabelText(NewWizardMessages.NewVariableEntryDialog_vars_label);

	fVariablesList.enableButton(IDX_EXTEND, false);

	fVariablesList.setViewerComparator(new ViewerComparator() {
		@Override
		public int compare(Viewer viewer, Object e1, Object e2) {
			if (e1 instanceof CPVariableElement && e2 instanceof CPVariableElement) {
				return getComparator().compare(((CPVariableElement)e1).getName(), ((CPVariableElement)e2).getName());
			}
			return super.compare(viewer, e1, e2);
		}
	});


	fConfigButton= new SelectionButtonDialogField(SWT.PUSH);
	fConfigButton.setLabelText(NewWizardMessages.NewVariableEntryDialog_configbutton_label);
	fConfigButton.setDialogFieldListener(adapter);

	initializeElements();

	fCanExtend= false;
	fIsValidSelection= false;
	fResultPaths= null;

	fVariablesList.selectFirstElement();
}