1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

With the help of eclipse-2.1 compiler remove warnings

about accessing static fields in the object instance.
This commit is contained in:
Alain Magloire 2003-01-29 18:18:30 +00:00
parent 4acbb7e894
commit 0bec11f97e
15 changed files with 38 additions and 33 deletions

View file

@ -25,6 +25,7 @@ import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.TextViewer;
import org.eclipse.jface.util.IPropertyChangeListener;
@ -85,8 +86,8 @@ public class BuildConsoleView extends ViewPart implements ISelectionListener, IB
IActionBars actionBars = getViewSite().getActionBars();
fClearOutputAction = new ClearConsoleAction(this);
fCopyAction = new BuildConsoleAction(bundle, "Editor.Copy.", fTextViewer, fTextViewer.COPY);
fSelectAllAction = new BuildConsoleAction(bundle, "Editor.SelectAll.", fTextViewer, fTextViewer.SELECT_ALL);
fCopyAction = new BuildConsoleAction(bundle, "Editor.Copy.", fTextViewer, ITextOperationTarget.COPY);
fSelectAllAction = new BuildConsoleAction(bundle, "Editor.SelectAll.", fTextViewer, ITextOperationTarget.SELECT_ALL);
actionBars.setGlobalActionHandler(ITextEditorActionConstants.COPY, fCopyAction);
actionBars.setGlobalActionHandler(ITextEditorActionConstants.SELECT_ALL, fSelectAllAction);

View file

@ -9,6 +9,7 @@ import java.io.StringWriter;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.actions.SelectionProviderAction;
import org.eclipse.ui.dialogs.ListSelectionDialog;
@ -56,7 +57,7 @@ class FilterSelectionAction extends SelectionProviderAction {
dialog.setInitialSelections(contentProvider.getInitialSelections());
dialog.open();
if (dialog.getReturnCode() == dialog.OK) {
if (dialog.getReturnCode() == Window.OK) {
Object[] results= dialog.getResult();
String[] selectedPatterns= new String[results.length];
System.arraycopy(results, 0, selectedPatterns, 0, results.length);

View file

@ -56,7 +56,7 @@ class ShowLibrariesAction extends SelectionProviderAction {
CUIPlugin plugin = CUIPlugin.getDefault();
Boolean b = new Boolean (cview.getLibraryFilter().getShowLibraries());
plugin.getPreferenceStore().putValue(cview.TAG_SHOWLIBRARIES, b.toString());
plugin.getPreferenceStore().putValue(CView.TAG_SHOWLIBRARIES, b.toString());
}
private void updateToolTipText() {

View file

@ -86,8 +86,8 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
spec.heightHint= initialSize.y;
spec.grabExcessVerticalSpace= true;
spec.grabExcessHorizontalSpace= true;
spec.horizontalAlignment= spec.FILL;
spec.verticalAlignment= spec.FILL;
spec.horizontalAlignment= GridData.FILL;
spec.verticalAlignment= GridData.FILL;
fSelectionList.setLayoutData(spec);
return contents;
@ -101,8 +101,8 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
GridData spec= new GridData();
spec.grabExcessVerticalSpace= false;
spec.grabExcessHorizontalSpace= true;
spec.horizontalAlignment= spec.FILL;
spec.verticalAlignment= spec.BEGINNING;
spec.horizontalAlignment= GridData.FILL;
spec.verticalAlignment= GridData.BEGINNING;
text.setLayoutData(spec);
return text;
}

View file

@ -69,8 +69,8 @@ public class SelectionList extends Composite {
GridData spec= new GridData();
spec.grabExcessVerticalSpace= false;
spec.grabExcessHorizontalSpace= true;
spec.horizontalAlignment= spec.FILL;
spec.verticalAlignment= spec.BEGINNING;
spec.horizontalAlignment= GridData.FILL;
spec.verticalAlignment= GridData.BEGINNING;
fText.setLayoutData(spec);
Listener l= new Listener() {
public void handleEvent(Event evt) {

View file

@ -88,7 +88,7 @@ public final class BracketPainter implements IPainter, PaintListener {
if (region.getOffset() <= offset && region.getOffset() + region.getLength() >= offset + length) {
offset -= region.getOffset();
if (fMatcher.RIGHT == fAnchor)
if (CPairMatcher.RIGHT == fAnchor)
draw(gc, offset, 1);
else
draw(gc, offset + length -1, 1);

View file

@ -18,6 +18,7 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@ -133,7 +134,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS
//treeViewer.setContentProvider(new CModelContentProvider());
treeViewer.setContentProvider(new CContentProvider(true, true));
treeViewer.setLabelProvider(new StandardCElementLabelProvider());
treeViewer.setAutoExpandLevel(treeViewer.ALL_LEVELS);
treeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
treeViewer.addSelectionChangedListener(this);
CUIPlugin.getDefault().getProblemMarkerManager().addListener(treeViewer);

View file

@ -22,6 +22,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorRegistry;
@ -147,7 +148,7 @@ public class OpenIncludeAction extends Action {
dialog.setMessage(CUIPlugin.getResourceString(DIALOG_MESSAGE));
dialog.setElements(filesFound);
if (dialog.open() == dialog.OK) {
if (dialog.open() == Window.OK) {
return (IFile) dialog.getSelectedElement();
}
return null;

View file

@ -30,6 +30,7 @@ import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
@ -254,7 +255,7 @@ public class OpenOnSelectionAction extends Action {
dialog.setMessage(message);
dialog.setElements(elements);
if (dialog.open() == dialog.OK) {
if (dialog.open() == Window.OK) {
Object[] selection= dialog.getResult();
if (selection != null && selection.length > 0) {
nResults= selection.length;

View file

@ -110,8 +110,8 @@ public class EditTemplateDialog extends StatusDialog {
//assistant.enableAutoInsert(store.getBoolean(ContentAssistPreference.AUTOINSERT));
assistant.enableAutoActivation(store.getBoolean(ContentAssistPreference.AUTOACTIVATION));
assistant.setAutoActivationDelay(store.getInt(ContentAssistPreference.AUTOACTIVATION_DELAY));
assistant.setProposalPopupOrientation(assistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(assistant.CONTEXT_INFO_ABOVE);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
//assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
Display display= sourceViewer.getTextWidget().getDisplay();
@ -421,27 +421,27 @@ public class EditTemplateDialog extends StatusDialog {
}
private void initializeActions() {
TextViewerAction action= new TextViewerAction(fPatternEditor, fPatternEditor.UNDO);
TextViewerAction action= new TextViewerAction(fPatternEditor, ITextOperationTarget.UNDO);
action.setText(TemplateMessages.getString("EditTemplateDialog.undo")); //$NON-NLS-1$
fGlobalActions.put(ITextEditorActionConstants.UNDO, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.CUT);
action= new TextViewerAction(fPatternEditor, ITextOperationTarget.CUT);
action.setText(TemplateMessages.getString("EditTemplateDialog.cut")); //$NON-NLS-1$
fGlobalActions.put(ITextEditorActionConstants.CUT, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.COPY);
action= new TextViewerAction(fPatternEditor, ITextOperationTarget.COPY);
action.setText(TemplateMessages.getString("EditTemplateDialog.copy")); //$NON-NLS-1$
fGlobalActions.put(ITextEditorActionConstants.COPY, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.PASTE);
action= new TextViewerAction(fPatternEditor, ITextOperationTarget.PASTE);
action.setText(TemplateMessages.getString("EditTemplateDialog.paste")); //$NON-NLS-1$
fGlobalActions.put(ITextEditorActionConstants.PASTE, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.SELECT_ALL);
action= new TextViewerAction(fPatternEditor, ITextOperationTarget.SELECT_ALL);
action.setText(TemplateMessages.getString("EditTemplateDialog.select.all")); //$NON-NLS-1$
fGlobalActions.put(ITextEditorActionConstants.SELECT_ALL, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.CONTENTASSIST_PROPOSALS);
action= new TextViewerAction(fPatternEditor, ISourceViewer.CONTENTASSIST_PROPOSALS);
action.setText(TemplateMessages.getString("EditTemplateDialog.content.assist")); //$NON-NLS-1$
fGlobalActions.put("ContentAssistProposal", action); //$NON-NLS-1$

View file

@ -154,7 +154,7 @@ public class CPairMatcher {
int stack= 1;
int c= fReader.read();
while (c != fReader.EOF) {
while (c != CCodeReader.EOF) {
if (c == openingPeer && c != closingPeer)
stack++;
else if (c == closingPeer)
@ -175,7 +175,7 @@ public class CPairMatcher {
int stack= 1;
int c= fReader.read();
while (c != fReader.EOF) {
while (c != CCodeReader.EOF) {
if (c == closingPeer && c != openingPeer)
stack++;
else if (c == openingPeer)

View file

@ -172,7 +172,7 @@ public class CSourceViewerConfiguration extends SourceViewerConfiguration {
assistant.setContentAssistProcessor(new CCompletionProcessor(fEditor), IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
assistant.setProposalPopupOrientation(assistant.PROPOSAL_OVERLAY);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
return assistant;
}

View file

@ -33,7 +33,7 @@ public class DialogField {
public static Control createEmptySpace(Composite parent, int span) {
Label label= new Label(parent, SWT.LEFT);
MGridData gd= new MGridData();
gd.horizontalAlignment= gd.BEGINNING;
gd.horizontalAlignment= MGridData.BEGINNING;
gd.grabExcessHorizontalSpace= false;
gd.horizontalSpan= span;
gd.horizontalIndent= 0;

View file

@ -77,7 +77,7 @@ public class StringButtonDialogField extends StringDialogField {
}
protected static MGridData gridDataForControl(int span) {
MGridData gd= new MGridData();
gd.horizontalAlignment= gd.FILL;
gd.horizontalAlignment= MGridData.FILL;
gd.grabExcessHorizontalSpace= false;
gd.horizontalSpan= span;
return gd;

View file

@ -634,14 +634,14 @@ public final class MGridLayout extends Layout {
widgetX= columnX;
// Calculate the x and width values for the widget.
if (hAlign == spec.CENTER) {
if (hAlign == MGridData.CENTER) {
widgetX= widgetX + (spannedWidth / 2) - (childExtent.x / 2);
} else if (hAlign == spec.END) {
} else if (hAlign == MGridData.END) {
widgetX= widgetX + spannedWidth - childExtent.x - spec.horizontalIndent;
} else {
widgetX= widgetX + spec.horizontalIndent;
}
if (hAlign == spec.FILL) {
if (hAlign == MGridData.FILL) {
widgetW= spannedWidth - spec.horizontalIndent;
widgetX= columnX + spec.horizontalIndent;
} else {
@ -651,14 +651,14 @@ public final class MGridLayout extends Layout {
// Calculate the y and height values for the widget.
vAlign= spec.verticalAlignment;
widgetY= rowY;
if (vAlign == spec.CENTER) {
if (vAlign == MGridData.CENTER) {
widgetY= widgetY + (spannedHeight / 2) - (childExtent.y / 2);
} else if (vAlign == spec.END) {
} else if (vAlign == MGridData.END) {
widgetY= widgetY + spannedHeight - childExtent.y;
} else {
widgetY= widgetY;
}
if (vAlign == spec.FILL) {
if (vAlign == MGridData.FILL) {
widgetH= spannedHeight;
widgetY= rowY;
} else {