use of org.eclipse.ui.dialogs.PreferenceLinkArea in project webtools.sourceediting by eclipse.
the class JSONSourcePreferencePage method createContents.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
final Composite composite = super.createComposite(parent, 1);
// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
// IHelpContextIds.CSS_PREFWEBX_SOURCE_HELPID);
new // $NON-NLS-1$
PreferenceLinkArea(// $NON-NLS-1$
composite, // $NON-NLS-1$
SWT.WRAP | SWT.MULTI, // $NON-NLS-1$
"org.eclipse.wst.sse.ui.preferences.editor", JSONUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
createContentsForFormattingGroup(composite);
setSize(composite);
loadPreferences();
return composite;
}
use of org.eclipse.ui.dialogs.PreferenceLinkArea in project webtools.sourceediting by eclipse.
the class StructuredTextEditorPreferencePage method createAppearancePage.
private Control createAppearancePage(Composite parent) {
Composite appearanceComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
appearanceComposite.setLayout(layout);
// $NON-NLS-1$
String label = SSEUIMessages.StructuredTextEditorPreferencePage_20;
addCheckBox(appearanceComposite, label, EditorPreferenceNames.MATCHING_BRACKETS, 0);
// $NON-NLS-1$
label = SSEUIMessages.StructuredTextEditorPreferencePage_30;
addCheckBox(appearanceComposite, label, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, 0);
// $NON-NLS-1$
PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(appearanceComposite, SWT.NONE, "ValidationPreferencePage", SSEUIMessages.StructuredTextEditorPreferencePage_40, (IWorkbenchPreferenceContainer) getContainer(), null);
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
data.horizontalIndent = 20;
contentTypeArea.getControl().setLayoutData(data);
label = SSEUIMessages.StructuredTextEditorPreferencePage_39;
addCheckBox(appearanceComposite, label, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, 0);
label = SSEUIMessages.StructuredTextEditorPreferencePage_3;
addCheckBox(appearanceComposite, label, AbstractStructuredFoldingStrategy.FOLDING_ENABLED, 0);
label = SSEUIMessages.StructuredTextEditorPreferencePage_1;
addCheckBox(appearanceComposite, label, EditorPreferenceNames.SEMANTIC_HIGHLIGHTING, 0);
Label l = new Label(appearanceComposite, SWT.LEFT);
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 2;
gd.heightHint = convertHeightInCharsToPixels(1) / 2;
l.setLayoutData(gd);
l = new Label(appearanceComposite, SWT.LEFT);
// $NON-NLS-1$
l.setText(SSEUIMessages.StructuredTextEditorPreferencePage_23);
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 2;
l.setLayoutData(gd);
Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginHeight = 0;
layout.marginWidth = 0;
editorComposite.setLayout(layout);
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
gd.horizontalSpan = 2;
editorComposite.setLayoutData(gd);
fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
gd.heightHint = convertHeightInCharsToPixels(7);
fAppearanceColorList.setLayoutData(gd);
Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 2;
stylesComposite.setLayout(layout);
stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
l = new Label(stylesComposite, SWT.LEFT);
// needs to be made final so label can be set in
// foregroundcolorbutton's acc listener
// $NON-NLS-1$
final String buttonLabel = SSEUIMessages.StructuredTextEditorPreferencePage_24;
l.setText(buttonLabel);
gd = new GridData();
gd.horizontalAlignment = GridData.BEGINNING;
l.setLayoutData(gd);
fAppearanceColorEditor = new ColorEditor(stylesComposite);
Button foregroundColorButton = fAppearanceColorEditor.getButton();
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalAlignment = GridData.BEGINNING;
foregroundColorButton.setLayoutData(gd);
fAppearanceColorList.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
// do nothing
}
public void widgetSelected(SelectionEvent e) {
handleAppearanceColorListSelection();
}
});
foregroundColorButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
// do nothing
}
public void widgetSelected(SelectionEvent e) {
int i = fAppearanceColorList.getSelectionIndex();
String key = fAppearanceColorListModel[i][1];
PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue());
}
});
// bug2541 - associate color label to button's label field
foregroundColorButton.getAccessible().addAccessibleListener(new AccessibleAdapter() {
public void getName(AccessibleEvent e) {
if (e.childID == ACC.CHILDID_SELF)
e.result = buttonLabel;
}
});
PlatformUI.getWorkbench().getHelpSystem().setHelp(appearanceComposite, IHelpContextIds.PREFSTE_APPEARANCE_HELPID);
return appearanceComposite;
}
use of org.eclipse.ui.dialogs.PreferenceLinkArea in project webtools.sourceediting by eclipse.
the class HTMLSourcePreferencePage method createContents.
protected Control createContents(Composite parent) {
final Composite composite = super.createComposite(parent, 1);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.HTML_PREFWEBX_SOURCE_HELPID);
new // $NON-NLS-1$
PreferenceLinkArea(// $NON-NLS-1$
composite, // $NON-NLS-1$
SWT.WRAP | SWT.MULTI, // $NON-NLS-1$
"org.eclipse.wst.sse.ui.preferences.editor", // $NON-NLS-1$
HTMLUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
createContentsForFormattingGroup(composite);
createContentsForPreferredCaseGroup(composite, 2);
setSize(composite);
loadPreferences();
return composite;
}
use of org.eclipse.ui.dialogs.PreferenceLinkArea in project webtools.sourceediting by eclipse.
the class JSPValidationPreferencePage method createValidationSection.
private Composite createValidationSection(Composite page) {
int nColumns = 3;
final ScrolledPageContent spContent = new ScrolledPageContent(page);
Composite composite = spContent.getBody();
GridLayout layout = new GridLayout(nColumns, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
Label description = new Label(composite, SWT.NONE);
description.setText(JSPUIMessages.Validation_description);
description.setFont(page.getFont());
String[] errorWarningIgnoreLabels = new String[] { JSPUIMessages.Validation_Error, JSPUIMessages.Validation_Warning, JSPUIMessages.Validation_Ignore };
Composite section;
// begin directives section
section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_DIRECTIVE, nColumns);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_ATTRIBUTE_DUPLICATE_NAME, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_ATTRIBUTE_DUPLICATE_NAME, SEVERITIES, errorWarningIgnoreLabels, 0);
// addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
// end directives section
// begin custom actions section
section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_CUSTOM_ACTIONS, nColumns);
addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
// end custom actions section
// begin standard actions section
section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_STANDARD_ACTIONS, nColumns);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USEBEAN_INVALID_ID, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USEBEAN_INVALID_ID, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO, SEVERITIES, errorWarningIgnoreLabels, 0);
// end standard actions section
// begin Java severity override section
section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_JAVA, nColumns);
if (getProject() == null) {
new PreferenceLinkArea(section, SWT.WRAP | SWT.MULTI, JAVA_SEVERITY_PREFERENCE_PAGE, JSPUIMessages.VALIDATION_JAVA_NOTICE, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
} else {
final Map data = new HashMap();
data.put(DATA_NO_LINK, Boolean.TRUE);
Link link = new Link(section, SWT.WRAP | SWT.MULTI);
link.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
link.setText(JSPUIMessages.VALIDATION_JAVA_NOTICE);
link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
container.openPage(JAVA_SEVERITY_PROPERTY_PAGE, data);
}
});
// new PreferenceLinkArea(section, SWT.WRAP | SWT.MULTI | SWT.LEFT_TO_RIGHT, JAVA_SEVERITY_PROPERTY_PAGE, JSPUIMessages.VALIDATION_JAVA_NOTICE, (IWorkbenchPreferenceContainer) getContainer(), data).getControl().setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
// open in same shell?
// PreferencesUtil.createPropertyDialogOn(getShell(), getProject(), JAVA_SEVERITY_PROPERTY_PAGE, new String[] { JAVA_SEVERITY_PROPERTY_PAGE }, data).open();
}
int sectionIndent = convertWidthInCharsToPixels(2);
addComboBox(section, JSPUIMessages.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
addComboBox(section, JSPUIMessages.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
addComboBox(section, JSPUIMessages.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
addComboBox(section, JSPUIMessages.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
addComboBox(section, JSPUIMessages.VALIDATION_JAVA_UNUSED_IMPORT, JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
// end Java severity override section
// begin EL section
section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_EL, nColumns);
addComboBox(section, JSPUIMessages.VALIDATION_EL_SYNTAX, JSPCorePreferenceNames.VALIDATION_EL_SYNTAX, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_EL_LEXER, JSPCorePreferenceNames.VALIDATION_EL_LEXER, SEVERITIES, errorWarningIgnoreLabels, 0);
addComboBox(section, JSPUIMessages.VALIDATION_EL_FUNCTION_UNDEFINED, JSPCorePreferenceNames.VALIDATION_EL_FUNCTION_UNDEFINED, SEVERITIES, errorWarningIgnoreLabels, 0);
// end EL section
restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
return spContent;
}
use of org.eclipse.ui.dialogs.PreferenceLinkArea in project webtools.sourceediting by eclipse.
the class XSDValidatorPreferencePage method createContents.
protected Control createContents(Composite parent) {
final Composite composite = super.createComposite(parent, 1);
IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
helpSystem.setHelp(parent, XSDEditorContextIds.XSDP_VALIDATOR_PREFERENCE_PAGE);
new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, XML_VALIDATOR_PREFERENCE_PAGE_ID, Messages._UI_XML_VALIDATOR_PREFS_LINK, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
createContentsForValidatingGroup(composite);
setSize(composite);
loadPreferences();
return composite;
}
Aggregations