|
Lines 33-38
Link Here
|
| 33 |
import org.eclipse.core.runtime.Path; |
33 |
import org.eclipse.core.runtime.Path; |
| 34 |
import org.eclipse.core.runtime.Platform; |
34 |
import org.eclipse.core.runtime.Platform; |
| 35 |
import org.eclipse.core.runtime.Status; |
35 |
import org.eclipse.core.runtime.Status; |
|
|
36 |
import org.eclipse.core.runtime.jobs.Job; |
| 36 |
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; |
37 |
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; |
| 37 |
import org.eclipse.emf.common.command.Command; |
38 |
import org.eclipse.emf.common.command.Command; |
| 38 |
import org.eclipse.jface.action.Action; |
39 |
import org.eclipse.jface.action.Action; |
|
Lines 98-103
Link Here
|
| 98 |
import org.eclipse.ui.part.EditorActionBarContributor; |
99 |
import org.eclipse.ui.part.EditorActionBarContributor; |
| 99 |
import org.eclipse.ui.part.IShowInTargetList; |
100 |
import org.eclipse.ui.part.IShowInTargetList; |
| 100 |
import org.eclipse.ui.progress.IWorkbenchSiteProgressService; |
101 |
import org.eclipse.ui.progress.IWorkbenchSiteProgressService; |
|
|
102 |
import org.eclipse.ui.progress.UIJob; |
| 101 |
import org.eclipse.ui.texteditor.ChainedPreferenceStore; |
103 |
import org.eclipse.ui.texteditor.ChainedPreferenceStore; |
| 102 |
import org.eclipse.ui.texteditor.DefaultRangeIndicator; |
104 |
import org.eclipse.ui.texteditor.DefaultRangeIndicator; |
| 103 |
import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds; |
105 |
import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds; |
|
Lines 1142-1148
Link Here
|
| 1142 |
if (doc instanceof IStructuredDocument) { |
1144 |
if (doc instanceof IStructuredDocument) { |
| 1143 |
((IStructuredDocument) doc).getUndoManager().getCommandStack().flush(); |
1145 |
((IStructuredDocument) doc).getUndoManager().getCommandStack().flush(); |
| 1144 |
} |
1146 |
} |
| 1145 |
|
1147 |
|
| 1146 |
// update menu text |
1148 |
// update menu text |
| 1147 |
updateMenuText(); |
1149 |
updateMenuText(); |
| 1148 |
} |
1150 |
} |
|
Lines 1534-1542
Link Here
|
| 1534 |
} |
1536 |
} |
| 1535 |
return fStructuredModel; |
1537 |
return fStructuredModel; |
| 1536 |
} |
1538 |
} |
| 1537 |
|
1539 |
|
| 1538 |
public int getOrientation() { |
1540 |
public int getOrientation() { |
| 1539 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714 |
1541 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714 |
| 1540 |
return SWT.LEFT_TO_RIGHT; |
1542 |
return SWT.LEFT_TO_RIGHT; |
| 1541 |
} |
1543 |
} |
| 1542 |
|
1544 |
|
|
Lines 1808-1817
Link Here
|
| 1808 |
public boolean isSaveOnCloseNeeded() { |
1810 |
public boolean isSaveOnCloseNeeded() { |
| 1809 |
if (getInternalModel() == null) |
1811 |
if (getInternalModel() == null) |
| 1810 |
return false; |
1812 |
return false; |
| 1811 |
return getInternalModel().isSaveNeeded(); |
1813 |
// BUG99793 - always prompt for save if dirty (even if others have |
|
|
1814 |
// model for edit) |
| 1815 |
return getInternalModel().isDirty(); |
| 1812 |
} |
1816 |
} |
| 1813 |
|
1817 |
|
| 1814 |
private void logUnexpectedDocumentKind(IEditorInput input) { |
1818 |
private void logUnexpectedDocumentKind(IEditorInput input) { |
|
|
1819 |
// display a dialog informing user of uknown content type |
| 1820 |
if (SSEUIPlugin.getDefault().getPreferenceStore().getBoolean(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)) { |
| 1821 |
Job job = new UIJob(SSEUIMessages.StructuredTextEditor_0) { |
| 1822 |
public IStatus runInUIThread(IProgressMonitor monitor) { |
| 1823 |
UnknownContentTypeDialog dialog = new UnknownContentTypeDialog(getSite().getShell(), SSEUIPlugin.getDefault().getPreferenceStore(), EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG); |
| 1824 |
dialog.open(); |
| 1825 |
return Status.OK_STATUS; |
| 1826 |
} |
| 1827 |
}; |
| 1828 |
job.schedule(); |
| 1829 |
} |
| 1830 |
|
| 1815 |
Logger.log(Logger.WARNING, "StructuredTextEditor being used without StructuredDocument"); //$NON-NLS-1$ |
1831 |
Logger.log(Logger.WARNING, "StructuredTextEditor being used without StructuredDocument"); //$NON-NLS-1$ |
| 1816 |
String name = null; |
1832 |
String name = null; |
| 1817 |
if (input != null) { |
1833 |
if (input != null) { |
|
Lines 1999-2005
Link Here
|
| 1999 |
* @deprecated - can eventually be eliminated |
2015 |
* @deprecated - can eventually be eliminated |
| 2000 |
*/ |
2016 |
*/ |
| 2001 |
private void setModel(IStructuredModel newModel) { |
2017 |
private void setModel(IStructuredModel newModel) { |
| 2002 |
Assert.isNotNull(getDocumentProvider(), "document provider can not be null when setting model"); |
2018 |
Assert.isNotNull(getDocumentProvider(), "document provider can not be null when setting model"); //$NON-NLS-1$ |
| 2003 |
if (fStructuredModel != null) { |
2019 |
if (fStructuredModel != null) { |
| 2004 |
if (fStructuredModel.getStructuredDocument() != null) { |
2020 |
if (fStructuredModel.getStructuredDocument() != null) { |
| 2005 |
fStructuredModel.getStructuredDocument().removeDocumentListener(getInternalDocumentListener()); |
2021 |
fStructuredModel.getStructuredDocument().removeDocumentListener(getInternalDocumentListener()); |