Java Code Examples for org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField. These examples are extracted from open source projects. 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
/**
 * @param parent
 */
public RenameKeysDialog(Shell parent, List<NLSSubstitution> selectedSubstitutions) {
	super(parent);
	setTitle(NLSUIMessages.RenameKeysDialog_title);

	fSelectedSubstitutions= selectedSubstitutions;
	String prefix= getInitialPrefix(selectedSubstitutions);
	fCommonPrefixLength= prefix.length();

	fNameField= new StringDialogField();
	fNameField.setText(prefix);

	if (prefix.length() == 0) {
		fNameField.setLabelText(NLSUIMessages.RenameKeysDialog_description_noprefix);
	} else {
		fNameField.setLabelText(NLSUIMessages.RenameKeysDialog_description_withprefix + prefix + ':');
	}
}
 
Example 2
/**
 * 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 3
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 4
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
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 6
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
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 8
/**
 * 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 9
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 10
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 11
private void createMethodNameControls(Composite parent, int nColumns) {
  methodNameField = new StringDialogField();
  methodNameField.setLabelText("Method name:");
  methodNameField.doFillIntoGrid(parent, nColumns - 1);
  Text text = methodNameField.getTextControl(null);
  LayoutUtil.setWidthHint(text, getMaxFieldWidth());

  new Label(parent, SWT.NONE);
}
 
Example 12
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 13
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 14
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);
}
 
Example 15
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 16
/**
   * 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();
   }
 
Example 17
private void setFieldWidthHint(StringDialogField field) {
  Text text = field.getTextControl(null);
  LayoutUtil.setWidthHint(text, convertWidthInCharsToPixels(40));
}
 
Example 18
private StringDialogField createStringField(String label, AccessorAdapter updateListener) {
	StringDialogField field= new StringDialogField();
	field.setDialogFieldListener(updateListener);
	field.setLabelText(label);
	return field;
}
 
Example 19
public NameGroup() {
	// text field for project name
	fNameField= new StringDialogField();
	fNameField.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_NameGroup_label_text);
	fNameField.setDialogFieldListener(this);
}
 
Example 20
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 21
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 22
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 23
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 24
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 25
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 26
Source Project: sarl   Source File: MainProjectWizardPage.java    License: Apache License 2.0 4 votes vote down vote up
NameGroup() {
	// text field for project name
	this.nameField = new StringDialogField();
	this.nameField.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_NameGroup_label_text);
	this.nameField.setDialogFieldListener(this);
}