Java Code Examples for org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField#setDialogFieldListener()

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField#setDialogFieldListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NewPackageWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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();
}
 
Example 2
Source File: HistoryListAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createMaxEntriesField() {
	fMaxEntriesField= new StringDialogField();
	fMaxEntriesField.setLabelText(fHistory.getMaxEntriesMessage());
	fMaxEntriesField.setDialogFieldListener(new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			String maxString= fMaxEntriesField.getText();
			boolean valid;
			try {
				fMaxEntries= Integer.parseInt(maxString);
				valid= fMaxEntries > 0 && fMaxEntries < MAX_MAX_ENTRIES;
			} catch (NumberFormatException e) {
				valid= false;
			}
			if (valid)
				updateStatus(StatusInfo.OK_STATUS);
			else
				updateStatus(new StatusInfo(IStatus.ERROR, Messages.format(JavaUIMessages.HistoryListAction_max_entries_constraint, Integer.toString(MAX_MAX_ENTRIES))));
		}
	});
	fMaxEntriesField.setText(Integer.toString(fHistory.getMaxEntries()));
}
 
Example 3
Source File: ClasspathContainerDefaultPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Constructor for ClasspathContainerDefaultPage.
 */
public ClasspathContainerDefaultPage() {
	super("ClasspathContainerDefaultPage"); //$NON-NLS-1$
	setTitle(NewWizardMessages.ClasspathContainerDefaultPage_title);
	setDescription(NewWizardMessages.ClasspathContainerDefaultPage_description);
	setImageDescriptor(JavaPluginImages.DESC_WIZBAN_ADD_LIBRARY);

	fUsedPaths= new ArrayList<IPath>();

	fEntryField= new StringDialogField();
	fEntryField.setLabelText(NewWizardMessages.ClasspathContainerDefaultPage_path_label);
	fEntryField.setDialogFieldListener(new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			validatePath();
		}
	});
	validatePath();
}
 
Example 4
Source File: NameConventionConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public NameConventionInputDialog(Shell parent, String title, String message, NameConventionEntry entry) {
	super(parent);
	fEntry= entry;

	setTitle(title);

	fMessageField= new DialogField();
	fMessageField.setLabelText(message);

	fPrefixField= new StringDialogField();
	fPrefixField.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_dialog_prefix);
	fPrefixField.setDialogFieldListener(this);

	fSuffixField= new StringDialogField();
	fSuffixField.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_dialog_suffix);
	fSuffixField.setDialogFieldListener(this);

	fPrefixField.setText(entry.prefix);
	fSuffixField.setText(entry.suffix);
}
 
Example 5
Source File: NewContainerDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public NewContainerDialog(Shell parent, String title, IProject project, IPath[] existingFolders, CPListElement entryToEdit) {
	super(parent);
	setTitle(title);

	fContainerFieldStatus= new StatusInfo();

	SourceContainerAdapter adapter= new SourceContainerAdapter();
	fContainerDialogField= new StringDialogField();
	fContainerDialogField.setDialogFieldListener(adapter);

	fFolder= null;
	fExistingFolders= existingFolders;
	fCurrProject= project;

	if (entryToEdit == null) {
		fContainerDialogField.setText(""); //$NON-NLS-1$
	} else {
		fContainerDialogField.setText(entryToEdit.getPath().removeFirstSegments(1).toString());
	}
}
 
Example 6
Source File: NativeLibrariesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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$
	}
}
 
Example 7
Source File: UserLibraryPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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);
	}
}
 
Example 8
Source File: NewHostPageWizardPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
protected NewHostPageWizardPage() {
  super("newHostPage");
  setTitle("HTML page");
  setDescription("Create a new HTML page.");

  ProjectFieldAdapter projectAdapter = new ProjectFieldAdapter();
  projectField = new StringButtonDialogField(projectAdapter);
  projectField.setDialogFieldListener(projectAdapter);
  projectField.setLabelText("Project:");
  projectField.setButtonLabel("Browse...");

  PathFieldAdapter publicPathAdapter = new PathFieldAdapter();
  pathField = new StringButtonDialogField(publicPathAdapter);
  pathField.setDialogFieldListener(publicPathAdapter);
  pathField.setLabelText("Path:");
  pathField.setButtonLabel("Browse...");

  fileNameField = new StringDialogField();
  fileNameField.setDialogFieldListener(new HostPageFieldAdapter());
  fileNameField.setLabelText("File name:");

  modulesBlock = new EntryPointModulesSelectionBlock("Modules:",
      new HostPageFieldAdapter());

  String[] buttonNames = new String[] {"Support for browser history (Back, Forward, bookmarks)"};
  hostPageElementsButtons = new SelectionButtonDialogFieldGroup(SWT.CHECK,
      buttonNames, 1);
  hostPageElementsButtons.setLabelText("Which elements do you want to include in your page?");
}
 
Example 9
Source File: RenameTypeWizardSimilarElementsPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public EditElementDialog(Shell parent, IJavaElement elementToEdit, String newName) {
	super(parent);
	setTitle(RefactoringMessages.RenameTypeWizardSimilarElementsPage_change_element_name);
	fElementToEdit= elementToEdit;

	fNameField= new StringDialogField();
	fNameField.setDialogFieldListener(this);
	fNameField.setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsPage_enter_new_name);

	fNameField.setText(newName);
}
 
Example 10
Source File: ExternalizeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public NLSInputDialog(Shell parent, NLSSubstitution substitution) {
	super(parent);

	setTitle(NLSUIMessages.ExternalizeWizardPage_NLSInputDialog_Title);

	fSubstitution= substitution;

	fMessageField= new DialogField();
	if (substitution.getState() == NLSSubstitution.EXTERNALIZED) {
		fMessageField.setLabelText(NLSUIMessages.ExternalizeWizardPage_NLSInputDialog_ext_Label);
	} else {
		fMessageField.setLabelText(NLSUIMessages.ExternalizeWizardPage_NLSInputDialog_Label);
	}

	fKeyField= new StringDialogField();
	fKeyField.setLabelText(NLSUIMessages.ExternalizeWizardPage_NLSInputDialog_Enter_key);
	fKeyField.setDialogFieldListener(this);

	fValueField= new StringDialogField();
	fValueField.setLabelText(NLSUIMessages.ExternalizeWizardPage_NLSInputDialog_Enter_value);
	fValueField.setDialogFieldListener(this);

	if (substitution.getState() == NLSSubstitution.EXTERNALIZED) {
		fKeyField.setText(substitution.getKeyWithoutPrefix());
	} else {
		fKeyField.setText(""); //$NON-NLS-1$
	}

	fValueField.setText(substitution.getValueNonEmpty());
}
 
Example 11
Source File: NewModuleWizardPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
public NewModuleWizardPage() {
  super("newModuleWizardPage");
  setTitle("New GWT Module");
  setDescription("Create a new GWT Module.");

  ModuleDialogFieldAdapter adapter = new ModuleDialogFieldAdapter();

  modulePackageField = new StringButtonStatusDialogField(adapter);
  modulePackageField.setDialogFieldListener(adapter);
  modulePackageField.setLabelText("Package:");
  modulePackageField.setButtonLabel(NewWizardMessages.NewTypeWizardPage_package_button);
  modulePackageField.setStatusWidthHint(NewWizardMessages.NewTypeWizardPage_default);

  modulePackageCompletionProcessor = new JavaPackageCompletionProcessor();

  moduleNameField = new StringDialogField();
  moduleNameField.setDialogFieldListener(adapter);
  moduleNameField.setLabelText("Module name:");

  String[] addButtons = new String[] {
      NewWizardMessages.NewTypeWizardPage_interfaces_add,
      /* 1 */null, NewWizardMessages.NewTypeWizardPage_interfaces_remove};
  moduleInheritsDialogField =
      new ListDialogField<IModule>(adapter, addButtons,
      new ModuleSelectionLabelProvider());
  moduleInheritsDialogField.setDialogFieldListener(adapter);
  moduleInheritsDialogField.setTableColumns(new ListDialogField.ColumnsDescription(
      1, false));
  moduleInheritsDialogField.setLabelText("Inherited modules:");
  moduleInheritsDialogField.setRemoveButtonIndex(REMOVE_INHERITS_BUTTON_GROUP_INDEX);

  String[] buttonNames = new String[] {
      "Create public resource path", "Create package for client source"};
  moduleCreateElementsCheckboxes = new SelectionButtonDialogFieldGroup(
      SWT.CHECK, buttonNames, 1);

  moduleContainerStatus = new StatusInfo();
  modulePackageStatus = new StatusInfo();
  moduleNameStatus = new StatusInfo();
}
 
Example 12
Source File: VariableCreationDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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$
	}
}
 
Example 13
Source File: AccessRuleEntryDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public AccessRuleEntryDialog(Shell parent, IAccessRule ruleToEdit, CPListElement entryToEdit) {
	super(parent);

	String title, message;
	if (ruleToEdit == null) {
		title= NewWizardMessages.TypeRestrictionEntryDialog_add_title;
	} else {
		title= NewWizardMessages.TypeRestrictionEntryDialog_edit_title;
	}
	message= Messages.format(NewWizardMessages.TypeRestrictionEntryDialog_pattern_label, BasicElementLabels.getPathLabel(entryToEdit.getPath(), false));
	setTitle(title);

	fPatternStatus= new StatusInfo();

	TypeRulesAdapter adapter= new TypeRulesAdapter();
	fPatternDialog= new StringDialogField();
	fPatternDialog.setLabelText(message);
	fPatternDialog.setDialogFieldListener(adapter);

	fRuleKindCombo= new ComboDialogField(SWT.READ_ONLY);
	fRuleKindCombo.setLabelText(NewWizardMessages.TypeRestrictionEntryDialog_kind_label);
	fRuleKindCombo.setDialogFieldListener(adapter);
	String[] items= {
			NewWizardMessages.TypeRestrictionEntryDialog_kind_non_accessible,
			NewWizardMessages.TypeRestrictionEntryDialog_kind_discourraged,
			NewWizardMessages.TypeRestrictionEntryDialog_kind_accessible
	};
	fRuleKinds= new int[] {
			IAccessRule.K_NON_ACCESSIBLE,
			IAccessRule.K_DISCOURAGED,
			IAccessRule.K_ACCESSIBLE
	};
	fRuleKindCombo.setItems(items);


	if (ruleToEdit == null) {
		fPatternDialog.setText(""); //$NON-NLS-1$
		fRuleKindCombo.selectItem(0);
	} else {
		fPatternDialog.setText(ruleToEdit.getPattern().toString());
		for (int i= 0; i < fRuleKinds.length; i++) {
			if (fRuleKinds[i] == ruleToEdit.getKind()) {
				fRuleKindCombo.selectItem(i);
				break;
			}
		}
	}
}
 
Example 14
Source File: AppearancePreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
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);
}
 
Example 15
Source File: ImportOrganizeConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
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();
}
 
Example 16
Source File: JavadocConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
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();
}
 
Example 17
Source File: NameConventionConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
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();
}
 
Example 18
Source File: TodoTaskInputDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public TodoTaskInputDialog(Shell parent, TodoTask task, List<TodoTask> existingEntries) {
	super(parent);

	fExistingNames= new ArrayList<String>(existingEntries.size());
	for (int i= 0; i < existingEntries.size(); i++) {
		TodoTask curr= existingEntries.get(i);
		if (!curr.equals(task)) {
			fExistingNames.add(curr.name);
		}
	}

	if (task == null) {
		setTitle(PreferencesMessages.TodoTaskInputDialog_new_title);
	} else {
		setTitle(PreferencesMessages.TodoTaskInputDialog_edit_title);
	}

	CompilerTodoTaskInputAdapter adapter= new CompilerTodoTaskInputAdapter();

	fNameDialogField= new StringDialogField();
	fNameDialogField.setLabelText(PreferencesMessages.TodoTaskInputDialog_name_label);
	fNameDialogField.setDialogFieldListener(adapter);

	fNameDialogField.setText((task != null) ? task.name : ""); //$NON-NLS-1$

	String[] items= new String[] {
		PreferencesMessages.TodoTaskInputDialog_priority_high,
		PreferencesMessages.TodoTaskInputDialog_priority_normal,
		PreferencesMessages.TodoTaskInputDialog_priority_low
	};

	fPriorityDialogField= new ComboDialogField(SWT.READ_ONLY);
	fPriorityDialogField.setLabelText(PreferencesMessages.TodoTaskInputDialog_priority_label);
	fPriorityDialogField.setItems(items);
	if (task != null) {
		if (JavaCore.COMPILER_TASK_PRIORITY_HIGH.equals(task.priority)) {
			fPriorityDialogField.selectItem(0);
		} else if (JavaCore.COMPILER_TASK_PRIORITY_NORMAL.equals(task.priority)) {
			fPriorityDialogField.selectItem(1);
		} else {
			fPriorityDialogField.selectItem(2);
		}
	} else {
		fPriorityDialogField.selectItem(1);
	}
}
 
Example 19
Source File: NewJavaProjectWizardPageOne.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public NameGroup() {
	// text field for project name
	fNameField= new StringDialogField();
	fNameField.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_NameGroup_label_text);
	fNameField.setDialogFieldListener(this);
}
 
Example 20
Source File: NLSAccessorConfigurationDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private StringDialogField createStringField(String label, AccessorAdapter updateListener) {
	StringDialogField field= new StringDialogField();
	field.setDialogFieldListener(updateListener);
	field.setLabelText(label);
	return field;
}