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

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField#setLabelText() . 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: 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 3
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 4
Source File: ClientBundleResourceDialog.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createResourceTypeControls(Composite parent, int nColumns) {
  resourceTypeField = new StringButtonDialogField(fieldAdapter);
  resourceTypeField.setLabelText("Resource type:");
  resourceTypeField.setButtonLabel("Browse...");
  resourceTypeField.doFillIntoGrid(parent, nColumns);
  Text text = resourceTypeField.getTextControl(null);
  LayoutUtil.setWidthHint(text, getMaxFieldWidth());

  // Set up auto-completion
  JavaTypeCompletionProcessor resourceTypeCompletionProcessor = new JavaTypeCompletionProcessorWithAutoActivation();
  resourceTypeCompletionProcessor.setPackageFragment(pckgFragment);
  ControlContentAssistHelper.createTextContentAssistant(text,
      resourceTypeCompletionProcessor);
  TextFieldNavigationHandler.install(text);
}
 
Example 5
Source File: AddResourcesToClientBundleDialog.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createClientBundleTypeControls(Composite parent, int nColumns) {
  clientBundleTypeField = new StringButtonDialogField(fieldAdapter);
  clientBundleTypeField.setLabelText("ClientBundle:");
  clientBundleTypeField.setButtonLabel("Browse...");
  clientBundleTypeField.doFillIntoGrid(parent, nColumns);
  Text text = clientBundleTypeField.getTextControl(null);
  LayoutUtil.setWidthHint(text, getMaxFieldWidth());

  // Set up auto-completion
  resourceTypeCompletionProcessor = new JavaTypeCompletionProcessorWithAutoActivation();
  ControlContentAssistHelper.createTextContentAssistant(text,
      resourceTypeCompletionProcessor);
  TextFieldNavigationHandler.install(text);
}
 
Example 6
Source File: AddResourcesToClientBundleDialog.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createProjectControls(Composite parent, int nColumns) {
  projectField = new StringButtonDialogField(fieldAdapter);
  projectField.setLabelText("Project:");
  projectField.setButtonLabel("Browse...");
  projectField.doFillIntoGrid(parent, nColumns);
  Text text = projectField.getTextControl(null);
  LayoutUtil.setWidthHint(text, getMaxFieldWidth());
  LayoutUtil.setHorizontalGrabbing(projectField.getTextControl(null));
}
 
Example 7
Source File: AddSourceFolderWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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();
		}
	});
}
 
Example 8
Source File: NewJavaProjectWizardPageOne.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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$
}
 
Example 9
Source File: NewContainerWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a new <code>NewContainerWizardPage</code>
 *
 * @param name the wizard page's name
 */
public NewContainerWizardPage(String name) {
	super(name);
	fWorkspaceRoot= ResourcesPlugin.getWorkspace().getRoot();
	ContainerFieldAdapter adapter= new ContainerFieldAdapter();

	fContainerDialogField= new StringButtonDialogField(adapter);
	fContainerDialogField.setDialogFieldListener(adapter);
	fContainerDialogField.setLabelText(getContainerLabel());
	fContainerDialogField.setButtonLabel(NewWizardMessages.NewContainerWizardPage_container_button);

	fContainerStatus= new StatusInfo();
	fCurrRoot= null;
}
 
Example 10
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 11
Source File: ClientBundleResourceDialog.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createFileControls(Composite parent, int nColumns) {
  fileField = new StringButtonDialogField(fieldAdapter);
  fileField.setLabelText("File:");
  fileField.setButtonLabel("Browse...");
  fileField.doFillIntoGrid(parent, nColumns);
  Text text = fileField.getTextControl(null);
  LayoutUtil.setWidthHint(text, getMaxFieldWidth());
  LayoutUtil.setHorizontalGrabbing(fileField.getTextControl(null));
  fileField.postSetFocusOnDialogField(parent.getDisplay());
}
 
Example 12
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 13
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 14
Source File: NewSourceFolderWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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();
}
 
Example 15
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 16
Source File: BuildPathsBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public BuildPathsBlock(IRunnableContext runnableContext, IStatusChangeListener context, int pageToShow, boolean useNewPage, IWorkbenchPreferenceContainer pageContainer) {
	fPageContainer= pageContainer;
	fWorkspaceRoot= JavaPlugin.getWorkspace().getRoot();
	fContext= context;
	fUseNewPage= useNewPage;

	fPageIndex= pageToShow;

	fSourceContainerPage= null;
	fLibrariesPage= null;
	fProjectsPage= null;
	fCurrPage= null;
       fRunnableContext= runnableContext;

	BuildPathAdapter adapter= new BuildPathAdapter();

	String[] buttonLabels= new String[] {
		/* IDX_UP */ NewWizardMessages.BuildPathsBlock_classpath_up_button,
		/* IDX_DOWN */ NewWizardMessages.BuildPathsBlock_classpath_down_button,
		/* 2 */ null,
		/* IDX_TOP */ NewWizardMessages.BuildPathsBlock_classpath_top_button,
		/* IDX_BOTTOM */ NewWizardMessages.BuildPathsBlock_classpath_bottom_button,
		/* 5 */ null,
		/* IDX_SELECT_ALL */ NewWizardMessages.BuildPathsBlock_classpath_checkall_button,
		/* IDX_UNSELECT_ALL */ NewWizardMessages.BuildPathsBlock_classpath_uncheckall_button

	};

	fClassPathList= new CheckedListDialogField<CPListElement>(adapter, buttonLabels, new CPListLabelProvider());
	fClassPathList.setDialogFieldListener(adapter);
	fClassPathList.setLabelText(NewWizardMessages.BuildPathsBlock_classpath_label);
	fClassPathList.setUpButtonIndex(IDX_UP);
	fClassPathList.setDownButtonIndex(IDX_DOWN);
	fClassPathList.setCheckAllButtonIndex(IDX_SELECT_ALL);
	fClassPathList.setUncheckAllButtonIndex(IDX_UNSELECT_ALL);

	fBuildPathDialogField= new StringButtonDialogField(adapter);
	fBuildPathDialogField.setButtonLabel(NewWizardMessages.BuildPathsBlock_buildpath_button);
	fBuildPathDialogField.setDialogFieldListener(adapter);
	fBuildPathDialogField.setLabelText(NewWizardMessages.BuildPathsBlock_buildpath_label);

	fBuildPathStatus= new StatusInfo();
	fClassPathStatus= new StatusInfo();
	fOutputFolderStatus= new StatusInfo();

	fCurrJProject= null;
}
 
Example 17
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());
	}
}
 
Example 18
Source File: SourceAttachmentBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @param context listeners for status updates
 * @param entry The entry to edit
 * @param canEditEncoding whether the source attachment encoding can be edited
 */
public SourceAttachmentBlock(IStatusChangeListener context, IClasspathEntry entry, boolean canEditEncoding) {
	Assert.isNotNull(entry);

	fContext= context;
	fEntry= entry;
	fCanEditEncoding= canEditEncoding;

	try {
		String defaultEncoding = ResourcesPlugin.getWorkspace().getRoot().getDefaultCharset();
		fDefaultEncodingName= Messages.format(NewWizardMessages.SourceAttachmentBlock_encoding_default, defaultEncoding);
	} catch (CoreException e) {
		//do nothing
	}
	
	int kind= entry.getEntryKind();
	Assert.isTrue(kind == IClasspathEntry.CPE_LIBRARY || kind == IClasspathEntry.CPE_VARIABLE);

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

	fWorkspaceNameStatus= new StatusInfo();
	fExternalNameStatus= new StatusInfo();
	fVariableNameStatus= new StatusInfo();

	SourceAttachmentAdapter adapter= new SourceAttachmentAdapter();

	// create the dialog fields (no widgets yet)
	if (isVariableEntry()) {
		fVariableFileNameField= new VariablePathDialogField(adapter);
		fVariableFileNameField.setDialogFieldListener(adapter);
		fVariableFileNameField.setLabelText(NewWizardMessages.SourceAttachmentBlock_filename_varlabel);
		fVariableFileNameField.setButtonLabel(NewWizardMessages.SourceAttachmentBlock_filename_external_varbutton);
		((VariablePathDialogField) fVariableFileNameField).setVariableButtonLabel(NewWizardMessages.SourceAttachmentBlock_filename_variable_button);
	} else {
		fWorkspaceRadio= new SelectionButtonDialogField(SWT.RADIO);
		fWorkspaceRadio.setDialogFieldListener(adapter);
		fWorkspaceRadio.setLabelText(NewWizardMessages.SourceAttachmentBlock_workspace_radiolabel);

		fWorkspaceFileNameField= new StringButtonDialogField(adapter);
		fWorkspaceFileNameField.setDialogFieldListener(adapter);
		fWorkspaceFileNameField.setLabelText(NewWizardMessages.SourceAttachmentBlock_filename_workspace_label);
		fWorkspaceFileNameField.setButtonLabel(NewWizardMessages.SourceAttachmentBlock_filename_workspace_browse);

		fExternalRadio= new SelectionButtonDialogField(SWT.RADIO);
		fExternalRadio.setDialogFieldListener(adapter);
		fExternalRadio.setLabelText(NewWizardMessages.SourceAttachmentBlock_external_radiolabel);

		fExternalFileNameField= new StringButtonDialogField(adapter);
		fExternalFileNameField.setDialogFieldListener(adapter);
		fExternalFileNameField.setLabelText(NewWizardMessages.SourceAttachmentBlock_filename_external_label);
		fExternalFileNameField.setButtonLabel(NewWizardMessages.SourceAttachmentBlock_filename_externalfile_button);

		fExternalFolderButton= new SelectionButtonDialogField(SWT.PUSH);
		fExternalFolderButton.setDialogFieldListener(adapter);
		fExternalFolderButton.setLabelText(NewWizardMessages.SourceAttachmentBlock_filename_externalfolder_button);
	}

	fEncodingCombo= new ComboDialogField(SWT.DROP_DOWN);
	fEncodingCombo.setDialogFieldListener(adapter);
	fEncodingCombo.setLabelText(NewWizardMessages.SourceAttachmentBlock_encoding_label);
	List<String> encodings= IDEEncoding.getIDEEncodings();
	String[] encodingsArray= encodings.toArray(new String[encodings.size() + 1]);
	System.arraycopy(encodingsArray, 0, encodingsArray, 1, encodingsArray.length - 1);
	encodingsArray[0]= fDefaultEncodingName;
	fEncodingCombo.setItems(encodingsArray);

	// set the old settings
	setDefaults();
}
 
Example 19
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 20
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$
}