Java Code Examples for org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField#setText()

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField#setText() . 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: NewAsyncRemoteServiceInterfaceCreationWizardPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
public NewAsyncRemoteServiceInterfaceCreationWizardPage(
    ITypeBinding syncTypeBinding) {
  super();
  this.syncTypeBinding = syncTypeBinding;
  syncTypeDialogField = new StringButtonDialogField(
      new IStringButtonAdapter() {
        public void changeControlPressed(DialogField field) {
          // Purposely ignored
        }
      });
  syncTypeDialogField.setButtonLabel("Browse...");
  syncTypeDialogField.setLabelText("Synchronous type:");
  syncTypeDialogField.setEnabled(false);
  syncTypeDialogField.setText(syncTypeBinding.getQualifiedName());
  ImageDescriptor imageDescriptor = GWTPlugin.getDefault().getImageRegistry().getDescriptor(
      GWTImages.NEW_ASYNC_INTERFACE_LARGE);
  setImageDescriptor(imageDescriptor);
  setDescription("Create a new asynchronous remote service interface");
}
 
Example 2
Source File: ExpandWithConstructorsConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates a call hierarchy preference dialog for members or types.
 *
 * @param parent the parent shell
 * @param existingEntries the existing list of types and members
 * @param isEditingMember <code>true</code if its a member, <code>false</code> otherwise
 */
public CallHierarchyTypesOrMembersDialog(Shell parent, List<String> existingEntries, boolean isEditingMember) {
	super(parent);
	fIsEditingMember= isEditingMember;
	fExistingEntries= existingEntries;

	String label, title;
	if (isEditingMember) {
		title= CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_member_title;
		label= CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_member_labelText;
	} else {
		title= CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_type_title;
		label= CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_type_labelText;
	}
	setTitle(title);

	StringButtonAdapter adapter= new StringButtonAdapter();

	fNameDialogField= new StringButtonDialogField(adapter);
	fNameDialogField.setLabelText(label);
	fNameDialogField.setButtonLabel(CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_browse_button);
	fNameDialogField.setDialogFieldListener(adapter);
	fNameDialogField.setText(""); //$NON-NLS-1$
}
 
Example 3
Source File: CodeAssistFavoritesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public FavoriteStaticMemberInputDialog(Shell parent, List<String> existingEntries, boolean isMember, boolean isNew) {
	super(parent);
	fIsEditingMember= isMember;
	fExistingEntries= existingEntries;

	String label, title;
	if (isMember) {
		title= isNew ? PreferencesMessages.FavoriteStaticMemberInputDialog_member_new_title : PreferencesMessages.FavoriteStaticMemberInputDialog_member_edit_title;
		label= PreferencesMessages.FavoriteStaticMemberInputDialog_member_labelText;
	} else {
		title= isNew ? PreferencesMessages.FavoriteStaticMemberInputDialog_type_new_title : PreferencesMessages.FavoriteStaticMemberInputDialog_type_edit_title;
		label= PreferencesMessages.FavoriteStaticMemberInputDialog_type_labelText;
	}
	setTitle(title);

	StringButtonAdapter adapter= new StringButtonAdapter();

	fNameDialogField= new StringButtonDialogField(adapter);
	fNameDialogField.setLabelText(label);
	fNameDialogField.setButtonLabel(PreferencesMessages.FavoriteStaticMemberInputDialog_browse_button);
	fNameDialogField.setDialogFieldListener(adapter);
	fNameDialogField.setText(""); //$NON-NLS-1$
}
 
Example 4
Source File: ProblemSeveritiesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void doBrowseTypes(StringButtonDialogField dialogField) {
	IRunnableContext context= new BusyIndicatorRunnableContext();
	IJavaSearchScope scope= SearchEngine.createWorkspaceScope();
	int style= IJavaElementSearchConstants.CONSIDER_ANNOTATION_TYPES;
	try {
		SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), context, scope, style, false, dialogField.getText());
		dialog.setTitle(PreferencesMessages.NullAnnotationsConfigurationDialog_browse_title);
		dialog.setMessage(PreferencesMessages.NullAnnotationsConfigurationDialog_choose_annotation);
		if (dialog.open() == Window.OK) {
			IType res= (IType) dialog.getResult()[0];
			dialogField.setText(res.getFullyQualifiedName('.'));
		}
	} catch (JavaModelException e) {
		ExceptionHandler.handle(e, getShell(), PreferencesMessages.NullAnnotationsConfigurationDialog_error_title, PreferencesMessages.NullAnnotationsConfigurationDialog_error_message);
	}
}
 
Example 5
Source File: ProblemSeveritiesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private NullAnnotationsConfigurationDialog() {
	super(ProblemSeveritiesConfigurationBlock.this.getShell());
	
	setTitle(PreferencesMessages.NullAnnotationsConfigurationDialog_title);
	
	fNullableStatus= new StatusInfo();
	fNonNullStatus= new StatusInfo();
	fNonNullByDefaultStatus= new StatusInfo();
	
	StringButtonAdapter adapter= new StringButtonAdapter();

	fNullableAnnotationDialogField= new StringButtonDialogField(adapter);
	fNullableAnnotationDialogField.setLabelText(PreferencesMessages.NullAnnotationsConfigurationDialog_nullable_annotation_label);
	fNullableAnnotationDialogField.setButtonLabel(PreferencesMessages.NullAnnotationsConfigurationDialog_browse1);
	fNullableAnnotationDialogField.setDialogFieldListener(adapter);
	fNullableAnnotationDialogField.setText(getValue(PREF_NULLABLE_ANNOTATION_NAME));
	
	fNonNullAnnotationDialogField= new StringButtonDialogField(adapter);
	fNonNullAnnotationDialogField.setLabelText(PreferencesMessages.NullAnnotationsConfigurationDialog_nonnull_annotation_label);
	fNonNullAnnotationDialogField.setButtonLabel(PreferencesMessages.NullAnnotationsConfigurationDialog_browse2);
	fNonNullAnnotationDialogField.setDialogFieldListener(adapter);
	fNonNullAnnotationDialogField.setText(getValue(PREF_NONNULL_ANNOTATION_NAME));
	
	fNonNullByDefaultAnnotationDialogField= new StringButtonDialogField(adapter);
	fNonNullByDefaultAnnotationDialogField.setLabelText(PreferencesMessages.NullAnnotationsConfigurationDialog_nonnullbydefault_annotation_label);
	fNonNullByDefaultAnnotationDialogField.setButtonLabel(PreferencesMessages.NullAnnotationsConfigurationDialog_browse3);
	fNonNullByDefaultAnnotationDialogField.setDialogFieldListener(adapter);
	fNonNullByDefaultAnnotationDialogField.setText(getValue(PREF_NONNULL_BY_DEFAULT_ANNOTATION_NAME));
}
 
Example 6
Source File: ImportOrganizeInputDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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);
}
 
Example 7
Source File: OutputLocationDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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());
	}
}
 
Example 8
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 9
Source File: JavaMethodFilterInputDialog.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JavaMethodFilterInputDialog(Shell parent, List<String> existingEntries) {
	super(parent);

	fExistingEntries= existingEntries;

	setTitle(PreferencesMessages.TypeFilterInputDialog_title);

	TypeFilterInputAdapter adapter= new TypeFilterInputAdapter();

	fNameDialogField= new StringButtonDialogField(adapter);
	fNameDialogField.setLabelText(PreferencesMessages.TypeFilterInputDialog_message);
	fNameDialogField.setButtonLabel(PreferencesMessages.TypeFilterInputDialog_browse_button);
	fNameDialogField.setDialogFieldListener(adapter);

	fNameDialogField.setText("");		 //$NON-NLS-1$
}
 
Example 10
Source File: TypeFilterInputDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public TypeFilterInputDialog(Shell parent, List<String> existingEntries) {
	super(parent);

	fExistingEntries= existingEntries;

	setTitle(PreferencesMessages.TypeFilterInputDialog_title);

	TypeFilterInputAdapter adapter= new TypeFilterInputAdapter();

	fNameDialogField= new StringButtonDialogField(adapter);
	fNameDialogField.setLabelText(PreferencesMessages.TypeFilterInputDialog_message);
	fNameDialogField.setButtonLabel(PreferencesMessages.TypeFilterInputDialog_browse_button);
	fNameDialogField.setDialogFieldListener(adapter);

	fNameDialogField.setText("");		 //$NON-NLS-1$
}
 
Example 11
Source File: ExclusionInclusionEntryDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public ExclusionInclusionEntryDialog(Shell parent, boolean isExclusion, String patternToEdit, List<String> existingPatterns, CPListElement entryToEdit) {
	super(parent);
	fIsExclusion= isExclusion;
	fExistingPatterns= existingPatterns;
	String title, message;
	if (isExclusion) {
		if (patternToEdit == null) {
			title= NewWizardMessages.ExclusionInclusionEntryDialog_exclude_add_title;
		} else {
			title= NewWizardMessages.ExclusionInclusionEntryDialog_exclude_edit_title;
		}
		message= Messages.format(NewWizardMessages.ExclusionInclusionEntryDialog_exclude_pattern_label, BasicElementLabels.getPathLabel(entryToEdit.getPath(), false));
	} else {
		if (patternToEdit == null) {
			title= NewWizardMessages.ExclusionInclusionEntryDialog_include_add_title;
		} else {
			title= NewWizardMessages.ExclusionInclusionEntryDialog_include_edit_title;
		}
		message= Messages.format(NewWizardMessages.ExclusionInclusionEntryDialog_include_pattern_label, BasicElementLabels.getPathLabel(entryToEdit.getPath(), false));
	}
	setTitle(title);
	if (patternToEdit != null) {
		fExistingPatterns.remove(patternToEdit);
	}


	IWorkspaceRoot root= entryToEdit.getJavaProject().getProject().getWorkspace().getRoot();
	IResource res= root.findMember(entryToEdit.getPath());
	if (res instanceof IContainer) {
		fCurrSourceFolder= (IContainer) res;
	}

	fExclusionPatternStatus= new StatusInfo();

	ExclusionPatternAdapter adapter= new ExclusionPatternAdapter();
	fExclusionPatternDialog= new StringButtonDialogField(adapter);
	fExclusionPatternDialog.setLabelText(message);
	fExclusionPatternDialog.setButtonLabel(NewWizardMessages.ExclusionInclusionEntryDialog_pattern_button);
	fExclusionPatternDialog.setDialogFieldListener(adapter);
	fExclusionPatternDialog.enableButton(fCurrSourceFolder != null);

	if (patternToEdit == null) {
		fExclusionPatternDialog.setText(""); //$NON-NLS-1$
	} else {
		fExclusionPatternDialog.setText(patternToEdit.toString());
	}
}