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 26160 Details for
Bug 106620
Webtools XML Editor ignores XML files with other extensions then .xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
org.eclipse.wst.sse.ui.patch
org.eclipse.wst.sse.ui.patch (text/plain), 13.66 KB, created by
Amy Wu
on 2005-08-16 12:41:59 EDT
(
hide
)
Description:
org.eclipse.wst.sse.ui.patch
Filename:
MIME Type:
Creator:
Amy Wu
Created:
2005-08-16 12:41:59 EDT
Size:
13.66 KB
patch
obsolete
>Index: src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java >=================================================================== >RCS file: /home/webtools/wst/components/sse/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java,v >retrieving revision 1.9 >diff -u -r1.9 PreferenceInitializer.java >--- src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java 17 May 2005 18:55:08 -0000 1.9 >+++ src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java 16 Aug 2005 16:27:41 -0000 >@@ -61,6 +61,9 @@ > > // set default enable folding value > store.setDefault(IStructuredTextFoldingProvider.FOLDING_ENABLED, false); >+ >+ // set default for show message dialog when unknown content type in editor >+ store.setDefault(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, true); > } > > private void setMatchingBracketsPreferences(IPreferenceStore store) { >Index: src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java >=================================================================== >RCS file: /home/webtools/wst/components/sse/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java,v >retrieving revision 1.6 >diff -u -r1.6 SSEUIMessages.java >--- src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java 24 Jun 2005 21:30:05 -0000 1.6 >+++ src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java 16 Aug 2005 16:27:41 -0000 >@@ -396,6 +396,11 @@ > public static String Editor_ManageTasks_add_dialog_message; > public static String Editor_ManageTasks_error_dialog_title; > public static String Editor_ManageTasks_error_dialog_message; >+ public static String StructuredTextEditorPreferencePage_39; >+ public static String StructuredTextEditor_0; >+ public static String UnknownContentTypeDialog_0; >+ public static String UnknownContentTypeDialog_1; >+ public static String UnknownContentTypeDialog_2; > > /* > * *****Above are possibly unused strings that may be removed***** >Index: src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties >=================================================================== >RCS file: /home/webtools/wst/components/sse/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties,v >retrieving revision 1.9 >diff -u -r1.9 SSEUIPluginResources.properties >--- src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties 24 Jun 2005 21:30:05 -0000 1.9 >+++ src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties 16 Aug 2005 16:27:41 -0000 >@@ -179,6 +179,7 @@ > StructuredTextEditorPreferencePage_30=&Report problems as you type > StructuredTextEditorPreferencePage_37=Empty input > StructuredTextEditorPreferencePage_38=is not a valid input. >+StructuredTextEditorPreferencePage_39=Inform when unsupported content type is in editor > TaskTagPreferenceTab_0=Low > TaskTagPreferenceTab_1=Normal > TaskTagPreferenceTab_2=High >@@ -274,6 +275,11 @@ > OffsetStatusLineContributionItem_17=Text Length > OffsetStatusLineContributionItem_18=Context > >+StructuredTextEditor_0=Unsupported content type warning >+UnknownContentTypeDialog_0=Unsupported Content Type >+UnknownContentTypeDialog_1=Do not show this message again >+UnknownContentTypeDialog_2=Unsupported content type in editor.\nTo associate file extension with a supported content type,\nplease see <a>Content Types Preference Page</a> >+ > ################################################################################ > ## Below are possibly unused strings that may be removed > ################################################################################ >@@ -375,4 +381,4 @@ > Editor_ManageTasks_error_dialog_message=Problems managing tasks > ################################################################################ > ## Above are possibly unused strings that may be removed >-################################################################################ >+############################################################################### >Index: src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java >=================================================================== >RCS file: /home/webtools/wst/components/sse/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java,v >retrieving revision 1.21 >diff -u -r1.21 StructuredTextEditor.java >--- src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java 8 Aug 2005 16:14:01 -0000 1.21 >+++ src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java 16 Aug 2005 16:27:42 -0000 >@@ -33,6 +33,7 @@ > import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; > import org.eclipse.emf.common.command.Command; > import org.eclipse.jface.action.Action; >@@ -98,6 +99,7 @@ > import org.eclipse.ui.part.EditorActionBarContributor; > import org.eclipse.ui.part.IShowInTargetList; > import org.eclipse.ui.progress.IWorkbenchSiteProgressService; >+import org.eclipse.ui.progress.UIJob; > import org.eclipse.ui.texteditor.ChainedPreferenceStore; > import org.eclipse.ui.texteditor.DefaultRangeIndicator; > import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds; >@@ -1142,7 +1144,7 @@ > if (doc instanceof IStructuredDocument) { > ((IStructuredDocument) doc).getUndoManager().getCommandStack().flush(); > } >- >+ > // update menu text > updateMenuText(); > } >@@ -1534,9 +1536,9 @@ > } > return fStructuredModel; > } >- >+ > public int getOrientation() { >- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714 >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714 > return SWT.LEFT_TO_RIGHT; > } > >@@ -1808,10 +1810,24 @@ > public boolean isSaveOnCloseNeeded() { > if (getInternalModel() == null) > return false; >- return getInternalModel().isSaveNeeded(); >+ // BUG99793 - always prompt for save if dirty (even if others have >+ // model for edit) >+ return getInternalModel().isDirty(); > } > > private void logUnexpectedDocumentKind(IEditorInput input) { >+ // display a dialog informing user of uknown content type >+ if (SSEUIPlugin.getDefault().getPreferenceStore().getBoolean(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)) { >+ Job job = new UIJob(SSEUIMessages.StructuredTextEditor_0) { >+ public IStatus runInUIThread(IProgressMonitor monitor) { >+ UnknownContentTypeDialog dialog = new UnknownContentTypeDialog(getSite().getShell(), SSEUIPlugin.getDefault().getPreferenceStore(), EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG); >+ dialog.open(); >+ return Status.OK_STATUS; >+ } >+ }; >+ job.schedule(); >+ } >+ > Logger.log(Logger.WARNING, "StructuredTextEditor being used without StructuredDocument"); //$NON-NLS-1$ > String name = null; > if (input != null) { >@@ -1999,7 +2015,7 @@ > * @deprecated - can eventually be eliminated > */ > private void setModel(IStructuredModel newModel) { >- Assert.isNotNull(getDocumentProvider(), "document provider can not be null when setting model"); >+ Assert.isNotNull(getDocumentProvider(), "document provider can not be null when setting model"); //$NON-NLS-1$ > if (fStructuredModel != null) { > if (fStructuredModel.getStructuredDocument() != null) { > fStructuredModel.getStructuredDocument().removeDocumentListener(getInternalDocumentListener()); >Index: src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java >=================================================================== >RCS file: /home/webtools/wst/components/sse/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java,v >retrieving revision 1.1 >diff -u -r1.1 EditorPreferenceNames.java >--- src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java 10 Mar 2005 19:47:16 -0000 1.1 >+++ src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java 16 Aug 2005 16:27:42 -0000 >@@ -22,11 +22,11 @@ > * </p> > */ > public static final String EVALUATE_TEMPORARY_PROBLEMS = getEvaluateTemporaryProblemsKey(); >- >+ > private static String getEvaluateTemporaryProblemsKey() { > return "evaluateTemporaryProblems"; //$NON-NLS-1$ > } >- >+ > /** > * A named preference that controls whether bracket matching highlighting > * is turned on or off. >@@ -65,16 +65,22 @@ > private static String getTextHoverModifiersKey() { > return "hoverModifiers"; //$NON-NLS-1$ > } >- >+ > /** > * A named preference that defines read only contrast scale. > * <p> > * Value is of type <code>Integer</code>. >- * </p> >+ * </p> > */ > public static final String READ_ONLY_FOREGROUND_SCALE = getReadOnlyForegroundScaleKey(); >- >+ > private static String getReadOnlyForegroundScaleKey() { > return "readOnlyForegroundScale"; //$NON-NLS-1$ > } >+ >+ /** >+ * A named preference that defines whether or not to show a message dialog >+ * informing user of unknown content type in editor. >+ */ >+ public static final String SHOW_UNKNOWN_CONTENT_TYPE_MSG = "showUnknownContentTypeMsg"; //$NON-NLS-1$ > } >Index: src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java >=================================================================== >RCS file: /home/webtools/wst/components/sse/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java,v >retrieving revision 1.2 >diff -u -r1.2 StructuredTextEditorPreferencePage.java >--- src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java 18 Apr 2005 07:59:42 -0000 1.2 >+++ src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java 16 Aug 2005 16:27:42 -0000 >@@ -151,6 +151,9 @@ > > label = SSEUIMessages.StructuredTextEditorPreferencePage_30; //$NON-NLS-1$ > addCheckBox(appearanceComposite, label, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, 0); >+ >+ label = SSEUIMessages.StructuredTextEditorPreferencePage_39; >+ addCheckBox(appearanceComposite, label, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, 0); > > if (showFoldingPreference) { > label = "Enable folding (work in progress)"; //$NON-NLS-1$ >@@ -288,7 +291,8 @@ > overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.MATCHING_BRACKETS)); > > overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS)); >- >+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)); >+ > if (showFoldingPreference) > overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IStructuredTextFoldingProvider.FOLDING_ENABLED)); > >Index: src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java >=================================================================== >RCS file: src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java >diff -N src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,67 @@ >+package org.eclipse.wst.sse.ui.internal; >+ >+import org.eclipse.jface.dialogs.IDialogConstants; >+import org.eclipse.jface.dialogs.MessageDialogWithToggle; >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.jface.preference.PreferenceDialog; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Link; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.dialogs.PreferencesUtil; >+ >+/** >+ * Message dialog informing user that an editor was open on unsupported >+ * content type >+ */ >+class UnknownContentTypeDialog extends MessageDialogWithToggle { >+ >+ public UnknownContentTypeDialog(Shell parent, IPreferenceStore store, String key) { >+ // set message to null in super so that message does not appear twice >+ super(parent, SSEUIMessages.UnknownContentTypeDialog_0, null, null, INFORMATION, new String[]{IDialogConstants.OK_LABEL}, 0, SSEUIMessages.UnknownContentTypeDialog_1, false); >+ setPrefStore(store); >+ setPrefKey(key); >+ } >+ >+ protected void buttonPressed(int buttonId) { >+ super.buttonPressed(buttonId); >+ >+ // overwritten so that value stored is boolean, not string >+ if (buttonId != IDialogConstants.CANCEL_ID && getToggleState() && getPrefStore() != null && getPrefKey() != null) { >+ switch (buttonId) { >+ case IDialogConstants.YES_ID : >+ case IDialogConstants.YES_TO_ALL_ID : >+ case IDialogConstants.PROCEED_ID : >+ case IDialogConstants.OK_ID : >+ getPrefStore().setValue(getPrefKey(), false); >+ break; >+ case IDialogConstants.NO_ID : >+ case IDialogConstants.NO_TO_ALL_ID : >+ getPrefStore().setValue(getPrefKey(), true); >+ break; >+ } >+ } >+ >+ } >+ >+ protected Control createMessageArea(Composite composite) { >+ super.createMessageArea(composite); >+ Link messageLink = new Link(composite, SWT.NONE); >+ messageLink.setText(SSEUIMessages.UnknownContentTypeDialog_2); >+ messageLink.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ linkClicked(); >+ } >+ }); >+ return composite; >+ } >+ >+ private void linkClicked() { >+ String pageId = "org.eclipse.ui.preferencePages.ContentTypes"; //$NON-NLS-1$ >+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null); >+ dialog.open(); >+ } >+}
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 106620
:
26158
| 26160