From a959342b9a2baf5453f006a0fa2d64f7ddd4c7e1 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Tue, 4 Feb 2003 20:00:46 +0000 Subject: [PATCH] Cleanup of the warning from eclipse 2.1 compiler static vs non-static access of fields and method. --- .../cdt/internal/corext/template/Templates.java | 2 +- .../cdt/internal/ui/BuildConsoleManager.java | 2 +- .../internal/ui/CCompletionContributorManager.java | 6 +++--- .../org/eclipse/cdt/internal/ui/CPluginImages.java | 4 ++-- .../cdt/internal/ui/ErrorTickAdornmentProvider.java | 2 +- .../ui/editor/AddIncludeOnSelectionAction.java | 2 +- .../cdt/internal/ui/editor/CContentOutlinePage.java | 4 ++-- .../org/eclipse/cdt/internal/ui/editor/CEditor.java | 2 +- .../ui/editor/CEditorActionContributor.java | 2 +- .../internal/ui/editor/DefaultCEditorTextHover.java | 2 +- .../cdt/internal/ui/editor/OpenIncludeAction.java | 6 +++--- .../internal/ui/editor/OpenOnSelectionAction.java | 6 +++--- .../ui/preferences/CEditorPreferencePage.java | 2 +- .../ui/preferences/CLaunchingPropertyPage.java | 6 +++--- .../internal/ui/preferences/EditTemplateDialog.java | 2 +- .../ui/preferences/TemplatePreferencePage.java | 13 +++++++------ .../cdt/internal/ui/text/CAutoIndentStrategy.java | 4 ++-- .../cdt/internal/ui/text/CCompletionProcessor.java | 4 ++-- .../cdt/internal/ui/text/HTMLTextPresenter.java | 2 +- .../ui/text/link/LinkedPositionManager.java | 10 +++++----- .../cdt/internal/ui/text/link/LinkedPositionUI.java | 4 ++-- .../internal/ui/text/template/TemplateProposal.java | 6 +++--- .../ui/text/template/TemplateVariableProposal.java | 2 +- .../eclipse/cdt/internal/ui/util/EditorUtility.java | 4 ++-- .../cdt/internal/ui/util/ProblemMarkerManager.java | 4 ++-- .../ui/wizards/OpenNewFileWizardAction.java | 4 ++-- .../ui/wizards/OpenNewFolderWizardAction.java | 4 ++-- .../ui/wizards/dialogfields/StringDialogField.java | 2 +- .../cdt/internal/ui/wizards/swt/MGridLayout.java | 2 +- .../src/org/eclipse/cdt/ui/CUIPlugin.java | 8 ++++---- .../org/eclipse/cdt/ui/wizards/CProjectWizard.java | 4 ++-- .../cdt/ui/wizards/StdMakeProjectWizard.java | 2 +- .../org/eclipse/cdt/ui/wizards/TabFolderPage.java | 4 ++-- .../cdt/ui/wizards/conversion/ConversionWizard.java | 2 +- .../conversion/ConvertProjectWizardPage.java | 4 ++-- 35 files changed, 70 insertions(+), 69 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java index 0fd98ca32f1..64056a442aa 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java @@ -49,7 +49,7 @@ public class Templates extends TemplateSet { } } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); ErrorDialog.openError(null, TemplateMessages.getString("Templates.error.title"), //$NON-NLS-1$ e.getMessage(), e.getStatus()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java index 272c4be9c85..79cd8d46f31 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java @@ -136,7 +136,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang } void bringConsoleOnTop() { - IWorkbenchWindow window = CUIPlugin.getActiveWorkbenchWindow(); + IWorkbenchWindow window = CUIPlugin.getDefault().getActiveWorkbenchWindow(); if (window == null) return; IWorkbenchPage page = window.getActivePage(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java index fed2a78621f..556fb3d3760 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java @@ -41,7 +41,7 @@ public class CCompletionContributorManager { return fInstance; } - public static IFunctionSummary getFunctionInfo(String name) { + public IFunctionSummary getFunctionInfo(String name) { if(!fContributorsLoaded) loadExtensions(); @@ -55,7 +55,7 @@ public class CCompletionContributorManager { return null; } - public static IFunctionSummary[] getMatchingFunctions(String frag) { + public IFunctionSummary[] getMatchingFunctions(String frag) { if(!fContributorsLoaded) loadExtensions(); IFunctionSummary[] fs = null; @@ -83,7 +83,7 @@ public class CCompletionContributorManager { return fs; } - static private void loadExtensions() { + private void loadExtensions() { fContributorsLoaded = true; fCompletionContributors= new ArrayList(2); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java index 5041166e620..8560c809362 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java @@ -28,7 +28,7 @@ public class CPluginImages { try { fgIconBaseURL= new URL(CUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); } catch (MalformedURLException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); } } private static final String NAME_PREFIX= CUIPlugin.PLUGIN_ID + '.'; @@ -155,7 +155,7 @@ public class CPluginImages { try { return new URL(fgIconBaseURL, buffer.toString()); } catch (MalformedURLException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); return null; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java index d43520824a6..da9c29a6bd4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java @@ -63,7 +63,7 @@ public class ErrorTickAdornmentProvider implements IAdornmentProvider { return getErrorTicksFromMarkers((IResource) obj, IResource.DEPTH_INFINITE, null); } } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); } return 0; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java index b85ee9af0e9..c676d46c052 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java @@ -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)); } catch (CoreException e) { - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); } } return unit; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java index 8272487baf6..47c80da21ad 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java @@ -75,7 +75,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS try { fInput.update(); } catch (CoreException e) { - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); fInput= null; return; } @@ -165,7 +165,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS treeViewer.setInput(fInput); } catch (CoreException e) { - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); fInput= null; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index 5c2ed5875a4..d9487f40574 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -657,7 +657,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener { MenuManager search= new MenuManager("Search", IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$ menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, search); - if(fSearchForReferencesAction.canActionBeAdded(getSelectionProvider().getSelection())) { + if(SearchForReferencesAction.canActionBeAdded(getSelectionProvider().getSelection())) { search.add(fSearchForReferencesAction); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java index 0e93cb182ff..5e33667f8f1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java @@ -36,7 +36,7 @@ public class CEditorActionContributor extends TextEditorActionContributor { public SelectionAction(String prefix, int operation) { - super(CUIPlugin.getDefault().getResourceBundle(), prefix, null); + super(CUIPlugin.getResourceBundle(), prefix, null); fOperationCode= operation; setEnabled(false); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java index 9ff5d9b91ee..940b55c26ef 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java @@ -58,7 +58,7 @@ public class DefaultCEditorTextHover implements ITextHover // 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) { buffer.append("" + HTMLPrinter.convertToHTMLContent(expression) + "() - " + HTMLPrinter.convertToHTMLContent(fs.getSummary()) + diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java index 8936db3cdd4..fff2780f0c5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java @@ -112,9 +112,9 @@ public class OpenIncludeAction extends Action { } } } catch (CModelException e) { - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); } 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.setMessage(CUIPlugin.getResourceString(DIALOG_MESSAGE)); dialog.setElements(filesFound); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java index a07371debe9..7b02092e51a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java @@ -180,11 +180,11 @@ public class OpenOnSelectionAction extends Action { } } } catch (CModelException x) { - CUIPlugin.log(x.getStatus()); + CUIPlugin.getDefault().log(x.getStatus()); } catch (PartInitException x) { - CUIPlugin.log(x); + CUIPlugin.getDefault().log(x); } catch (CoreException x) { - CUIPlugin.log(x); + CUIPlugin.getDefault().log(x); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java index f92cfa5bcdb..617bb176fee 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java @@ -970,7 +970,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP buffer.append(separator); } } catch (IOException io) { - CUIPlugin.log(io); + CUIPlugin.getDefault().log(io); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) {} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java index 4f0e9990b93..55a77abe3f4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java @@ -88,7 +88,7 @@ public class CLaunchingPropertyPage extends PropertyPage { IFile file= getInputFile(); isCProject= (file.getProject().hasNature(CProjectNature.C_NATURE_ID)); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); } if (isCProject) { @@ -122,7 +122,7 @@ public class CLaunchingPropertyPage extends PropertyPage { fWorkingDirField.setText(file.getParent().getLocation().toOSString()); } } 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()); } catch (CoreException e) { ErrorDialog.openError(fShell, "Error", null, e.getStatus()); - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); return false; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java index 7bb51aa585e..dffda338db2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java @@ -349,7 +349,7 @@ public class EditTemplateDialog extends StatusDialog { try { fTranslator.translate(event.getDocumentEvent().getDocument().get()); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); // XXX dialog } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java index 493ac4aa32e..844e4c04003 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java @@ -44,6 +44,7 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableLayout; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.layout.GridData; @@ -368,7 +369,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench template.setContext(contextTypeName); //$NON-NLS-1$ EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false); - if (dialog.open() == dialog.OK) { + if (dialog.open() == Window.OK) { fTemplates.add(template); fTableViewer.refresh(); fTableViewer.setChecked(template, template.isEnabled()); @@ -390,7 +391,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench private void edit(Template template) { Template newTemplate= new Template(template); EditTemplateDialog dialog= new EditTemplateDialog(getShell(), newTemplate, true); - if (dialog.open() == dialog.OK) { + if (dialog.open() == Window.OK) { if (!newTemplate.getName().equals(template.getName()) && MessageDialog.openQuestion(getShell(), @@ -464,7 +465,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench try { templateSet.saveToFile(file); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openWriteErrorDialog(e); } } @@ -520,7 +521,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench try { fTemplates.restoreDefaults(); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openReadErrorDialog(e); } @@ -540,7 +541,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench try { fTemplates.save(); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openWriteErrorDialog(e); } @@ -554,7 +555,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench try { fTemplates.reset(); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openReadErrorDialog(e); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java index 44bb8ee7dbe..0c18f9800f8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java @@ -161,7 +161,7 @@ public class CAutoIndentStrategy extends DefaultAutoIndentStrategy { } } } catch (BadLocationException excp) { - CUIPlugin.log(excp); + CUIPlugin.getDefault().log(excp); } } @@ -194,7 +194,7 @@ public class CAutoIndentStrategy extends DefaultAutoIndentStrategy { } catch (BadLocationException excp) { - CUIPlugin.log(excp); + CUIPlugin.getDefault().log(excp); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java index 71cab47ba4c..1ea8d5578c4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java @@ -169,7 +169,7 @@ public class CCompletionProcessor implements IContentAssistProcessor { results= evalProposals(document, offset, length); } } catch (Exception e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); } if(results == null) @@ -181,7 +181,7 @@ public class CCompletionProcessor implements IContentAssistProcessor { fTemplateEngine.complete(viewer, documentOffset, null); } catch (Exception x) { System.out.println("Template Exception"); - CUIPlugin.log(x); + CUIPlugin.getDefault().log(x); } ICCompletionProposal[] templateResults= fTemplateEngine.getResults(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java index d809348e1fb..8f8bcf35ede 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java @@ -149,7 +149,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation } catch (IOException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); return null; } finally { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java index ac615fe4b2e..21666b6199a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java @@ -75,7 +75,7 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate try { document.replace(fReplacePosition.getOffset() + fReplaceDeltaOffset, fReplaceLength, fReplaceText); } catch (BadLocationException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); // TBD } document.addDocumentListener(owner); @@ -140,7 +140,7 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate try { fDocument.addPosition(LINKED_POSITION, new TypedPosition(offset, length, type)); } catch (BadPositionCategoryException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Assert.isTrue(false); } } @@ -184,11 +184,11 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate fDocument.removePositionCategory(LINKED_POSITION); } catch (BadLocationException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Assert.isTrue(false); } catch (BadPositionCategoryException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Assert.isTrue(false); } finally { @@ -264,7 +264,7 @@ public class LinkedPositionManager implements IDocumentListener, IPositionUpdate return positions; } catch (BadPositionCategoryException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Assert.isTrue(false); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java index 0bdac5de4d8..f3baaa8164b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java @@ -184,7 +184,7 @@ public class LinkedPositionUI implements LinkedPositionListener, openErrorDialog(fViewer.getTextWidget().getShell(), e); } catch (BadPositionCategoryException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Assert.isTrue(false); } @@ -272,7 +272,7 @@ public class LinkedPositionUI implements LinkedPositionListener, ((flags & DOCUMENT_CHANGED) != 0)); } catch (BadPositionCategoryException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Assert.isTrue(false); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java index 048719a66ab..bc73c95ba8e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java @@ -100,11 +100,11 @@ public class TemplateProposal implements ICCompletionProposal { fSelectedRegion= editor.getSelectedRegion(); } catch (BadLocationException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openErrorDialog(e); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openErrorDialog(e); } } @@ -139,7 +139,7 @@ public class TemplateProposal implements ICCompletionProposal { return textToHTML(fTemplateBuffer.getString()); } catch (CoreException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); openErrorDialog(e); return null; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java index 2d03f24cc61..6cde736a8d4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java @@ -59,7 +59,7 @@ public class TemplateVariableProposal implements ICompletionProposal { fSelection= new Point(fOffset + variable.length(), 0); } catch (BadLocationException e) { - CUIPlugin.log(e); + CUIPlugin.getDefault().log(e); Shell shell= fViewer.getTextWidget().getShell(); MessageDialog.openError(shell, TemplateMessages.getString("TemplateVariableProposal.error.title"), e.getMessage()); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java index e4235e2582f..46b32048fb5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java @@ -40,7 +40,7 @@ public class EditorUtility { } public static IEditorPart openInEditor (IFile file) throws PartInitException { - IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); + IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); if (window != null) { IWorkbenchPage p= window.getActivePage(); if (p != null) { @@ -88,7 +88,7 @@ public class EditorUtility { public static IEditorPart openInEditor (IStorage store, String name) throws PartInitException { IEditorInput ei = new ExternalEditorInput(store); - IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); + IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); if (window != null) { IWorkbenchPage p = window.getActivePage(); if (p != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java index c2b1f075c27..2f94b8a662c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java @@ -54,7 +54,7 @@ public class ProblemMarkerManager implements IResourceChangeListener { return false; } } catch (CoreException e) { - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); return false; } } @@ -110,7 +110,7 @@ public class ProblemMarkerManager implements IResourceChangeListener { if (delta != null) delta.accept(new ProjectErrorVisitor(changedElements)); } catch (CoreException e) { - CUIPlugin.log(e.getStatus()); + CUIPlugin.getDefault().log(e.getStatus()); } if (changedElements.size() > 0) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java index 5e84dc31b57..5b80966105a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java @@ -26,7 +26,7 @@ public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowA wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection()); wizard.setNeedsProgressMonitor(true); WizardDialog dialog= - new WizardDialog(CUIPlugin.getActiveWorkbenchShell(), wizard); + new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard); dialog.create(); dialog.getShell().setText( CUIPlugin.getResourceString("OpenNewFileWizardAction.title")); //$NON-NLS-1$ @@ -35,7 +35,7 @@ public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowA protected IStructuredSelection getCurrentSelection() { - IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); + IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); if (window != null) { ISelection selection= window.getSelectionService().getSelection(); if (selection instanceof IStructuredSelection) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java index be3c13f4d64..8cb6dcbaa60 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java @@ -24,7 +24,7 @@ public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindo wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection()); wizard.setNeedsProgressMonitor(true); WizardDialog dialog= - new WizardDialog(CUIPlugin.getActiveWorkbenchShell(), wizard); + new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard); dialog.create(); dialog.getShell().setText( CUIPlugin.getResourceString("OpenNewFolderWizardAction.title")); //$NON-NLS-1$ @@ -32,7 +32,7 @@ public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindo } protected IStructuredSelection getCurrentSelection() { - IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow(); + IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); if (window != null) { ISelection selection= window.getSelectionService().getSelection(); if (selection instanceof IStructuredSelection) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java index 679fbf68756..955cd7ee2b4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java @@ -76,7 +76,7 @@ public class StringDialogField extends DialogField { } protected static MGridData gridDataForText(int span) { MGridData gd= new MGridData(); - gd.horizontalAlignment= gd.FILL; + gd.horizontalAlignment= MGridData.FILL; gd.grabExcessHorizontalSpace= true; gd.grabColumn= 0; gd.horizontalSpan= span; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java index f7db96fd995..190cf77a5f0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java @@ -656,7 +656,7 @@ public final class MGridLayout extends Layout { } else if (vAlign == MGridData.END) { widgetY= widgetY + spannedHeight - childExtent.y; } else { - widgetY= widgetY; + //widgetY= widgetY; } if (vAlign == MGridData.FILL) { widgetH= spannedHeight; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java index 379260806bf..7f917f69263 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java @@ -103,11 +103,11 @@ public class CUIPlugin extends AbstractUIPlugin { return fgResourceBundle; } - public static IWorkbenchWindow getActiveWorkbenchWindow() { + public IWorkbenchWindow getActiveWorkbenchWindow() { return getDefault().getWorkbench().getActiveWorkbenchWindow(); } - public static Shell getActiveWorkbenchShell() { + public Shell getActiveWorkbenchShell() { return getActiveWorkbenchWindow().getShell(); } @@ -115,11 +115,11 @@ public class CUIPlugin extends AbstractUIPlugin { return fgCPlugin; } - public static void log(Throwable e) { + public void log(Throwable 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); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CProjectWizard.java index 0bdc2fb8b30..1820663036b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CProjectWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CProjectWizard.java @@ -259,12 +259,12 @@ public abstract class CProjectWizard extends BasicNewResourceWizard implements I IStatus status= ((CoreException)th).getStatus(); if (status != null) { ErrorDialog.openError(shell, title, message, status); - CUIPlugin.log(status); + CUIPlugin.getDefault().log(status); return false; } } MessageDialog.openError(shell, title, message); - CUIPlugin.log(th); + CUIPlugin.getDefault().log(th); try { getProjectHandle().delete(false, false, null); } catch (CoreException ignore) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java index a0e95be0d94..5a3245cd4d2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java @@ -106,7 +106,7 @@ public abstract class StdMakeProjectWizard extends CProjectWizard { } public String getProjectID() { - return CCorePlugin.getDefault().PLUGIN_ID + ".make"; + return CCorePlugin.PLUGIN_ID + ".make"; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/TabFolderPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/TabFolderPage.java index db62ea3dc9d..e0c46fc79e8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/TabFolderPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/TabFolderPage.java @@ -55,9 +55,9 @@ public class TabFolderPage extends WizardPage implements IValidation { tabFolder.setLayout(new TabFolderLayout()); MGridData gd= new MGridData(); - gd.horizontalAlignment= gd.FILL; + gd.horizontalAlignment= MGridData.FILL; gd.grabExcessHorizontalSpace= true; - gd.verticalAlignment= gd.FILL; + gd.verticalAlignment= MGridData.FILL; gd.grabExcessVerticalSpace= true; tabFolder.setLayoutData(gd); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java index ca6c7d2da1a..6b3fedf03b8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java @@ -139,7 +139,7 @@ public abstract class ConversionWizard * The default if a make project */ public String getProjectID() { - return CCorePlugin.getDefault().PLUGIN_ID + ".make";//$NON-NLS-1$ + return CCorePlugin.PLUGIN_ID + ".make";//$NON-NLS-1$ } /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java index 398a1d23c29..c7468bf1e2e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java @@ -504,14 +504,14 @@ public abstract class ConvertProjectWizardPage } } 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{ if (project.hasNature(CProjectNature.C_NATURE_ID)) { CCorePlugin.getDefault().convertProjectFromCtoCC(project, monitor); //$NON-NLS-1$ } 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$ } }