Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 49330 Details for
Bug 88293
[misc] Extension-Point for HyperlinkDetectors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed path including prefs UI
eclipse.hyperlinks.patch (text/plain), 26.93 KB, created by
Eugene Kuleshov
on 2006-09-04 05:11:17 EDT
(
hide
)
Description:
proposed path including prefs UI
Filename:
MIME Type:
Creator:
Eugene Kuleshov
Created:
2006-09-04 05:11:17 EDT
Size:
26.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.editors >Index: src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java,v >retrieving revision 1.26 >diff -u -r1.26 TextSourceViewerConfiguration.java >--- src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java 30 Aug 2006 13:57:56 -0000 1.26 >+++ src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java 3 Sep 2006 01:03:53 -0000 >@@ -14,6 +14,7 @@ > > import org.eclipse.swt.SWT; > >+import org.eclipse.core.runtime.IPath; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.preference.IPreferenceStore; > >@@ -31,9 +32,9 @@ > import org.eclipse.jface.text.source.ISourceViewer; > import org.eclipse.jface.text.source.SourceViewerConfiguration; > >-import org.eclipse.ui.internal.editors.text.URLHyperlinkDetector; > import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; > import org.eclipse.ui.texteditor.AnnotationPreference; >+import org.eclipse.ui.texteditor.hyperlinks.HyperlinkDetectorService; > > > /** >@@ -201,8 +202,14 @@ > > if (!fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED)) > return null; >+ >+ IPath path = null; >+// IEditorInput input = sourceViewer.getEditorInput(); >+// if(input instanceof IPathEditorInput) { >+// path = ((IPathEditorInput) input).getPath(); >+// } > >- return new IHyperlinkDetector[] { new URLHyperlinkDetector() }; >+ return HyperlinkDetectorService.getDefault().getHyperlinkDetectors(path); > } > > /* >Index: src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties,v >retrieving revision 1.56 >diff -u -r1.56 TextEditorMessages.properties >--- src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties 28 Mar 2006 16:37:44 -0000 1.56 >+++ src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties 3 Sep 2006 01:03:53 -0000 >@@ -1,122 +1,100 @@ >-############################################################################### >-# Copyright (c) 2000, 2006 IBM Corporation and others. >-# All rights reserved. This program and the accompanying materials >-# are made available under the terms of the Eclipse Public License v1.0 >-# which accompanies this distribution, and is available at >-# http://www.eclipse.org/legal/epl-v10.html >-# >-# Contributors: >-# IBM Corporation - initial API and implementation >-############################################################################### >- >-EditorsPlugin_internal_error=Internal Error >- >-TextEditorPreferencePage_displayedTabWidth=Displayed &tab width: >-TextEditorPreferencePage_undoHistorySize=&Undo history size: >-TextEditorPreferencePage_printMarginColumn=&Print margin column: >-TextEditorPreferencePage_showLineNumbers=Show lin&e numbers >-TextEditorPreferencePage_highlightCurrentLine=Hi&ghlight current line >-TextEditorPreferencePage_showPrintMargin=Sho&w print margin >-TextEditorPreferencePage_color=&Color: >-TextEditorPreferencePage_appearanceOptions=Appearance co&lor options: >-TextEditorPreferencePage_lineNumberForegroundColor=Line number foreground >-TextEditorPreferencePage_currentLineHighlighColor=Current line highlight >-TextEditorPreferencePage_printMarginColor=Print margin >-TextEditorPreferencePage_foregroundColor=Foreground color >-TextEditorPreferencePage_backgroundColor=Background color >-TextEditorPreferencePage_findScopeColor=Find scope >-TextEditorPreferencePage_accessibility_disableCustomCarets= Use &custom caret >-TextEditorPreferencePage_accessibility_wideCaret= &Enable thick caret >-TextEditorDefaultsPreferencePage_range_indicator=Show &range indicator >-TextEditorPreferencePage_colorsAndFonts_link= More colors can be configured on the <a>Colors and Fonts</a> preference page. >-TextEditorPreferencePage_colorsAndFonts_link_tooltip= Show the Colors and Fonts preferences >- >-TextEditorPreferencePage_overwriteMode= Disable &overwrite typing mode >- >-TextEditorPreferencePage_selectionForegroundColor= Selection foreground color >-TextEditorPreferencePage_selectionBackgroundColor= Selection background color >-TextEditorPreferencePage_systemDefault= System De&fault >- >-TextEditorPreferencePage_invalidInput= ''{0}'' is not a valid input. >-TextEditorPreferencePage_invalidRange= Value must be in between ''{0}'' and ''{1}''. >-TextEditorPreferencePage_emptyInput= Empty input. >- >-QuickDiffConfigurationBlock_description= General Quick Diff settings. >-QuickDiffConfigurationBlock_referenceProviderTitle= &Use this reference source: >-QuickDiffConfigurationBlock_characterMode= &Use characters to show changes on line number bar >-QuickDiffConfigurationBlock_showForNewEditors= &Enable quick diff >-QuickDiffConfigurationBlock_showInOverviewRuler= Show differences in &overview ruler >-QuickDiffConfigurationBlock_colorTitle= Colo&rs >-QuickDiffConfigurationBlock_changeColor= C&hanges: >-QuickDiffConfigurationBlock_additionColor= Addi&tions: >-QuickDiffConfigurationBlock_deletionColor= De&letions: >- >-OpenExternalFileAction_title=Open File >-OpenExternalFileAction_message_fileNotFound=The file ''{0}'' could not be found. >-OpenExternalFileAction_message_filesNotFound=The following files could not be found:\n{0} >-OpenExternalFileAction_title_selectWorkspaceFile=Select Workspace File >-OpenExternalFileAction_message_fileLinkedToMultiple=The selected file is referenced by multiple linked resources in the workspace.\nSelect a workspace resource to open the file. >-OpenExternalFileAction_message_errorOnOpen=The file ''{0}'' could not be opened.\nSee log for details. >- >-NewTextEditorAction_namePrefix=Untitled >- >-AnnotationsConfigurationBlock_description= General annotation settings. >-AnnotationsConfigurationBlock_showInText=&Text as >-AnnotationsConfigurationBlock_showInOverviewRuler=&Overview ruler >-AnnotationsConfigurationBlock_showInVerticalRuler=&Vertical ruler >-AnnotationsConfigurationBlock_annotationPresentationOptions=Annotation ty&pes: >-AnnotationsConfigurationBlock_SQUIGGLES=Squiggles >-AnnotationsConfigurationBlock_UNDERLINE=Underlined >+#Eclipse modern messages class >+#Sat Sep 02 20:47:33 EDT 2006 >+AccessibilityPreferencePage_accessibility_title=Accessibility > AnnotationsConfigurationBlock_BOX=Box >-AnnotationsConfigurationBlock_IBEAM=Vertical Bar > AnnotationsConfigurationBlock_HIGHLIGHT=Highlighted >+AnnotationsConfigurationBlock_IBEAM=Vertical Bar >+AnnotationsConfigurationBlock_SQUIGGLES=Squiggles >+AnnotationsConfigurationBlock_UNDERLINE=Underlined >+AnnotationsConfigurationBlock_annotationPresentationOptions=Annotation ty&pes\: >+AnnotationsConfigurationBlock_color=&Color\: >+AnnotationsConfigurationBlock_description=General annotation settings. > AnnotationsConfigurationBlock_labels_showIn=Show in >-AnnotationsConfigurationBlock_color=&Color: >- >-SelectResourcesDialog_filterSelection= &Filter Selection... >-SelectResourcesDialog_deselectAll= &Deselect All >-SelectResourcesDialog_selectAll= &Select All >-SelectResourcesDialog_noFilesSelected= No file selected. >-SelectResourcesDialog_oneFileSelected= 1 file selected. >-SelectResourcesDialog_nFilesSelected= {0} files selected. >- >+AnnotationsConfigurationBlock_showInOverviewRuler=&Overview ruler >+AnnotationsConfigurationBlock_showInText=&Text as >+AnnotationsConfigurationBlock_showInVerticalRuler=&Vertical ruler > ConvertLineDelimitersAction_default_label=\ [default] >+ConvertLineDelimitersAction_dialog_description=Select files to convert\: > ConvertLineDelimitersAction_dialog_title=Convert Line Delimiters to {0} > ConvertLineDelimitersToMacOS9_label=&MacOS 9 >-ConvertLineDelimitersToWindows_label=&Windows > ConvertLineDelimitersToUnix_label=&Unix >-ConvertLineDelimitersAction_dialog_description=Select files to convert: >-RemoveTrailingWhitespaceHandler_dialog_title=Remove Trailing Whitespace >-RemoveTrailingWhitespaceHandler_dialog_description=Select files: >- >-HyperlinksEnabled_label= Support &hyperlink style navigation >+ConvertLineDelimitersToWindows_label=&Windows >+EditorsPlugin_internal_error=Internal Error > HyperlinkColor_label=Hyperlink >-HyperlinkKeyModifier_label= Hyperlink style navigation key &modifier: >-HyperlinkKeyModifier_error_modifierIsNotValid= Modifier ''{0}'' is not valid. >-HyperlinkKeyModifier_error_shiftIsDisabled= The modifier 'Shift' is not allowed because 'Shift' + click sets a new selection. >-HyperlinkKeyModifier_delimiter= + >-HyperlinkKeyModifier_concatModifierStrings= {0} + {1} >-HyperlinkKeyModifier_insertDelimiterAndModifier= \ + {0} >-# The following two property values need to end with a space >-HyperlinkKeyModifier_insertDelimiterAndModifierAndDelimiter= \ + {0} +\ >-HyperlinkKeyModifier_insertModifierAndDelimiter= \ {0} +\ >- >-AccessibilityPreferencePage_accessibility_title=Accessibility >- >-SpellingConfigurationBlock_enable= &Enable spell checking >-SpellingConfigurationBlock_combo_caption= Select spelling engine to &use: >-SpellingConfigurationBlock_info_no_preferences= The selected spelling engine did not provide a preference control >-SpellingConfigurationBlock_error_not_exist= The selected spelling engine does not exist >-SpellingConfigurationBlock_error_title=Dismiss Changes >-SpellingConfigurationBlock_error_message=The currently displayed spelling engine preferences contain invalid values. Dismiss changes? >- >-# linked mode >-LinkedModeConfigurationBlock_annotationPresentationOptions= &Ranges: >-LinkedModeConfigurationBlock_SQUIGGLES=Squiggles >-LinkedModeConfigurationBlock_UNDERLINE=Underlined >+HyperlinkDetectorsConfigurationBlock_availableDetectors=Available hyperlink detectors\: >+HyperlinkDetectorsConfigurationBlock_description=Hyperlink Detectors >+HyperlinkDetectorsConfigurationBlock_explanation=Hyperlink detectors adds navigation links into the text.\r\nSelect which detectors should be enabled. >+HyperlinkKeyModifier_concatModifierStrings={0} + {1} >+HyperlinkKeyModifier_delimiter=+ >+HyperlinkKeyModifier_error_modifierIsNotValid=Modifier ''{0}'' is not valid. >+HyperlinkKeyModifier_error_shiftIsDisabled=The modifier 'Shift' is not allowed because 'Shift' + click sets a new selection. >+HyperlinkKeyModifier_insertDelimiterAndModifier=\ + {0} >+HyperlinkKeyModifier_insertDelimiterAndModifierAndDelimiter=\ + {0} + >+HyperlinkKeyModifier_insertModifierAndDelimiter=\ {0} + >+HyperlinkKeyModifier_label=Hyperlink style navigation key &modifier\: >+HyperlinksEnabled_label=Support &hyperlink style navigation > LinkedModeConfigurationBlock_BOX=Box >-LinkedModeConfigurationBlock_IBEAM=Vertical Bar > LinkedModeConfigurationBlock_HIGHLIGHT=Highlighted >-LinkedModeConfigurationBlock_labels_showIn=&Show in text as: >-LinkedModeConfigurationBlock_color= C&olor: >+LinkedModeConfigurationBlock_IBEAM=Vertical Bar >+LinkedModeConfigurationBlock_SQUIGGLES=Squiggles >+LinkedModeConfigurationBlock_UNDERLINE=Underlined >+LinkedModeConfigurationBlock_annotationPresentationOptions=&Ranges\: >+LinkedModeConfigurationBlock_color=C&olor\: >+LinkedModeConfigurationBlock_labels_showIn=&Show in text as\: > LinkedModeConfigurationBlock_linking_title=Lin&ked Mode >+NewTextEditorAction_namePrefix=Untitled >+OpenExternalFileAction_message_errorOnOpen=The file ''{0}'' could not be opened.\nSee log for details. >+OpenExternalFileAction_message_fileLinkedToMultiple=The selected file is referenced by multiple linked resources in the workspace.\nSelect a workspace resource to open the file. >+OpenExternalFileAction_message_fileNotFound=The file ''{0}'' could not be found. >+OpenExternalFileAction_message_filesNotFound=The following files could not be found\:\n{0} >+OpenExternalFileAction_title=Open File >+OpenExternalFileAction_title_selectWorkspaceFile=Select Workspace File >+QuickDiffConfigurationBlock_additionColor=Addi&tions\: >+QuickDiffConfigurationBlock_changeColor=C&hanges\: >+QuickDiffConfigurationBlock_characterMode=&Use characters to show changes on line number bar >+QuickDiffConfigurationBlock_colorTitle=Colo&rs >+QuickDiffConfigurationBlock_deletionColor=De&letions\: >+QuickDiffConfigurationBlock_description=General Quick Diff settings. >+QuickDiffConfigurationBlock_referenceProviderTitle=&Use this reference source\: >+QuickDiffConfigurationBlock_showForNewEditors=&Enable quick diff >+QuickDiffConfigurationBlock_showInOverviewRuler=Show differences in &overview ruler >+RemoveTrailingWhitespaceHandler_dialog_description=Select files\: >+RemoveTrailingWhitespaceHandler_dialog_title=Remove Trailing Whitespace >+SelectResourcesDialog_deselectAll=&Deselect All >+SelectResourcesDialog_filterSelection=&Filter Selection... >+SelectResourcesDialog_nFilesSelected={0} files selected. >+SelectResourcesDialog_noFilesSelected=No file selected. >+SelectResourcesDialog_oneFileSelected=1 file selected. >+SelectResourcesDialog_selectAll=&Select All >+SpellingConfigurationBlock_combo_caption=Select spelling engine to &use\: >+SpellingConfigurationBlock_enable=&Enable spell checking >+SpellingConfigurationBlock_error_message=The currently displayed spelling engine preferences contain invalid values. Dismiss changes? >+SpellingConfigurationBlock_error_not_exist=The selected spelling engine does not exist >+SpellingConfigurationBlock_error_title=Dismiss Changes >+SpellingConfigurationBlock_info_no_preferences=The selected spelling engine did not provide a preference control >+TextEditorDefaultsPreferencePage_range_indicator=Show &range indicator >+TextEditorPreferencePage_accessibility_disableCustomCarets=Use &custom caret >+TextEditorPreferencePage_accessibility_wideCaret=&Enable thick caret >+TextEditorPreferencePage_appearanceOptions=Appearance co&lor options\: >+TextEditorPreferencePage_backgroundColor=Background color >+TextEditorPreferencePage_color=&Color\: >+TextEditorPreferencePage_colorsAndFonts_link=More colors can be configured on the <a>Colors and Fonts</a> preference page. >+TextEditorPreferencePage_colorsAndFonts_link_tooltip=Show the Colors and Fonts preferences >+TextEditorPreferencePage_currentLineHighlighColor=Current line highlight >+TextEditorPreferencePage_displayedTabWidth=Displayed &tab width\: >+TextEditorPreferencePage_emptyInput=Empty input. >+TextEditorPreferencePage_findScopeColor=Find scope >+TextEditorPreferencePage_foregroundColor=Foreground color >+TextEditorPreferencePage_highlightCurrentLine=Hi&ghlight current line >+TextEditorPreferencePage_invalidInput=''{0}'' is not a valid input. >+TextEditorPreferencePage_invalidRange=Value must be in between ''{0}'' and ''{1}''. >+TextEditorPreferencePage_lineNumberForegroundColor=Line number foreground >+TextEditorPreferencePage_overwriteMode=Disable &overwrite typing mode >+TextEditorPreferencePage_printMarginColor=Print margin >+TextEditorPreferencePage_printMarginColumn=&Print margin column\: >+TextEditorPreferencePage_selectionBackgroundColor=Selection background color >+TextEditorPreferencePage_selectionForegroundColor=Selection foreground color >+TextEditorPreferencePage_showLineNumbers=Show lin&e numbers >+TextEditorPreferencePage_showPrintMargin=Sho&w print margin >+TextEditorPreferencePage_systemDefault=System De&fault >+TextEditorPreferencePage_undoHistorySize=&Undo history size\: >Index: src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java,v >retrieving revision 1.15 >diff -u -r1.15 TextEditorMessages.java >--- src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java 28 Mar 2006 16:37:44 -0000 1.15 >+++ src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java 3 Sep 2006 01:03:53 -0000 >@@ -125,4 +125,8 @@ > public static String LinkedModeConfigurationBlock_labels_showIn; > public static String LinkedModeConfigurationBlock_color; > public static String LinkedModeConfigurationBlock_linking_title; >+ >+ public static String HyperlinkDetectorsConfigurationBlock_description; >+ public static String HyperlinkDetectorsConfigurationBlock_explanation; >+ public static String HyperlinkDetectorsConfigurationBlock_availableDetectors; > } >Index: plugin.xml >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.editors/plugin.xml,v >retrieving revision 1.96 >diff -u -r1.96 plugin.xml >--- plugin.xml 1 Sep 2006 12:26:46 -0000 1.96 >+++ plugin.xml 3 Sep 2006 01:03:53 -0000 >@@ -242,6 +242,13 @@ > id="org.eclipse.ui.internal.editors.preferencePages.LinkedModePreferencePage"> > <keywordReference id="org.eclipse.ui.editors.linkedmode"/> > </page> >+ <page >+ category="org.eclipse.ui.preferencePages.GeneralTextEditor" >+ class="org.eclipse.ui.internal.editors.text.HyperlinkDetectorsPreferencePage" >+ id="org.eclipse.ui.internal.editors.preferencePages.HyperlinkDetectorsPreferencePage" >+ name="%hyperlinkDetectors"> >+ <keywordReference id="org.eclipse.ui.editors.hyperlinkDetectors"/> >+ </page> > > </extension> > <extension >@@ -930,5 +937,12 @@ > id="org.eclipse.ui.internal.editors.text.JavaFileEditorInputFactory"> > </factory> > </extension> >+ <extension >+ point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors"> >+ <hyperlinkDetector >+ class="org.eclipse.ui.internal.editors.text.URLHyperlinkDetector" >+ id="org.eclipse.ui.internal.editors.text.URLHyperlinkDetector" >+ name="URL hyperlinks"/> >+ </extension> > > </plugin> >Index: plugin.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.editors/plugin.properties,v >retrieving revision 1.55 >diff -u -r1.55 plugin.properties >--- plugin.properties 24 Aug 2006 08:06:09 -0000 1.55 >+++ plugin.properties 3 Sep 2006 01:03:52 -0000 >@@ -133,4 +133,6 @@ > > #--- rulers > LineNumberRuler.name= Line Numbers >-AnnotationRuler.name= Annotations >\ No newline at end of file >+AnnotationRuler.name= Annotations >+ >+hyperlinkDetectors=Hyperlink Detectors >Index: src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsPreferencePage.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsPreferencePage.java >diff -N src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsPreferencePage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsPreferencePage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,65 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Eugene Kuleshov - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.ui.internal.editors.text; >+ >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Label; >+ >+import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; >+ >+ >+/** >+ * Hyperlink detectors preference page. >+ * <p> >+ * Note: Must be public since it is referenced from plugin.xml >+ * </p> >+ * >+ * @since 3.3 >+ */ >+public class HyperlinkDetectorsPreferencePage extends AbstractConfigurationBlockPreferencePage { >+ >+ /* >+ * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId() >+ */ >+ protected String getHelpId() { >+ return ITextEditorHelpContextIds.TEXT_EDITOR_PREFERENCE_PAGE; >+ } >+ >+ /* >+ * @see org.eclipse.jface.preference.PreferencePage#createDescriptionLabel(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Label createDescriptionLabel(Composite parent) { >+ return null; // no description for new look >+ } >+ >+ /* >+ * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() >+ */ >+ protected void setDescription() { >+ String description= TextEditorMessages.HyperlinkDetectorsConfigurationBlock_description; >+ setDescription(description); >+ } >+ >+ /* >+ * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() >+ */ >+ protected void setPreferenceStore() { >+ setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore()); >+ } >+ >+ /* >+ * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore) >+ */ >+ protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) { >+ return new HyperlinkDetectorsConfigurationBlock(overlayPreferenceStore); >+ } >+} >Index: src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java >diff -N src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,146 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Eugene Kuleshov - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.ui.internal.editors.text; >+ >+import java.util.Iterator; >+import java.util.List; >+ >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.jface.viewers.CheckboxTableViewer; >+import org.eclipse.jface.viewers.IStructuredContentProvider; >+import org.eclipse.jface.viewers.LabelProvider; >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.ui.texteditor.hyperlinks.HyperlinkDetectorDescriptor; >+import org.eclipse.ui.texteditor.hyperlinks.HyperlinkDetectorService; >+ >+/** >+ * Configures hyperlink detector preferences >+ * >+ * @since 3.3 >+ */ >+class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBlock { >+ >+ private final OverlayPreferenceStore store; >+ private final HyperlinkDetectorService hyperlinkDetectorService; >+ >+ private CheckboxTableViewer hyperlinkDetectorViewer; >+ >+ >+ public HyperlinkDetectorsConfigurationBlock(OverlayPreferenceStore store) { >+ Assert.isNotNull(store); >+ this.store = store; >+ this.hyperlinkDetectorService = HyperlinkDetectorService.getDefault(); >+ } >+ >+ /** >+ * Creates page for hover preferences. >+ * >+ * @param parent the parent composite >+ * @return the created child composite >+ */ >+ public Control createControl(Composite parent) { >+ Composite composite= new Composite(parent, SWT.NONE); >+ GridLayout gridLayout = new GridLayout(); >+ gridLayout.numColumns = 1; >+ composite.setLayout(gridLayout); >+ >+ Label explanationLabel = new Label(composite, SWT.NONE); >+ explanationLabel.setText(TextEditorMessages.HyperlinkDetectorsConfigurationBlock_explanation); >+ >+ Label viewerLabel = new Label(composite, SWT.NONE); >+ GridData gridData_1 = new GridData(); >+ gridData_1.verticalIndent = 10; >+ viewerLabel.setLayoutData(gridData_1); >+ viewerLabel.setText(TextEditorMessages.HyperlinkDetectorsConfigurationBlock_availableDetectors); >+ >+ hyperlinkDetectorViewer = CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.TOP | SWT.BORDER); >+ hyperlinkDetectorViewer.setLabelProvider(new LabelProvider() { >+ public String getText(Object element) { >+ return ((HyperlinkDetectorDescriptor) element).getLabel(); >+ } >+ }); >+ >+ hyperlinkDetectorViewer.setContentProvider(new IStructuredContentProvider() { >+ public Object[] getElements(Object inputElement) { >+ return ((List) inputElement).toArray(); >+ } >+ public void dispose() { >+ } >+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { >+ } >+ }); >+ >+ List descriptors = hyperlinkDetectorService.getHyperlinkDetectorDescriptors(); >+ hyperlinkDetectorViewer.setInput(descriptors); >+ for(Iterator it = descriptors.iterator(); it.hasNext();) { >+ HyperlinkDetectorDescriptor descriptor = (HyperlinkDetectorDescriptor) it.next(); >+ hyperlinkDetectorViewer.setChecked(descriptor, descriptor.isEnabled()); >+ } >+ >+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); >+ gridData.widthHint = 150; >+ gridData.heightHint = 200; >+ hyperlinkDetectorViewer.getControl().setLayoutData(gridData); >+ >+// Button enableButton = new Button(composite, SWT.NONE); >+// enableButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); >+// enableButton.setText("Enable"); >+// >+// Button disableButton = new Button(composite, SWT.NONE); >+// disableButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); >+// disableButton.setText("Disable"); >+// >+// Button upButton = new Button(composite, SWT.NONE); >+// upButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); >+// upButton.setText("Up"); >+// >+// Button downButton = new Button(composite, SWT.NONE); >+// downButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); >+// downButton.setText("Down"); >+ >+ return composite; >+ } >+ >+ public void initialize() { >+ // TODO >+ >+ } >+ >+ public boolean canPerformOk() { >+ return true; >+ } >+ >+ public void performOk() { >+ for(Iterator it = hyperlinkDetectorService.getHyperlinkDetectorDescriptors().iterator(); it.hasNext();) { >+ HyperlinkDetectorDescriptor descriptor = (HyperlinkDetectorDescriptor) it.next(); >+ descriptor.setEnabled(hyperlinkDetectorViewer.getChecked(descriptor)); >+ } >+ hyperlinkDetectorService.updateConfiguration(); >+ } >+ >+ public void performDefaults() { >+ // TODO >+ } >+ >+ /* >+ * @see org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock#dispose() >+ * @since 3.0 >+ */ >+ public void dispose() { >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 88293
:
34057
|
34118
|
49330
|
49394
|
57498
|
57517