1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

autotools: Cleanups of the ui bundle.

* Remove useless instanceof check.
* Use collections interfaces to loose coupling.
* Remove useless overriding methods that simply call super.
* Unnecessary local before return.
* Stop useless coupling between wizards and pages.

Change-Id: I83c6240259a7805caeadda5503ea3ae2fa6adafb
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2015-10-31 10:21:29 +02:00
parent 392511ef61
commit 65a52dfa48
45 changed files with 107 additions and 217 deletions

View file

@ -71,14 +71,6 @@ public class AutotoolsUIPlugin extends AbstractUIPlugin {
return getDefault().getBundle().getSymbolicName();
}
/**
* This method is called upon plug-in activation
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/

View file

@ -159,11 +159,6 @@ public class AutoconfCodeScanner extends RuleBasedScanner {
return -1;
}
@Override
public IToken nextToken() {
return super.nextToken();
}
public boolean affectsBehavior(PropertyChangeEvent event) {
return indexOf(event.getProperty()) >= 0;
}

View file

@ -150,10 +150,8 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
return getSourceViewer();
}
protected IDocument getInputDocument()
{
IDocument document = getDocumentProvider().getDocument(input);
return document;
protected IDocument getInputDocument() {
return getDocumentProvider().getDocument(input);
}
@Override

View file

@ -21,17 +21,14 @@ import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.jface.text.rules.ICharacterScanner;
public class AutoconfMacroContentAssistProcessor implements
IContentAssistProcessor {
protected ICharacterScanner scanner;
protected AutoconfEditor editor;
public AutoconfMacroContentAssistProcessor(ICharacterScanner scanner, AutoconfEditor editor) {
this.scanner = scanner;
public AutoconfMacroContentAssistProcessor(AutoconfEditor editor) {
this.editor = editor;
}

View file

@ -49,8 +49,7 @@ public class AutoconfSourceViewerConfiguration extends
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
IContentAssistProcessor macroContentAssistProcessor =
new AutoconfMacroContentAssistProcessor(new AutoconfMacroCodeScanner(), fEditor);
IContentAssistProcessor macroContentAssistProcessor = new AutoconfMacroContentAssistProcessor(fEditor);
assistant.setContentAssistProcessor(macroContentAssistProcessor, AutoconfPartitionScanner.AUTOCONF_MACRO);
assistant.setContentAssistProcessor(macroContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(true);

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.autotools.ui.editors;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IRule;
@ -20,7 +21,7 @@ import org.eclipse.jface.text.rules.Token;
public class RecursiveSingleLineRule extends SingleLineRule {
private ArrayList<IRule> rules;
private List<IRule> rules;
private int evalIndex;
private int startIndex;
private int endIndex;

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.autotools.ui.editors;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.rules.EndOfLineRule;
import org.eclipse.jface.text.rules.ICharacterScanner;
@ -21,7 +22,7 @@ import org.eclipse.jface.text.rules.Token;
public class RestrictedEndOfLineRule extends EndOfLineRule {
private ArrayList<IRule> rules;
private List<IRule> rules;
private int startIndex;
private int endIndex;
private String startSequence;

View file

@ -11,7 +11,7 @@
package org.eclipse.cdt.autotools.ui.editors.parser;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@ -22,7 +22,7 @@ public class AutoconfElement {
protected String var;
protected int startOffset;
protected int endOffset;
protected ArrayList<AutoconfElement> children;
protected List<AutoconfElement> children;
protected AutoconfElement parent;
private IDocument document;
@ -43,8 +43,7 @@ public class AutoconfElement {
String source = getSource();
if (source == null) {
StringBuffer kids = new StringBuffer();
for (Iterator<AutoconfElement> iterator = children.iterator(); iterator.hasNext();) {
AutoconfElement kid = iterator.next();
for (AutoconfElement kid : children) {
kids.append(kid.toString());
kids.append(","); //$NON-NLS-1$
}

View file

@ -26,8 +26,4 @@ public class AutoconfMacroArgumentElement extends AutoconfElement {
public AutoconfMacroArgumentElement(String name) {
super(name);
}
@Override
public String getVar() {
return super.getVar();
}
}

View file

@ -16,6 +16,8 @@ import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin;
@ -57,12 +59,10 @@ public abstract class InvokeAction extends AbstractTargetAction {
public final String SHELL_COMMAND = "sh"; //$NON-NLS-1$
protected void showInformation(String title, String content) {
MessageDialog.openInformation(new Shell(), title, content);
}
protected void showError(String title, String content) {
MessageDialog.openError(new Shell(), title, content);
}
@ -90,7 +90,7 @@ public abstract class InvokeAction extends AbstractTargetAction {
protected String[] separateTargets(String rawArgList) {
StringTokenizer st = new StringTokenizer(rawArgList, " "); //$NON-NLS-1$
ArrayList<String> targetList = new ArrayList<>();
List<String> targetList = new ArrayList<>();
while (st.hasMoreTokens()) {
String currentWord = st.nextToken().trim();
@ -136,7 +136,7 @@ public abstract class InvokeAction extends AbstractTargetAction {
}
protected String[] separateOptions(String rawArgList) {
ArrayList<String> argList = new ArrayList<>();
List<String> argList = new ArrayList<>();
// May be multiple user-specified options in which case we
// need to split them up into individual options
rawArgList = rawArgList.trim();
@ -162,7 +162,7 @@ public abstract class InvokeAction extends AbstractTargetAction {
}
protected String[] simpleParseOptions(String rawArgList) {
ArrayList<String> argList = new ArrayList<>();
List<String> argList = new ArrayList<>();
int lastArgIndex = -1;
int i = 0;
while (i < rawArgList.length()) {
@ -233,7 +233,7 @@ public abstract class InvokeAction extends AbstractTargetAction {
private final String[] envList;
private final IPath execDir;
private int status;
private HashMap<String, String> outputs = null;
private Map<String, String> outputs = null;
public ExecuteProgressDialog(IPath command, String[] argumentList,
String[] envList, IPath execDir) {
@ -280,7 +280,7 @@ public abstract class InvokeAction extends AbstractTargetAction {
}
}
public HashMap<String, String> getOutputs() {
public Map<String, String> getOutputs() {
return outputs;
}
@ -290,7 +290,7 @@ public abstract class InvokeAction extends AbstractTargetAction {
}
protected HashMap<String, String> executeCommand(IPath command,
protected Map<String, String> executeCommand(IPath command,
String[] argumentList, String[] envList, IPath execDir) {
try {
ExecuteProgressDialog d = new ExecuteProgressDialog(command,

View file

@ -32,11 +32,6 @@ public class SingleInputDialog extends InputDialog {
this.firstMessage = firstMessage;
}
@Override
protected void buttonPressed(int buttonId) {
super.buttonPressed(buttonId);
}
@Override
protected Control createDialogArea(Composite parent) {

View file

@ -158,24 +158,22 @@ public class AutomakeCompletionProcessor implements IContentAssistProcessor {
IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
ArrayList<String> contextList = new ArrayList<>();
if (macro) {
IDirective[] statements = makefile.getMacroDefinitions();
IMacroDefinition[] statements = makefile.getMacroDefinitions();
for (int i = 0; i < statements.length; i++) {
if (statements[i] instanceof IMacroDefinition) {
String name = ((IMacroDefinition) statements[i]).getName();
if (name != null && name.equals(wordPart.toString())) {
String value = ((IMacroDefinition) statements[i]).getValue().toString();
if (value != null && value.length() > 0) {
contextList.add(value);
}
String name = statements[i].getName();
if (name != null && name.equals(wordPart.toString())) {
String value = statements[i].getValue().toString();
if (value != null && value.length() > 0) {
contextList.add(value);
}
}
}
}
statements = makefile.getBuiltinMacroDefinitions();
for (int i = 0; i < statements.length; i++) {
if (statements[i] != null) {
String name = ((IMacroDefinition) statements[i]).getName();
String name = statements[i].getName();
if (name != null && name.equals(wordPart.toString())) {
String value = ((IMacroDefinition) statements[i]).getValue().toString();
String value = statements[i].getValue().toString();
if (value != null && value.length() > 0) {
contextList.add(value);
}

View file

@ -81,8 +81,7 @@ public class AutomakeDocumentProvider extends TextFileDocumentProvider implement
public IMakefile getWorkingCopy(Object element) {
FileInfo fileInfo= getFileInfo(element);
if (fileInfo instanceof AutomakefileFileInfo) {
AutomakefileFileInfo info= (AutomakefileFileInfo) fileInfo;
return info.fCopy;
return ((AutomakefileFileInfo) fileInfo).fCopy;
}
return null;
}

View file

@ -18,8 +18,6 @@ import org.eclipse.cdt.internal.autotools.ui.preferences.AutotoolsEditorPreferen
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
@ -92,11 +90,6 @@ public class AutomakeEditor extends MakefileEditor {
return ampage;
}
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
}
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
if (key.equals(IContentOutlinePage.class)) {
@ -109,11 +102,6 @@ public class AutomakeEditor extends MakefileEditor {
return sourceViewerConfiguration;
}
@Override
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
super.handlePreferenceStoreChanged(event);
}
public IMakefile getMakefile() {
return getAutomakefileDocumentProvider().getWorkingCopy(this.getEditorInput());
}

View file

@ -77,7 +77,7 @@ public class AutomakeErrorHandler {
} else if (directive instanceof BadDirective) {
int lineNumber = directive.getStartLine();
Integer charStart = getCharOffset(lineNumber - 1, 0);
Integer charEnd = Integer.valueOf(getCharOffset(directive.getEndLine() - 1, -1).intValue());
Integer charEnd = getCharOffset(directive.getEndLine() - 1, -1);
String annotationType = CDT_ANNOTATION_ERROR;
Annotation annotation = new AutomakeAnnotation(annotationType, true, "Bad directive"); //$NON-NLS-1$
@ -88,22 +88,17 @@ public class AutomakeErrorHandler {
return;
}
public void removeExistingMarkers()
{
public void removeExistingMarkers() {
fAnnotationModel.removeAllAnnotations();
}
private Integer getCharOffset(int lineNumber, int columnNumber)
{
try
{
private Integer getCharOffset(int lineNumber, int columnNumber) {
try {
if (columnNumber >= 0)
return Integer.valueOf(document.getLineOffset(lineNumber) + columnNumber);
return Integer.valueOf(document.getLineOffset(lineNumber) + document.getLineLength(lineNumber));
}
catch (BadLocationException e)
{
} catch (BadLocationException e) {
e.printStackTrace();
return null;
}

View file

@ -134,7 +134,7 @@ public class AutomakefileContentOutlinePage extends ContentOutlinePage {
}
}
private class AutomakefileLabelProvider extends LabelProvider {
private static class AutomakefileLabelProvider extends LabelProvider {
@Override
public Image getImage(Object element) {

View file

@ -65,8 +65,7 @@ public class EditorUtility {
if (input != null) {
IWorkbenchPage p= CUIPlugin.getActivePage();
if (p != null) {
IEditorPart editorPart= p.openEditor(input, editorID, activate);
return editorPart;
return p.openEditor(input, editorID, activate);
}
}
return null;

View file

@ -68,7 +68,6 @@ public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
}
public void parse(String name) throws IOException {
;
try (FileReader stream = new FileReader(name)) {
parse(name, stream);
}
@ -270,7 +269,7 @@ public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
cond = (Conditional) conditions.pop();
cond.setEndLine(endLine);
}
if (cond != null && cond instanceof IAutomakeConditional) {
if (cond instanceof IAutomakeConditional) {
rules = ((IAutomakeConditional)cond).getRules();
}
if (rules != null) {

View file

@ -17,10 +17,10 @@ public class GNUTargetRule extends TargetRule {
String[] orderOnlyPrerequisites;
boolean doubleColon;
public GNUTargetRule(Directive parent, Target target, boolean double_colon, String[] normal_prereqs, String[] order_prereqs, Command[] commands) {
super(parent, target, normal_prereqs, commands);
orderOnlyPrerequisites = order_prereqs.clone();
doubleColon = double_colon;
public GNUTargetRule(Directive parent, Target target, boolean doubleColon, String[] normalPrereqs, String[] orderPrereqs, Command[] commands) {
super(parent, target, normalPrereqs, commands);
orderOnlyPrerequisites = orderPrereqs.clone();
this.doubleColon = doubleColon;
}
public boolean isDoubleColon() {

View file

@ -159,23 +159,21 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
ArrayList<String> contextList = new ArrayList<>();
if (macro) {
IDirective[] statements = makefile.getMacroDefinitions();
IMacroDefinition[] statements = makefile.getMacroDefinitions();
for (int i = 0; i < statements.length; i++) {
if (statements[i] instanceof IMacroDefinition) {
String name = ((IMacroDefinition) statements[i]).getName();
String name = statements[i].getName();
if (name != null && name.equals(wordPart.toString())) {
String value = ((IMacroDefinition) statements[i]).getValue().toString();
String value = statements[i].getValue().toString();
if (value != null && value.length() > 0) {
contextList.add(value);
}
}
}
}
statements = makefile.getBuiltinMacroDefinitions();
for (int i = 0; i < statements.length; i++) {
String name = ((IMacroDefinition) statements[i]).getName();
String name = statements[i].getName();
if (name != null && name.equals(wordPart.toString())) {
String value = ((IMacroDefinition) statements[i]).getValue().toString();
String value = statements[i].getValue().toString();
if (value != null && value.length() > 0) {
contextList.add(value);
}

View file

@ -117,8 +117,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
public IMakefile getWorkingCopy(Object element) {
FileInfo fileInfo= getFileInfo(element);
if (fileInfo instanceof MakefileFileInfo) {
MakefileFileInfo info= (MakefileFileInfo) fileInfo;
return info.fCopy;
return ((MakefileFileInfo) fileInfo).fCopy;
}
return null;
}

View file

@ -192,7 +192,7 @@ public class OpenIncludeAction extends Action {
return ResourcesPlugin.getWorkspace().getRoot();
}
private void findFile(String[] includePaths, String name, ArrayList<Object> list) {
private void findFile(String[] includePaths, String name, List<Object> list) {
// in case it is an absolute path
IPath includeFile= new Path(name);
if (includeFile.isAbsolute()) {
@ -225,7 +225,7 @@ public class OpenIncludeAction extends Action {
* @param list
* @throws CoreException
*/
private void findFile(IContainer parent, final IPath name, final ArrayList<Object> list) throws CoreException {
private void findFile(IContainer parent, final IPath name, final List<Object> list) throws CoreException {
parent.accept(proxy -> {
if (proxy.getType() == IResource.FILE && proxy.getName().equalsIgnoreCase(name.lastSegment())) {
IPath rPath = proxy.requestResource().getLocation();

View file

@ -22,10 +22,10 @@ public class StaticTargetRule extends InferenceRule implements IInferenceRule {
String targetPattern;
String[] prereqPatterns;
public StaticTargetRule(Directive parent, Target target, String target_pattern, String[] prereq_patterns, Command[] commands) {
public StaticTargetRule(Directive parent, Target target, String targetPattern, String[] prereqPatterns, Command[] commands) {
super(parent, target, commands);
targetPattern = target_pattern;
prereqPatterns = prereq_patterns.clone();
this.targetPattern = targetPattern;
this.prereqPatterns = prereqPatterns.clone();
}
public String[] getPrerequisitePatterns() {

View file

@ -249,7 +249,7 @@ public class StringMatcher {
}
}
Vector<String> temp= new Vector<>();
Vector<String> temp = new Vector<>();
int pos= 0;
StringBuffer buf= new StringBuffer();

View file

@ -21,8 +21,8 @@ public class TwoArrayQuickSort {
private static void internalSort(String[] keys, Object[] values, int left, int right, boolean ignoreCase) {
int original_left= left;
int original_right= right;
int originalLeft= left;
int originalRight= right;
String mid= keys[(left + right) >>> 1];
do {
@ -46,11 +46,11 @@ public class TwoArrayQuickSort {
}
} while (left <= right);
if (original_left < right) {
internalSort(keys , values, original_left, right, ignoreCase);
if (originalLeft < right) {
internalSort(keys , values, originalLeft, right, ignoreCase);
}
if (left < original_right) {
internalSort(keys, values, left, original_right, ignoreCase);
if (left < originalRight) {
internalSort(keys, values, left, originalRight, ignoreCase);
}
}
private static boolean smaller(String left, String right, boolean ignoreCase) {

View file

@ -210,7 +210,7 @@ public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
{AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_var_set"), ColorManager.AUTOCONF_VAR_SET_COLOR, null}, //$NON-NLS-1$
{AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_default"), ColorManager.AUTOCONF_DEFAULT_COLOR, null}, //$NON-NLS-1$
};
ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys= new ArrayList<>();
List<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<>();
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL));
@ -229,7 +229,7 @@ public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
return new OverlayPreferenceStore(getPreferenceStore(), keys);
}
private void addTextKeyToCover(ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys, String mainKey) {
private void addTextKeyToCover(List<OverlayPreferenceStore.OverlayKey> overlayKeys, String mainKey) {
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
@ -553,11 +553,6 @@ public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
return (HighlightingColorListItem) selection.getFirstElement();
}
@Override
public boolean performOk() {
return super.performOk();
}
/**
* @param preferenceStore
*/

View file

@ -214,7 +214,7 @@ public class AutomakeEditorPreferencePage extends AbstractEditorPreferencePage {
return new OverlayPreferenceStore(getPreferenceStore(), keys);
}
private void addTextKeyToCover(ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys, String mainKey) {
private void addTextKeyToCover(List<OverlayPreferenceStore.OverlayKey> overlayKeys, String mainKey) {
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
@ -429,11 +429,6 @@ public class AutomakeEditorPreferencePage extends AbstractEditorPreferencePage {
return (HighlightingColorListItem) selection.getFirstElement();
}
@Override
public boolean performOk() {
return super.performOk();
}
/**
* @param preferenceStore
*/

View file

@ -113,7 +113,6 @@ public class ColorEditor {
gc.setFont(f);
int height= gc.getFontMetrics().getHeight();
gc.dispose();
Point p= new Point(height * 3 - 6, height);
return p;
return new Point(height * 3 - 6, height);
}
}

View file

@ -17,6 +17,7 @@ import org.eclipse.cdt.managedbuilder.ui.properties.AbstractCBuildPropertyTab;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
@ -114,18 +115,13 @@ public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
}
});
fCleanMake.addSelectionListener(new SelectionListener() {
fCleanMake.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
fCleanDelete.setSelection(false);
fCleanMake.setSelection(true);
fCleanMakeTarget.setEnabled(true);
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// do nothing
}
});
fCleanMakeTarget.addModifyListener(e -> {
@ -207,11 +203,6 @@ public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
// what to do here?
}
@Override
public void setVisible (boolean b) {
super.setVisible(b);
}
private void initialize() {
IProject project = getProject();
String cleanDelete = null;

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.internal.autotools.ui.properties;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfiguration;
import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
@ -70,7 +71,7 @@ public class AutotoolsCategoryPropertyOptionPage extends
protected void doStore() {}
}
private ArrayList<FieldEditor> fieldEditors;
private List<FieldEditor> fieldEditors;
public AutotoolsCategoryPropertyOptionPage(ToolListElement element, IAConfiguration cfg) {
super(element.getName());
@ -79,11 +80,6 @@ public class AutotoolsCategoryPropertyOptionPage extends
fieldEditors = new ArrayList<>();
}
@Override
public String getName() {
return super.getName();
}
@Override
protected void createFieldEditors() {
super.createFieldEditors();

View file

@ -47,15 +47,14 @@ public class AutotoolsConfigurePropertyPage extends AbstractPage {
}
public IAConfiguration getConfiguration(ICConfigurationDescription cfgd) {
IAConfiguration acfg = AutotoolsConfigurationManager.getInstance().getTmpConfiguration(getProject(), cfgd);
return acfg;
return AutotoolsConfigurationManager.getInstance().getTmpConfiguration(getProject(), cfgd);
}
@Override
protected void cfgChanged(ICConfigurationDescription _cfgd) {
cfgd = _cfgd;
protected void cfgChanged(ICConfigurationDescription cfgd) {
this.cfgd = cfgd;
// Let super update all pages
super.cfgChanged(_cfgd);
super.cfgChanged(cfgd);
}
}

View file

@ -363,11 +363,6 @@ public class AutotoolsConfigurePropertyTab extends AbstractAutotoolsCPropertyTab
setValues();
}
@Override
public void setVisible (boolean b) {
super.setVisible(b);
}
// IPreferencePageContainer methods
@Override
public void updateButtons() {}

View file

@ -171,11 +171,6 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
// Nothing to do
}
@Override
public void setVisible (boolean b) {
super.setVisible(b);
}
private void initialize() {
initializeACVersion();
initializeAMVersion();

View file

@ -77,11 +77,6 @@ public class AutotoolsToolPropertyOptionPage extends
this.cfg = cfg;
}
@Override
public String getName() {
return super.getName();
}
public ToolListElement getElement() {
return element;
}

View file

@ -271,11 +271,6 @@ public class AutotoolsToolsPropertyTab extends AbstractAutotoolsCPropertyTab {
// Nothing to do
}
@Override
public void setVisible (boolean b) {
super.setVisible(b);
}
private void initialize() {
String aclocalPath = null;
String automakePath = null;

View file

@ -11,10 +11,11 @@
package org.eclipse.cdt.internal.autotools.ui.properties;
import java.util.ArrayList;
import java.util.List;
public class ToolListElement {
private ArrayList<ToolListElement> children;
private List<ToolListElement> children;
private ToolListElement parent;
private String name;
private int type;

View file

@ -11,13 +11,14 @@
package org.eclipse.cdt.internal.autotools.ui.text.hover;
import java.util.ArrayList;
import java.util.List;
public class AutoconfPrototype {
protected String name;
protected int numPrototypes;
protected ArrayList<Integer> minParms;
protected ArrayList<Integer> maxParms;
protected ArrayList<ArrayList<String>> parmList;
protected List<Integer> minParms;
protected List<Integer> maxParms;
protected List<List<String>> parmList;
public AutoconfPrototype() {
numPrototypes = 0;
@ -59,14 +60,14 @@ public class AutoconfPrototype {
}
public String getParmName(int prototypeNum, int parmNum) {
ArrayList<String> parms = parmList.get(prototypeNum);
List<String> parms = parmList.get(prototypeNum);
return parms.get(parmNum);
}
// This function assumes that parms will be added in order starting
// with lowest prototype first.
public void setParmName(int prototypeNum, int parmNum, String value) {
ArrayList<String> parms;
List<String> parms;
if (parmList.size() == prototypeNum) {
parms = new ArrayList<>();
parmList.add(parms);

View file

@ -79,9 +79,9 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
private static class AutotoolsHoverDoc {
public Document[] documents = new Document[2];
public AutotoolsHoverDoc(Document ac_document, Document am_document) {
this.documents[0] = ac_document;
this.documents[1] = am_document;
public AutotoolsHoverDoc(Document acDocument, Document amDocument) {
this.documents[0] = acDocument;
this.documents[1] = amDocument;
}
public Document getAcDocument() {
return documents[0];
@ -101,10 +101,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
private static AutoconfEditor fEditor;
/* Mapping key to action */
private static IBindingService fBindingService;
{
fBindingService= PlatformUI.getWorkbench().getAdapter(IBindingService.class);
}
private static IBindingService fBindingService = PlatformUI.getWorkbench().getAdapter(IBindingService.class);
public static String getAutoconfMacrosDocName(String version) {
return AUTOCONF_MACROS_DOC_NAME + "-" //$NON-NLS-1$
@ -141,12 +138,12 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
}
protected static Document getACDoc(String acDocVer) {
Document ac_document = null;
Document acDocument = null;
if (acHoverDocs == null) {
acHoverDocs = new HashMap<>();
}
ac_document = acHoverDocs.get(acDocVer);
if (ac_document == null) {
acDocument = acHoverDocs.get(acDocVer);
if (acDocument == null) {
Document doc = null;
try {
// see comment in initialize()
@ -192,22 +189,22 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
} catch (URISyntaxException e) {
AutotoolsPlugin.log(e);
}
ac_document = doc;
acDocument = doc;
}
catch (IOException ioe) {
}
}
acHoverDocs.put(acDocVer, ac_document);
return ac_document;
acHoverDocs.put(acDocVer, acDocument);
return acDocument;
}
protected static Document getAMDoc(String amDocVer) {
Document am_document = null;
Document amDocument = null;
if (amHoverDocs == null) {
amHoverDocs = new HashMap<>();
}
am_document = amHoverDocs.get(amDocVer);
if (am_document == null) {
amDocument = amHoverDocs.get(amDocVer);
if (amDocument == null) {
Document doc = null;
try {
// see comment in initialize()
@ -253,13 +250,13 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
} catch (URISyntaxException e) {
AutotoolsPlugin.log(e);
}
am_document = doc;
amDocument = doc;
}
catch (IOException ioe) {
}
}
amHoverDocs.put(amDocVer, am_document);
return am_document;
amHoverDocs.put(amDocVer, amDocument);
return amDocument;
}
protected static AutotoolsHoverDoc getHoverDoc(IEditorInput input) {
@ -366,8 +363,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
public static AutoconfMacro[] getMacroList(AutoconfEditor editor) {
IEditorInput input = editor.getEditorInput();
AutotoolsHoverDoc hoverdoc = getHoverDoc(input);
AutoconfMacro[] macros = getMacroList(hoverdoc);
return macros;
return getMacroList(hoverdoc);
}
private static AutoconfMacro[] getMacroList(AutotoolsHoverDoc hoverdoc) {

View file

@ -113,13 +113,13 @@ public class AutotoolsNewCCProjectWizardV2 extends NewCCProjectWizard {
super.addPages();
// Add the configuration selection page
projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
projectConfigurationPage = new CProjectPlatformPage(PREFIX);
projectConfigurationPage.setTitle(AutotoolsUIPlugin.getResourceString(CONF_TITLE));
projectConfigurationPage.setDescription(AutotoolsUIPlugin.getResourceString(CONF_DESC));
addPage(projectConfigurationPage);
// Add the options (tabbed) page
optionPage = new NewAutotoolsProjectOptionPage(PREFIX, this);
optionPage = new NewAutotoolsProjectOptionPage(PREFIX);
optionPage.setTitle(AutotoolsUIPlugin.getResourceString(OPTIONS_TITLE));
optionPage.setDescription(AutotoolsUIPlugin.getResourceString(OPTIONS_DESC));
addPage(optionPage);

View file

@ -114,13 +114,13 @@ public class AutotoolsNewCProjectWizardV2 extends NewCProjectWizard {
super.addPages();
// Add the configuration selection page
projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
projectConfigurationPage = new CProjectPlatformPage(PREFIX);
projectConfigurationPage.setTitle(AutotoolsUIPlugin.getResourceString(CONF_TITLE));
projectConfigurationPage.setDescription(AutotoolsUIPlugin.getResourceString(CONF_DESC));
addPage(projectConfigurationPage);
// Add the options (tabbed) page
optionPage = new NewAutotoolsProjectOptionPage(PREFIX, this);
optionPage = new NewAutotoolsProjectOptionPage(PREFIX);
optionPage.setTitle(AutotoolsUIPlugin.getResourceString(OPTIONS_TITLE));
optionPage.setDescription(AutotoolsUIPlugin.getResourceString(OPTIONS_DESC));
addPage(optionPage);

View file

@ -65,7 +65,7 @@ public class AutotoolsProjectImportWizard extends NewMakeProjFromExisting {
addPage(page);
// Add the configuration selection page
projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
projectConfigurationPage = new CProjectPlatformPage(PREFIX);
projectConfigurationPage.setTitle(AutotoolsUIPlugin
.getResourceString(CONF_TITLE));
projectConfigurationPage.setDescription(AutotoolsUIPlugin

View file

@ -29,7 +29,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@ -66,9 +65,8 @@ public class CProjectPlatformPage extends WizardPage {
public static final String TOOLCHAIN = "toolchain"; //$NON-NLS-1$
public static final String NATURE = "nature"; //$NON-NLS-1$
protected Wizard parentWizard;
protected Text platformSelection;
private ArrayList<Object> selectedConfigurations;
private List<Object> selectedConfigurations;
protected IProjectType projectType;
protected Button showAllConfigs;
protected boolean showAllConfigsForced;
@ -80,12 +78,11 @@ public class CProjectPlatformPage extends WizardPage {
* @param pageName
* @param wizard
*/
public CProjectPlatformPage(String pageName, Wizard parentWizard) {
public CProjectPlatformPage(String pageName) {
super(pageName);
setPageComplete(false);
projectType = ManagedBuildManager.getExtensionProjectType("org.eclipse.linuxtools.cdt.autotools.core.projectType"); //$NON-NLS-1$
selectedConfigurations = new ArrayList<>(0);
this.parentWizard = parentWizard;
showAllConfigsForced = false;
}

View file

@ -116,13 +116,13 @@ public class ConvertToAutotoolsProjectWizard extends ConversionWizard {
addPage(mainPage = new ConvertToAutotoolsProjectWizardPage(getPrefix(), this));
// Add the configuration selection page
projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
projectConfigurationPage = new CProjectPlatformPage(PREFIX);
projectConfigurationPage.setTitle(AutotoolsUIPlugin.getResourceString(CONF_TITLE));
projectConfigurationPage.setDescription(AutotoolsUIPlugin.getResourceString(CONF_DESC));
addPage(projectConfigurationPage);
// Add the options (tabbed) page
optionPage = new NewAutotoolsProjectOptionPage(PREFIX, this);
optionPage = new NewAutotoolsProjectOptionPage(PREFIX);
optionPage.setTitle(AutotoolsUIPlugin.getResourceString(OPTIONS_TITLE));
optionPage.setDescription(AutotoolsUIPlugin.getResourceString(OPTIONS_DESC));
addPage(optionPage);

View file

@ -73,9 +73,4 @@ public class ManagedProjectOptionBlock extends TabFolderOptionBlock {
//getBinaryParserBlock().updateValues();
}
}
@Override
public void update() {
super.update();
}
}

View file

@ -20,7 +20,6 @@ import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
import org.eclipse.cdt.ui.dialogs.ICOptionPage;
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
import org.eclipse.cdt.ui.newui.CDTHelpContextIds;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
import org.eclipse.cdt.ui.wizards.NewCProjectWizardOptionPage;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
@ -44,7 +43,7 @@ public class NewAutotoolsProjectOptionPage extends NewCProjectWizardOptionPage {
parent = parentPage;
}
public class AutotoolsReferenceBlock extends ReferenceBlock {
public static class AutotoolsReferenceBlock extends ReferenceBlock {
AutotoolsReferenceBlock() {
super();
}
@ -88,14 +87,12 @@ public class NewAutotoolsProjectOptionPage extends NewCProjectWizardOptionPage {
}
protected ManagedWizardOptionBlock optionBlock;
protected NewCProjectWizard parentWizard;
/**
* @param pageName
*/
public NewAutotoolsProjectOptionPage(String pageName, NewCProjectWizard parentWizard) {
public NewAutotoolsProjectOptionPage(String pageName) {
super(pageName);
this.parentWizard = parentWizard;
optionBlock = new ManagedWizardOptionBlock(this);
}