1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Cleanup of the warning from eclipse 2.1 compiler

static vs non-static access of fields and method.
This commit is contained in:
Alain Magloire 2003-02-04 20:00:46 +00:00
parent 02cb4b545e
commit a959342b9a
35 changed files with 70 additions and 69 deletions

View file

@ -49,7 +49,7 @@ public class Templates extends TemplateSet {
} }
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
ErrorDialog.openError(null, ErrorDialog.openError(null,
TemplateMessages.getString("Templates.error.title"), //$NON-NLS-1$ TemplateMessages.getString("Templates.error.title"), //$NON-NLS-1$
e.getMessage(), e.getStatus()); e.getMessage(), e.getStatus());

View file

@ -136,7 +136,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
} }
void bringConsoleOnTop() { void bringConsoleOnTop() {
IWorkbenchWindow window = CUIPlugin.getActiveWorkbenchWindow(); IWorkbenchWindow window = CUIPlugin.getDefault().getActiveWorkbenchWindow();
if (window == null) if (window == null)
return; return;
IWorkbenchPage page = window.getActivePage(); IWorkbenchPage page = window.getActivePage();

View file

@ -41,7 +41,7 @@ public class CCompletionContributorManager {
return fInstance; return fInstance;
} }
public static IFunctionSummary getFunctionInfo(String name) { public IFunctionSummary getFunctionInfo(String name) {
if(!fContributorsLoaded) if(!fContributorsLoaded)
loadExtensions(); loadExtensions();
@ -55,7 +55,7 @@ public class CCompletionContributorManager {
return null; return null;
} }
public static IFunctionSummary[] getMatchingFunctions(String frag) { public IFunctionSummary[] getMatchingFunctions(String frag) {
if(!fContributorsLoaded) if(!fContributorsLoaded)
loadExtensions(); loadExtensions();
IFunctionSummary[] fs = null; IFunctionSummary[] fs = null;
@ -83,7 +83,7 @@ public class CCompletionContributorManager {
return fs; return fs;
} }
static private void loadExtensions() { private void loadExtensions() {
fContributorsLoaded = true; fContributorsLoaded = true;
fCompletionContributors= new ArrayList(2); fCompletionContributors= new ArrayList(2);

View file

@ -28,7 +28,7 @@ public class CPluginImages {
try { try {
fgIconBaseURL= new URL(CUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); fgIconBaseURL= new URL(CUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" );
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
} }
} }
private static final String NAME_PREFIX= CUIPlugin.PLUGIN_ID + '.'; private static final String NAME_PREFIX= CUIPlugin.PLUGIN_ID + '.';
@ -155,7 +155,7 @@ public class CPluginImages {
try { try {
return new URL(fgIconBaseURL, buffer.toString()); return new URL(fgIconBaseURL, buffer.toString());
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
return null; return null;
} }
} }

View file

@ -63,7 +63,7 @@ public class ErrorTickAdornmentProvider implements IAdornmentProvider {
return getErrorTicksFromMarkers((IResource) obj, IResource.DEPTH_INFINITE, null); return getErrorTicksFromMarkers((IResource) obj, IResource.DEPTH_INFINITE, null);
} }
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
} }
return 0; return 0;
} }

View file

@ -78,7 +78,7 @@ public class AddIncludeOnSelectionAction extends Action implements IUpdate {
throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null)); throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null));
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
} }
} }
return unit; return unit;

View file

@ -75,7 +75,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS
try { try {
fInput.update(); fInput.update();
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
fInput= null; fInput= null;
return; return;
} }
@ -165,7 +165,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS
treeViewer.setInput(fInput); treeViewer.setInput(fInput);
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
fInput= null; fInput= null;
} }
} }

View file

@ -657,7 +657,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener {
MenuManager search= new MenuManager("Search", IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$ MenuManager search= new MenuManager("Search", IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$
menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, search); menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, search);
if(fSearchForReferencesAction.canActionBeAdded(getSelectionProvider().getSelection())) { if(SearchForReferencesAction.canActionBeAdded(getSelectionProvider().getSelection())) {
search.add(fSearchForReferencesAction); search.add(fSearchForReferencesAction);
} }

View file

@ -36,7 +36,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
public SelectionAction(String prefix, int operation) { public SelectionAction(String prefix, int operation) {
super(CUIPlugin.getDefault().getResourceBundle(), prefix, null); super(CUIPlugin.getResourceBundle(), prefix, null);
fOperationCode= operation; fOperationCode= operation;
setEnabled(false); setEnabled(false);
} }

View file

@ -58,7 +58,7 @@ public class DefaultCEditorTextHover implements ITextHover
// We are just doing some C, call the Help to get info // We are just doing some C, call the Help to get info
IFunctionSummary fs = CCompletionContributorManager.getFunctionInfo(expression); IFunctionSummary fs = CCompletionContributorManager.getDefault().getFunctionInfo(expression);
if(fs != null) { if(fs != null) {
buffer.append("<b>" + HTMLPrinter.convertToHTMLContent(expression) + buffer.append("<b>" + HTMLPrinter.convertToHTMLContent(expression) +
"()</b> - " + HTMLPrinter.convertToHTMLContent(fs.getSummary()) + "()</b> - " + HTMLPrinter.convertToHTMLContent(fs.getSummary()) +

View file

@ -112,9 +112,9 @@ public class OpenIncludeAction extends Action {
} }
} }
} catch (CModelException e) { } catch (CModelException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
} }
} }
@ -143,7 +143,7 @@ public class OpenIncludeAction extends Action {
} }
}; };
ElementListSelectionDialog dialog= new ElementListSelectionDialog(CUIPlugin.getActiveWorkbenchShell(), renderer, false, false); ElementListSelectionDialog dialog= new ElementListSelectionDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), renderer, false, false);
dialog.setTitle(CUIPlugin.getResourceString(DIALOG_TITLE)); dialog.setTitle(CUIPlugin.getResourceString(DIALOG_TITLE));
dialog.setMessage(CUIPlugin.getResourceString(DIALOG_MESSAGE)); dialog.setMessage(CUIPlugin.getResourceString(DIALOG_MESSAGE));
dialog.setElements(filesFound); dialog.setElements(filesFound);

View file

@ -180,11 +180,11 @@ public class OpenOnSelectionAction extends Action {
} }
} }
} catch (CModelException x) { } catch (CModelException x) {
CUIPlugin.log(x.getStatus()); CUIPlugin.getDefault().log(x.getStatus());
} catch (PartInitException x) { } catch (PartInitException x) {
CUIPlugin.log(x); CUIPlugin.getDefault().log(x);
} catch (CoreException x) { } catch (CoreException x) {
CUIPlugin.log(x); CUIPlugin.getDefault().log(x);
} }
} }

View file

@ -970,7 +970,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
buffer.append(separator); buffer.append(separator);
} }
} catch (IOException io) { } catch (IOException io) {
CUIPlugin.log(io); CUIPlugin.getDefault().log(io);
} finally { } finally {
if (reader != null) { if (reader != null) {
try { reader.close(); } catch (IOException e) {} try { reader.close(); } catch (IOException e) {}

View file

@ -88,7 +88,7 @@ public class CLaunchingPropertyPage extends PropertyPage {
IFile file= getInputFile(); IFile file= getInputFile();
isCProject= (file.getProject().hasNature(CProjectNature.C_NATURE_ID)); isCProject= (file.getProject().hasNature(CProjectNature.C_NATURE_ID));
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
} }
if (isCProject) { if (isCProject) {
@ -122,7 +122,7 @@ public class CLaunchingPropertyPage extends PropertyPage {
fWorkingDirField.setText(file.getParent().getLocation().toOSString()); fWorkingDirField.setText(file.getParent().getLocation().toOSString());
} }
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
} }
} }
} }
@ -138,7 +138,7 @@ public class CLaunchingPropertyPage extends PropertyPage {
file.setPersistentProperty(fWorkingDirPropertyName, fWorkingDirField.getText()); file.setPersistentProperty(fWorkingDirPropertyName, fWorkingDirField.getText());
} catch (CoreException e) { } catch (CoreException e) {
ErrorDialog.openError(fShell, "Error", null, e.getStatus()); ErrorDialog.openError(fShell, "Error", null, e.getStatus());
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
return false; return false;
} }
} }

View file

@ -349,7 +349,7 @@ public class EditTemplateDialog extends StatusDialog {
try { try {
fTranslator.translate(event.getDocumentEvent().getDocument().get()); fTranslator.translate(event.getDocumentEvent().getDocument().get());
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
// XXX dialog // XXX dialog
} }

View file

@ -44,6 +44,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableLayout; import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
@ -368,7 +369,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
template.setContext(contextTypeName); //$NON-NLS-1$ template.setContext(contextTypeName); //$NON-NLS-1$
EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false); EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false);
if (dialog.open() == dialog.OK) { if (dialog.open() == Window.OK) {
fTemplates.add(template); fTemplates.add(template);
fTableViewer.refresh(); fTableViewer.refresh();
fTableViewer.setChecked(template, template.isEnabled()); fTableViewer.setChecked(template, template.isEnabled());
@ -390,7 +391,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
private void edit(Template template) { private void edit(Template template) {
Template newTemplate= new Template(template); Template newTemplate= new Template(template);
EditTemplateDialog dialog= new EditTemplateDialog(getShell(), newTemplate, true); EditTemplateDialog dialog= new EditTemplateDialog(getShell(), newTemplate, true);
if (dialog.open() == dialog.OK) { if (dialog.open() == Window.OK) {
if (!newTemplate.getName().equals(template.getName()) && if (!newTemplate.getName().equals(template.getName()) &&
MessageDialog.openQuestion(getShell(), MessageDialog.openQuestion(getShell(),
@ -464,7 +465,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
try { try {
templateSet.saveToFile(file); templateSet.saveToFile(file);
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openWriteErrorDialog(e); openWriteErrorDialog(e);
} }
} }
@ -520,7 +521,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
try { try {
fTemplates.restoreDefaults(); fTemplates.restoreDefaults();
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openReadErrorDialog(e); openReadErrorDialog(e);
} }
@ -540,7 +541,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
try { try {
fTemplates.save(); fTemplates.save();
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openWriteErrorDialog(e); openWriteErrorDialog(e);
} }
@ -554,7 +555,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
try { try {
fTemplates.reset(); fTemplates.reset();
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openReadErrorDialog(e); openReadErrorDialog(e);
} }

View file

@ -161,7 +161,7 @@ public class CAutoIndentStrategy extends DefaultAutoIndentStrategy {
} }
} }
} catch (BadLocationException excp) { } catch (BadLocationException excp) {
CUIPlugin.log(excp); CUIPlugin.getDefault().log(excp);
} }
} }
@ -194,7 +194,7 @@ public class CAutoIndentStrategy extends DefaultAutoIndentStrategy {
} catch (BadLocationException excp) { } catch (BadLocationException excp) {
CUIPlugin.log(excp); CUIPlugin.getDefault().log(excp);
} }
} }

View file

@ -169,7 +169,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
results= evalProposals(document, offset, length); results= evalProposals(document, offset, length);
} }
} catch (Exception e) { } catch (Exception e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
} }
if(results == null) if(results == null)
@ -181,7 +181,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
fTemplateEngine.complete(viewer, documentOffset, null); fTemplateEngine.complete(viewer, documentOffset, null);
} catch (Exception x) { } catch (Exception x) {
System.out.println("Template Exception"); System.out.println("Template Exception");
CUIPlugin.log(x); CUIPlugin.getDefault().log(x);
} }
ICCompletionProposal[] templateResults= fTemplateEngine.getResults(); ICCompletionProposal[] templateResults= fTemplateEngine.getResults();

View file

@ -149,7 +149,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
} catch (IOException e) { } catch (IOException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
return null; return null;
} finally { } finally {

View file

@ -75,7 +75,7 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate
try { try {
document.replace(fReplacePosition.getOffset() + fReplaceDeltaOffset, fReplaceLength, fReplaceText); document.replace(fReplacePosition.getOffset() + fReplaceDeltaOffset, fReplaceLength, fReplaceText);
} catch (BadLocationException e) { } catch (BadLocationException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
// TBD // TBD
} }
document.addDocumentListener(owner); document.addDocumentListener(owner);
@ -140,7 +140,7 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate
try { try {
fDocument.addPosition(LINKED_POSITION, new TypedPosition(offset, length, type)); fDocument.addPosition(LINKED_POSITION, new TypedPosition(offset, length, type));
} catch (BadPositionCategoryException e) { } catch (BadPositionCategoryException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Assert.isTrue(false); Assert.isTrue(false);
} }
} }
@ -184,11 +184,11 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate
fDocument.removePositionCategory(LINKED_POSITION); fDocument.removePositionCategory(LINKED_POSITION);
} catch (BadLocationException e) { } catch (BadLocationException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Assert.isTrue(false); Assert.isTrue(false);
} catch (BadPositionCategoryException e) { } catch (BadPositionCategoryException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Assert.isTrue(false); Assert.isTrue(false);
} finally { } finally {
@ -264,7 +264,7 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate
return positions; return positions;
} catch (BadPositionCategoryException e) { } catch (BadPositionCategoryException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Assert.isTrue(false); Assert.isTrue(false);
} }

View file

@ -184,7 +184,7 @@ public class LinkedPositionUI implements LinkedPositionListener,
openErrorDialog(fViewer.getTextWidget().getShell(), e); openErrorDialog(fViewer.getTextWidget().getShell(), e);
} catch (BadPositionCategoryException e) { } catch (BadPositionCategoryException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Assert.isTrue(false); Assert.isTrue(false);
} }
@ -272,7 +272,7 @@ public class LinkedPositionUI implements LinkedPositionListener,
((flags & DOCUMENT_CHANGED) != 0)); ((flags & DOCUMENT_CHANGED) != 0));
} catch (BadPositionCategoryException e) { } catch (BadPositionCategoryException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Assert.isTrue(false); Assert.isTrue(false);
} }

View file

@ -100,11 +100,11 @@ public class TemplateProposal implements ICCompletionProposal {
fSelectedRegion= editor.getSelectedRegion(); fSelectedRegion= editor.getSelectedRegion();
} catch (BadLocationException e) { } catch (BadLocationException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openErrorDialog(e); openErrorDialog(e);
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openErrorDialog(e); openErrorDialog(e);
} }
} }
@ -139,7 +139,7 @@ public class TemplateProposal implements ICCompletionProposal {
return textToHTML(fTemplateBuffer.getString()); return textToHTML(fTemplateBuffer.getString());
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
openErrorDialog(e); openErrorDialog(e);
return null; return null;

View file

@ -59,7 +59,7 @@ public class TemplateVariableProposal implements ICompletionProposal {
fSelection= new Point(fOffset + variable.length(), 0); fSelection= new Point(fOffset + variable.length(), 0);
} catch (BadLocationException e) { } catch (BadLocationException e) {
CUIPlugin.log(e); CUIPlugin.getDefault().log(e);
Shell shell= fViewer.getTextWidget().getShell(); Shell shell= fViewer.getTextWidget().getShell();
MessageDialog.openError(shell, TemplateMessages.getString("TemplateVariableProposal.error.title"), e.getMessage()); //$NON-NLS-1$ MessageDialog.openError(shell, TemplateMessages.getString("TemplateVariableProposal.error.title"), e.getMessage()); //$NON-NLS-1$

View file

@ -40,7 +40,7 @@ public class EditorUtility {
} }
public static IEditorPart openInEditor (IFile file) throws PartInitException { public static IEditorPart openInEditor (IFile file) throws PartInitException {
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
if (window != null) { if (window != null) {
IWorkbenchPage p= window.getActivePage(); IWorkbenchPage p= window.getActivePage();
if (p != null) { if (p != null) {
@ -88,7 +88,7 @@ public class EditorUtility {
public static IEditorPart openInEditor (IStorage store, String name) throws PartInitException { public static IEditorPart openInEditor (IStorage store, String name) throws PartInitException {
IEditorInput ei = new ExternalEditorInput(store); IEditorInput ei = new ExternalEditorInput(store);
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
if (window != null) { if (window != null) {
IWorkbenchPage p = window.getActivePage(); IWorkbenchPage p = window.getActivePage();
if (p != null) { if (p != null) {

View file

@ -54,7 +54,7 @@ public class ProblemMarkerManager implements IResourceChangeListener {
return false; return false;
} }
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
return false; return false;
} }
} }
@ -110,7 +110,7 @@ public class ProblemMarkerManager implements IResourceChangeListener {
if (delta != null) if (delta != null)
delta.accept(new ProjectErrorVisitor(changedElements)); delta.accept(new ProjectErrorVisitor(changedElements));
} catch (CoreException e) { } catch (CoreException e) {
CUIPlugin.log(e.getStatus()); CUIPlugin.getDefault().log(e.getStatus());
} }
if (changedElements.size() > 0) { if (changedElements.size() > 0) {

View file

@ -26,7 +26,7 @@ public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowA
wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection()); wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection());
wizard.setNeedsProgressMonitor(true); wizard.setNeedsProgressMonitor(true);
WizardDialog dialog= WizardDialog dialog=
new WizardDialog(CUIPlugin.getActiveWorkbenchShell(), wizard); new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard);
dialog.create(); dialog.create();
dialog.getShell().setText( dialog.getShell().setText(
CUIPlugin.getResourceString("OpenNewFileWizardAction.title")); //$NON-NLS-1$ CUIPlugin.getResourceString("OpenNewFileWizardAction.title")); //$NON-NLS-1$
@ -35,7 +35,7 @@ public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowA
protected IStructuredSelection getCurrentSelection() { protected IStructuredSelection getCurrentSelection() {
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
if (window != null) { if (window != null) {
ISelection selection= window.getSelectionService().getSelection(); ISelection selection= window.getSelectionService().getSelection();
if (selection instanceof IStructuredSelection) { if (selection instanceof IStructuredSelection) {

View file

@ -24,7 +24,7 @@ public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindo
wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection()); wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection());
wizard.setNeedsProgressMonitor(true); wizard.setNeedsProgressMonitor(true);
WizardDialog dialog= WizardDialog dialog=
new WizardDialog(CUIPlugin.getActiveWorkbenchShell(), wizard); new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard);
dialog.create(); dialog.create();
dialog.getShell().setText( dialog.getShell().setText(
CUIPlugin.getResourceString("OpenNewFolderWizardAction.title")); //$NON-NLS-1$ CUIPlugin.getResourceString("OpenNewFolderWizardAction.title")); //$NON-NLS-1$
@ -32,7 +32,7 @@ public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindo
} }
protected IStructuredSelection getCurrentSelection() { protected IStructuredSelection getCurrentSelection() {
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
if (window != null) { if (window != null) {
ISelection selection= window.getSelectionService().getSelection(); ISelection selection= window.getSelectionService().getSelection();
if (selection instanceof IStructuredSelection) { if (selection instanceof IStructuredSelection) {

View file

@ -76,7 +76,7 @@ public class StringDialogField extends DialogField {
} }
protected static MGridData gridDataForText(int span) { protected static MGridData gridDataForText(int span) {
MGridData gd= new MGridData(); MGridData gd= new MGridData();
gd.horizontalAlignment= gd.FILL; gd.horizontalAlignment= MGridData.FILL;
gd.grabExcessHorizontalSpace= true; gd.grabExcessHorizontalSpace= true;
gd.grabColumn= 0; gd.grabColumn= 0;
gd.horizontalSpan= span; gd.horizontalSpan= span;

View file

@ -656,7 +656,7 @@ public final class MGridLayout extends Layout {
} else if (vAlign == MGridData.END) { } else if (vAlign == MGridData.END) {
widgetY= widgetY + spannedHeight - childExtent.y; widgetY= widgetY + spannedHeight - childExtent.y;
} else { } else {
widgetY= widgetY; //widgetY= widgetY;
} }
if (vAlign == MGridData.FILL) { if (vAlign == MGridData.FILL) {
widgetH= spannedHeight; widgetH= spannedHeight;

View file

@ -103,11 +103,11 @@ public class CUIPlugin extends AbstractUIPlugin {
return fgResourceBundle; return fgResourceBundle;
} }
public static IWorkbenchWindow getActiveWorkbenchWindow() { public IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow(); return getDefault().getWorkbench().getActiveWorkbenchWindow();
} }
public static Shell getActiveWorkbenchShell() { public Shell getActiveWorkbenchShell() {
return getActiveWorkbenchWindow().getShell(); return getActiveWorkbenchWindow().getShell();
} }
@ -115,11 +115,11 @@ public class CUIPlugin extends AbstractUIPlugin {
return fgCPlugin; return fgCPlugin;
} }
public static void log(Throwable e) { public void log(Throwable e) {
log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e));
} }
public static void log(IStatus status) { public void log(IStatus status) {
getDefault().getLog().log(status); getDefault().getLog().log(status);
} }

View file

@ -259,12 +259,12 @@ public abstract class CProjectWizard extends BasicNewResourceWizard implements I
IStatus status= ((CoreException)th).getStatus(); IStatus status= ((CoreException)th).getStatus();
if (status != null) { if (status != null) {
ErrorDialog.openError(shell, title, message, status); ErrorDialog.openError(shell, title, message, status);
CUIPlugin.log(status); CUIPlugin.getDefault().log(status);
return false; return false;
} }
} }
MessageDialog.openError(shell, title, message); MessageDialog.openError(shell, title, message);
CUIPlugin.log(th); CUIPlugin.getDefault().log(th);
try { try {
getProjectHandle().delete(false, false, null); getProjectHandle().delete(false, false, null);
} catch (CoreException ignore) { } catch (CoreException ignore) {

View file

@ -106,7 +106,7 @@ public abstract class StdMakeProjectWizard extends CProjectWizard {
} }
public String getProjectID() { public String getProjectID() {
return CCorePlugin.getDefault().PLUGIN_ID + ".make"; return CCorePlugin.PLUGIN_ID + ".make";
} }
} }

View file

@ -55,9 +55,9 @@ public class TabFolderPage extends WizardPage implements IValidation {
tabFolder.setLayout(new TabFolderLayout()); tabFolder.setLayout(new TabFolderLayout());
MGridData gd= new MGridData(); MGridData gd= new MGridData();
gd.horizontalAlignment= gd.FILL; gd.horizontalAlignment= MGridData.FILL;
gd.grabExcessHorizontalSpace= true; gd.grabExcessHorizontalSpace= true;
gd.verticalAlignment= gd.FILL; gd.verticalAlignment= MGridData.FILL;
gd.grabExcessVerticalSpace= true; gd.grabExcessVerticalSpace= true;
tabFolder.setLayoutData(gd); tabFolder.setLayoutData(gd);

View file

@ -139,7 +139,7 @@ public abstract class ConversionWizard
* The default if a make project * The default if a make project
*/ */
public String getProjectID() { public String getProjectID() {
return CCorePlugin.getDefault().PLUGIN_ID + ".make";//$NON-NLS-1$ return CCorePlugin.PLUGIN_ID + ".make";//$NON-NLS-1$
} }
/** /**

View file

@ -504,14 +504,14 @@ public abstract class ConvertProjectWizardPage
} }
} }
protected void addCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException{ protected void addCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException{
CCorePlugin.getDefault().convertProjectToC(project, monitor, CCorePlugin.getDefault().PLUGIN_ID + ".make", addMakeBuilder); //$NON-NLS-1$ CCorePlugin.getDefault().convertProjectToC(project, monitor, CCorePlugin.PLUGIN_ID + ".make", addMakeBuilder); //$NON-NLS-1$
} }
protected void addCCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException{ protected void addCCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException{
if (project.hasNature(CProjectNature.C_NATURE_ID)) { if (project.hasNature(CProjectNature.C_NATURE_ID)) {
CCorePlugin.getDefault().convertProjectFromCtoCC(project, monitor); //$NON-NLS-1$ CCorePlugin.getDefault().convertProjectFromCtoCC(project, monitor); //$NON-NLS-1$
} else { } else {
CCorePlugin.getDefault().convertProjectToCC(project, monitor, CCorePlugin.getDefault().PLUGIN_ID + ".make", addMakeBuilder); //$NON-NLS-1$ CCorePlugin.getDefault().convertProjectToCC(project, monitor, CCorePlugin.PLUGIN_ID + ".make", addMakeBuilder); //$NON-NLS-1$
} }
} }