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

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField. 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
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
/**
 * 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
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
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
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 6
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 7
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 8
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 9
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 10
private StringButtonDialogField createStringButtonField(String label, String button, AccessorAdapter adapter) {
	StringButtonDialogField field= new StringButtonDialogField(adapter);
	field.setDialogFieldListener(adapter);
	field.setLabelText(label);
	field.setButtonLabel(button);
	return field;
}
 
Example 11
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 12
/**
 * 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 13
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 14
private void doValidation(StringButtonDialogField dialogField) {
	String newValue= dialogField.getText();
	if (fNullableAnnotationDialogField.equals(dialogField)) {
		fNullableStatus= validateNullnessAnnotation(newValue, PreferencesMessages.NullAnnotationsConfigurationDialog_nullable_annotation_error);
	} else if (fNonNullAnnotationDialogField.equals(dialogField)) {
		fNonNullStatus= validateNullnessAnnotation(newValue, PreferencesMessages.NullAnnotationsConfigurationDialog_nonull_annotation_error);
	} else if (fNonNullByDefaultAnnotationDialogField.equals(dialogField)) {
		fNonNullByDefaultStatus= validateNullnessAnnotation(newValue, PreferencesMessages.NullAnnotationsConfigurationDialog_nonnullbydefault_annotation_error);
	}
	IStatus status= StatusUtil.getMostSevere(new IStatus[] { fNullableStatus, fNonNullStatus, fNonNullByDefaultStatus });
	updateStatus(status);
}
 
Example 15
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 16
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 17
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 18
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 19
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 20
Source Project: sarl   Source File: MainProjectWizardPage.java    License: Apache License 2.0 5 votes vote down vote up
LocationGroup() {
	this.useDefaults = new SelectionButtonDialogField(SWT.CHECK);
	this.useDefaults.setDialogFieldListener(this);
	this.useDefaults.setLabelText(NewWizardMessages.NewJavaProjectWizardPageOne_LocationGroup_location_desc);

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

	this.useDefaults.setSelection(true);

	this.previousExternalLocation = ""; //$NON-NLS-1$
}
 
Example 21
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 22
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 23
public void dialogFieldChanged(DialogField field) {
	doValidation((StringButtonDialogField) field);
}
 
Example 24
public void changeControlPressed(DialogField field) {
	doBrowseTypes((StringButtonDialogField) field);
}
 
Example 25
/**
 * @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 26
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 27
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;
}