Java Code Examples for org.eclipse.jdt.internal.ui.util.SWTUtil#setAccessibilityText()

The following examples show how to use org.eclipse.jdt.internal.ui.util.SWTUtil#setAccessibilityText() . 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: JavadocStandardWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void createBasicOptionsGroup(Composite composite) {

		fTitleButton= createButton(composite, SWT.CHECK, JavadocExportMessages.JavadocStandardWizardPage_titlebutton_label, createGridData(1));
		fTitleText= createText(composite, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.FILL_HORIZONTAL, 3, 0));
		SWTUtil.setAccessibilityText(fTitleText, JavadocExportMessages.JavadocStandardWizardPage_titlebutton_description);

		String text= fStore.getTitle();
		if (!text.equals("")) { //$NON-NLS-1$
			fTitleText.setText(text);
			fTitleButton.setSelection(true);
		} else
			fTitleText.setEnabled(false);

		fBasicOptionsGroup= new Group(composite, SWT.SHADOW_ETCHED_IN);
		fBasicOptionsGroup.setLayout(createGridLayout(1));
		fBasicOptionsGroup.setLayoutData(createGridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL, 2, 0));
		fBasicOptionsGroup.setText(JavadocExportMessages.JavadocStandardWizardPage_basicgroup_label);

		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_usebutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.USE, true);
		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_hierarchybutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NOTREE, false);
		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_navigartorbutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NONAVBAR, false);

		fIndexCheck= new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_indexbutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NOINDEX, false);

		fSeperatedIndexCheck= new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_seperateindexbutton_label, createGridData(GridData.GRAB_HORIZONTAL, 1,
				LayoutUtil.getIndent()), fStore.SPLITINDEX, true);
		fSeperatedIndexCheck.getButton().setEnabled(fIndexCheck.getButton().getSelection());

		fIndexCheck.getButton().addSelectionListener(new ToggleSelectionAdapter(new Control[] { fSeperatedIndexCheck.getButton()}));
		fTitleButton.addSelectionListener(new ToggleSelectionAdapter(new Control[] { fTitleText }));

	}
 
Example 2
Source File: JavadocTreeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void createInputGroup(Composite composite) {

		createLabel(composite, SWT.NONE, JavadocExportMessages.JavadocTreeWizardPage_checkboxtreeandlistgroup_label, createGridData(6));
		Composite c= new Composite(composite, SWT.NONE);
		GridLayout layout= new GridLayout();
		layout.numColumns= 1;
		layout.makeColumnsEqualWidth= true;
		layout.marginWidth= 0;
		layout.marginHeight= 0;
		c.setLayout(layout);
		c.setLayoutData(createGridData(GridData.FILL_BOTH, 6, 0));

		ITreeContentProvider treeContentProvider= new JavadocProjectContentProvider();
		ITreeContentProvider listContentProvider= new JavadocMemberContentProvider();
		fInputGroup= new CheckboxTreeAndListGroup(c, this, treeContentProvider, new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT), listContentProvider, new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT), SWT.NONE, convertWidthInCharsToPixels(60), convertHeightInCharsToPixels(7));

		fInputGroup.addCheckStateListener(new ICheckStateListener() {
			public void checkStateChanged(CheckStateChangedEvent e) {
				doValidation(TREESTATUS);
			}
		});
		fInputGroup.setTreeComparator(new JavaElementComparator());

		SWTUtil.setAccessibilityText(fInputGroup.getTree(), JavadocExportMessages.JavadocTreeWizardPage_tree_accessibility_message);
		SWTUtil.setAccessibilityText(fInputGroup.getTable(), JavadocExportMessages.JavadocTreeWizardPage_table_accessibility_message);

		IJavaElement[] elements= fStore.getInitialElements();
		setTreeChecked(elements);
		if (elements.length > 0) {
			fInputGroup.setTreeSelection(new StructuredSelection(elements[0].getJavaProject()));
		}

		fInputGroup.aboutToOpen();
	}
 
Example 3
Source File: FilteredElementTreeSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
	FilteredTree tree= new FilteredTreeWithFilter(parent, style, fInitialFilter, fIsDeepFiltering);
	tree.setLayoutData(new GridData(GridData.FILL_BOTH));

	applyDialogFont(tree);

	TreeViewer viewer= tree.getViewer();
	SWTUtil.setAccessibilityText(viewer.getControl(), Strings.removeMnemonicIndicator(getMessage()));
	return viewer;
}
 
Example 4
Source File: AbstractJarDestinationWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void createDestinationGroup(Composite parent) {

	initializeDialogUnits(parent);

	// destination specification group
	Composite destinationSelectionGroup= new Composite(parent, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.numColumns= 3;
	destinationSelectionGroup.setLayout(layout);
	destinationSelectionGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));

	String label= getDestinationLabel();
	if (label != null) {
		new Label(destinationSelectionGroup, SWT.NONE).setText(label);
	} else {
		layout.marginWidth= 0;
		layout.marginHeight= 0;
	}

	// destination name entry field
	fDestinationNamesCombo= new Combo(destinationSelectionGroup, SWT.SINGLE | SWT.BORDER);
	SWTUtil.setDefaultVisibleItemCount(fDestinationNamesCombo);
	fDestinationNamesCombo.addListener(SWT.Modify, this);
	fDestinationNamesCombo.addListener(SWT.Selection, this);
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
	data.widthHint= SIZING_TEXT_FIELD_WIDTH;
	data.horizontalSpan= label == null ? 2 : 1;
	fDestinationNamesCombo.setLayoutData(data);
	if (label == null) {
		SWTUtil.setAccessibilityText(fDestinationNamesCombo, JarPackagerMessages.AbstractJarDestinationWizardPage_destinationCombo_AccessibilityText);
	}

	// destination browse button
	fDestinationBrowseButton= new Button(destinationSelectionGroup, SWT.PUSH);
	fDestinationBrowseButton.setText(JarPackagerMessages.JarPackageWizardPage_browseButton_text);
	fDestinationBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	SWTUtil.setButtonDimensionHint(fDestinationBrowseButton);
	fDestinationBrowseButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			handleDestinationBrowseButtonPressed();
		}
	});
}
 
Example 5
Source File: JavadocStandardWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private void createStyleSheetGroup(Composite composite) {
	Composite c= new Composite(composite, SWT.NONE);
	c.setLayout(createGridLayout(3));
	c.setLayoutData(createGridData(GridData.FILL_HORIZONTAL, 4, 0));
	((GridLayout) c.getLayout()).marginWidth= 0;

	fStyleSheetButton= createButton(c, SWT.CHECK, JavadocExportMessages.JavadocStandardWizardPage_stylesheettext_label, createGridData(1));
	fStyleSheetText= createText(c, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.FILL_HORIZONTAL, 1, 0));
	SWTUtil.setAccessibilityText(fStyleSheetText, JavadocExportMessages.JavadocStandardWizardPage_stylesheettext_description);
	//there really aught to be a way to specify this
	 ((GridData) fStyleSheetText.getLayoutData()).widthHint= 200;
	fStyleSheetBrowseButton= createButton(c, SWT.PUSH, JavadocExportMessages.JavadocStandardWizardPage_stylesheetbrowsebutton_label, createGridData(GridData.HORIZONTAL_ALIGN_END, 1, 0));
	SWTUtil.setButtonDimensionHint(fStyleSheetBrowseButton);

	String str= fStore.getStyleSheet();
	if (str.equals("")) { //$NON-NLS-1$
		//default
		fStyleSheetText.setEnabled(false);
		fStyleSheetBrowseButton.setEnabled(false);
	} else {
		fStyleSheetButton.setSelection(true);
		fStyleSheetText.setText(str);
	}

	//Listeners
	fStyleSheetButton.addSelectionListener(new ToggleSelectionAdapter(new Control[] { fStyleSheetText, fStyleSheetBrowseButton }) {
		@Override
		public void validate() {
			doValidation(STYLESHEETSTATUS);
		}
	});

	fStyleSheetText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			doValidation(STYLESHEETSTATUS);
		}
	});

	fStyleSheetBrowseButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent event) {
			handleFileBrowseButtonPressed(fStyleSheetText, new String[] { "*.css" }, JavadocExportMessages.JavadocSpecificsWizardPage_stylesheetbrowsedialog_title);  //$NON-NLS-1$
		}
	});

}
 
Example 6
Source File: JavadocSpecificsWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private void createExtraOptionsGroup(Composite composite) {
	Composite c= new Composite(composite, SWT.NONE);
	c.setLayout(createGridLayout(3));
	c.setLayoutData(createGridData(GridData.FILL_HORIZONTAL, 3, 0));
	((GridLayout) c.getLayout()).marginWidth= 0;

	fOverViewButton= createButton(c, SWT.CHECK, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbutton_label, createGridData(1));
	fOverViewText= createText(c, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.FILL_HORIZONTAL, 1, 0));
	SWTUtil.setAccessibilityText(fOverViewText, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbutton_description);
	//there really aught to be a way to specify this
	 ((GridData) fOverViewText.getLayoutData()).widthHint= 200;
	fOverViewBrowseButton= createButton(c, SWT.PUSH, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbrowse_label, createGridData(GridData.HORIZONTAL_ALIGN_END, 1, 0));
	SWTUtil.setButtonDimensionHint(fOverViewBrowseButton);

	String str= fStore.getOverview();
	if (str.length() == 0) {
		//default
		fOverViewText.setEnabled(false);
		fOverViewBrowseButton.setEnabled(false);
	} else {
		fOverViewButton.setSelection(true);
		fOverViewText.setText(str);
	}

	createLabel(composite, SWT.NONE, JavadocExportMessages.JavadocSpecificsWizardPage_vmoptionsfield_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 3, 0));
	fVMOptionsText= createText(composite, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.HORIZONTAL_ALIGN_FILL, 3, 0));
	fVMOptionsText.setText(fStore.getVMParams());


	createLabel(composite, SWT.NONE, JavadocExportMessages.JavadocSpecificsWizardPage_extraoptionsfield_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 3, 0));
	fExtraOptionsText= createText(composite, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL, null, createGridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL, 3, 0));
	//fExtraOptionsText.setSize(convertWidthInCharsToPixels(60), convertHeightInCharsToPixels(10));

	fExtraOptionsText.setText(fStore.getAdditionalParams());

	Composite inner= new Composite(composite, SWT.NONE);
	inner.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3, 1));
	GridLayout layout= new GridLayout(2, false);
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	inner.setLayout(layout);

	createLabel(inner, SWT.NONE, JavadocExportMessages.JavadocSpecificsWizardPage_sourcecompatibility_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 1, 0));

	fSourceCombo= createCombo(inner, SWT.NONE, fStore.getSource(), createGridData(1));
	String[] versions= { "-", //$NON-NLS-1$
			JavaCore.VERSION_1_3, JavaCore.VERSION_1_4, JavaCore.VERSION_1_5, JavaCore.VERSION_1_6, JavaCore.VERSION_1_7, JavaCore.VERSION_1_8 };
	fSourceCombo.setItems(versions);
	fSourceCombo.setText(fStore.getSource());


	//Listeners
	fOverViewButton.addSelectionListener(new ToggleSelectionAdapter(new Control[] { fOverViewBrowseButton, fOverViewText }) {
		@Override
		public void validate() {
			doValidation(OVERVIEWSTATUS);
		}
	});

	fOverViewText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			doValidation(OVERVIEWSTATUS);
		}
	});

	fOverViewBrowseButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent event) {
			handleFileBrowseButtonPressed(fOverViewText, new String[] { "*.html" }, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbrowsedialog_title);  //$NON-NLS-1$
		}
	});

}
 
Example 7
Source File: BreadcrumbItemDropDown.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public BreadcrumbItemDropDown(BreadcrumbItem parent, Composite composite) {
	fParent= parent;
	fParentComposite= composite;
	fMenuIsShown= false;
	fEnabled= true;

	fToolBar= new ToolBar(composite, SWT.FLAT);
	fToolBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
	SWTUtil.setAccessibilityText(fToolBar, BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip);
	ToolBarManager manager= new ToolBarManager(fToolBar);

	final Action showDropDownMenuAction= new Action(null, SWT.NONE) {
		@Override
		public void run() {
			Shell shell= fParent.getDropDownShell();
			if (shell != null)
				return;

			shell= fParent.getViewer().getDropDownShell();
			if (shell != null)
				shell.close();

			showMenu();

			fShell.setFocus();
		}
	};

	showDropDownMenuAction.setImageDescriptor(new AccessibelArrowImage(isLTR()));
	showDropDownMenuAction.setToolTipText(BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip);
	manager.add(showDropDownMenuAction);

	manager.update(true);
	if (IS_MAC_WORKAROUND) {
		manager.getControl().addMouseListener(new MouseAdapter() {
			// see also BreadcrumbItemDetails#addElementListener(Control)
			@Override
			public void mouseDown(MouseEvent e) {
				showDropDownMenuAction.run();
			}
		});
	}
}
 
Example 8
Source File: CustomFiltersDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Overrides method in Dialog
 *
 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
 */
@Override
protected Control createDialogArea(Composite parent) {
	initializeDialogUnits(parent);
	// create a composite with standard margins and spacing
	Composite composite= new Composite(parent, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
	layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
	layout.verticalSpacing= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
	layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
	composite.setLayout(layout);
	composite.setLayoutData(new GridData(GridData.FILL_BOTH));
	composite.setFont(parent.getFont());
	Composite group= composite;

	// Checkbox
	fEnableUserDefinedPatterns= new Button(group, SWT.CHECK);
	fEnableUserDefinedPatterns.setFocus();
	fEnableUserDefinedPatterns.setText(FilterMessages.CustomFiltersDialog_enableUserDefinedPattern);

	// Pattern	field
	fUserDefinedPatterns= new Text(group, SWT.SINGLE | SWT.BORDER);
	GridData  data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
	data.widthHint= convertWidthInCharsToPixels(59);
	fUserDefinedPatterns.setLayoutData(data);
	String patterns= convertToString(fPatterns, SEPARATOR);
	fUserDefinedPatterns.setText(patterns);
	SWTUtil.setAccessibilityText(fUserDefinedPatterns, FilterMessages.CustomFiltersDialog_name_filter_pattern_description);

	// Info text
	final Label info= new Label(group, SWT.LEFT);
	info.setText(FilterMessages.CustomFiltersDialog_patternInfo);

	// Enabling / disabling of pattern group
	fEnableUserDefinedPatterns.setSelection(fEnablePatterns);
	fUserDefinedPatterns.setEnabled(fEnablePatterns);
	info.setEnabled(fEnablePatterns);
	fEnableUserDefinedPatterns.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			boolean state= fEnableUserDefinedPatterns.getSelection();
			fUserDefinedPatterns.setEnabled(state);
			info.setEnabled(fEnableUserDefinedPatterns.getSelection());
			if (state)
				fUserDefinedPatterns.setFocus();
		}
	});

	// Filters provided by extension point
	if (fBuiltInFilters.length > 0)
		createCheckBoxList(group);

	applyDialogFont(parent);
	return parent;
}