mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Remove deprecated function warnings (patch from Thomas FLetcher)
This commit is contained in:
parent
ff8adf11c3
commit
73e5cca874
5 changed files with 14 additions and 11 deletions
|
@ -24,9 +24,7 @@ public class ClearConsoleAction extends Action {
|
||||||
CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_CLEAR_CONSOLE);
|
CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_CLEAR_CONSOLE);
|
||||||
fConsoleView= view;
|
fConsoleView= view;
|
||||||
setToolTipText(CPlugin.getResourceString("ClearOutputAction.tooltip"));
|
setToolTipText(CPlugin.getResourceString("ClearOutputAction.tooltip"));
|
||||||
WorkbenchHelp.setHelp(
|
WorkbenchHelp.setHelp(this, ICHelpContextIds.CLEAR_CONSOLE_ACTION);
|
||||||
this,
|
|
||||||
new Object[] { ICHelpContextIds.CLEAR_CONSOLE_ACTION });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class CDocumentProvider extends FileDocumentProvider {
|
||||||
IStorage storage= ((IStorageEditorInput) element).getStorage();
|
IStorage storage= ((IStorageEditorInput) element).getStorage();
|
||||||
|
|
||||||
document= new CDocument();
|
document= new CDocument();
|
||||||
setDocumentContent(document, storage.getContents());
|
setDocumentContent(document, storage.getContents(), getDefaultEncoding());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.eclipse.jface.text.rules.IRule;
|
||||||
import org.eclipse.jface.text.rules.IToken;
|
import org.eclipse.jface.text.rules.IToken;
|
||||||
import org.eclipse.jface.text.rules.IWordDetector;
|
import org.eclipse.jface.text.rules.IWordDetector;
|
||||||
import org.eclipse.jface.text.rules.MultiLineRule;
|
import org.eclipse.jface.text.rules.MultiLineRule;
|
||||||
|
import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
|
||||||
import org.eclipse.jface.text.rules.RuleBasedScanner;
|
import org.eclipse.jface.text.rules.RuleBasedScanner;
|
||||||
import org.eclipse.jface.text.rules.Token;
|
import org.eclipse.jface.text.rules.Token;
|
||||||
import org.eclipse.jface.text.rules.WordRule;
|
import org.eclipse.jface.text.rules.WordRule;
|
||||||
|
@ -20,7 +21,7 @@ import org.eclipse.jface.text.rules.WordRule;
|
||||||
/**
|
/**
|
||||||
* This scanner recognizes comments
|
* This scanner recognizes comments
|
||||||
*/
|
*/
|
||||||
public class AsmPartitionScanner extends RuleBasedScanner {
|
public class AsmPartitionScanner extends RuleBasedPartitionScanner {
|
||||||
|
|
||||||
|
|
||||||
private final static String SKIP= "__skip";
|
private final static String SKIP= "__skip";
|
||||||
|
|
|
@ -10,6 +10,8 @@ import org.eclipse.cdt.internal.ui.text.util.CColorManager;
|
||||||
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
import org.eclipse.jface.text.IDocumentPartitioner;
|
import org.eclipse.jface.text.IDocumentPartitioner;
|
||||||
|
import org.eclipse.jface.text.rules.DefaultPartitioner;
|
||||||
|
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
|
||||||
import org.eclipse.jface.text.rules.RuleBasedPartitioner;
|
import org.eclipse.jface.text.rules.RuleBasedPartitioner;
|
||||||
import org.eclipse.jface.text.rules.RuleBasedScanner;
|
import org.eclipse.jface.text.rules.RuleBasedScanner;
|
||||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||||
|
@ -88,7 +90,7 @@ public class AsmTextTools {
|
||||||
/**
|
/**
|
||||||
* Gets the partition scanner used.
|
* Gets the partition scanner used.
|
||||||
*/
|
*/
|
||||||
public RuleBasedScanner getPartitionScanner() {
|
public IPartitionTokenScanner getPartitionScanner() {
|
||||||
return fPartitionScanner;
|
return fPartitionScanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +103,8 @@ public class AsmTextTools {
|
||||||
AsmPartitionScanner.C_MULTILINE_COMMENT
|
AsmPartitionScanner.C_MULTILINE_COMMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
return new RuleBasedPartitioner(getPartitionScanner(), types);
|
//return new RuleBasedPartitioner(getPartitionScanner(), types);
|
||||||
|
return new DefaultPartitioner(getPartitionScanner(), types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.IEditorInput;
|
import org.eclipse.ui.IEditorInput;
|
||||||
import org.eclipse.ui.IEditorPart;
|
import org.eclipse.ui.IEditorPart;
|
||||||
|
import org.eclipse.ui.IEditorReference;
|
||||||
import org.eclipse.ui.IFileEditorInput;
|
import org.eclipse.ui.IFileEditorInput;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
|
@ -66,10 +67,10 @@ public class MakeAction extends Action {
|
||||||
IWorkbenchPage [] pages = windows[i].getPages();
|
IWorkbenchPage [] pages = windows[i].getPages();
|
||||||
for (int j = 0; j < pages.length; j++) {
|
for (int j = 0; j < pages.length; j++) {
|
||||||
IWorkbenchPage page = pages[j];
|
IWorkbenchPage page = pages[j];
|
||||||
IEditorPart[] editors = page.getEditors();
|
IEditorReference[] editorReferences = page.getEditorReferences();
|
||||||
for (int k = 0; k < editors.length; k++) {
|
for (int k = 0; k < editorReferences.length; k++) {
|
||||||
IEditorPart editor = editors[k];
|
IEditorPart editor = editorReferences[k].getEditor(false);
|
||||||
if (editor.isDirty()) {
|
if (editor != null && editor.isDirty()) {
|
||||||
IEditorInput input = editor.getEditorInput();
|
IEditorInput input = editor.getEditorInput();
|
||||||
if (input instanceof IFileEditorInput) {
|
if (input instanceof IFileEditorInput) {
|
||||||
IFile inputFile = ((IFileEditorInput)input).getFile();
|
IFile inputFile = ((IFileEditorInput)input).getFile();
|
||||||
|
|
Loading…
Add table
Reference in a new issue