diff options
author | Eugene Tarassov | 2012-04-06 15:08:11 +0000 |
---|---|---|
committer | Eugene Tarassov | 2012-04-06 15:08:11 +0000 |
commit | d77687fdebe50c96f1b61720918f51cb2b4b7a1e (patch) | |
tree | 0f2fcacfb8ea113d4f0b1cb25a2533d5e3a04a41 /plugins/org.eclipse.tcf.cdt.ui | |
parent | 07fd3cb8c028dba668ee4905f76b3a024d950e75 (diff) | |
download | org.eclipse.tcf-d77687fdebe50c96f1b61720918f51cb2b4b7a1e.tar.gz org.eclipse.tcf-d77687fdebe50c96f1b61720918f51cb2b4b7a1e.tar.xz org.eclipse.tcf-d77687fdebe50c96f1b61720918f51cb2b4b7a1e.zip |
TCF Debugger: code cleanup, e.g. removing extra space characters
Diffstat (limited to 'plugins/org.eclipse.tcf.cdt.ui')
4 files changed, 63 insertions, 62 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java index 3c8394866..de48e5228 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java @@ -13,7 +13,7 @@ public class Messages extends NLS { public static String TCFThreadFilterQueryAdvancedLabel; public static String TCFThreadFilterQueryTreeViewLabel; public static String TCFThreadFilterEditorFormatError; - + static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java index cb077407f..32d5fa8de 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java @@ -66,7 +66,8 @@ public class TCFBreakpointScopeExtension implements ICBreakpointExtension { catch (Exception e) { Activator.log(e); } - } + } + public void setPropertiesFilter(String properties) { fProperties = properties; if (fBreakpoint == null) return; @@ -82,7 +83,7 @@ public class TCFBreakpointScopeExtension implements ICBreakpointExtension { } catch (Exception e) { Activator.log(e); - } + } } public String[] getThreadFilters() { diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFContextQueryExpressionDialog.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFContextQueryExpressionDialog.java index 7518a917c..270c8535d 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFContextQueryExpressionDialog.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFContextQueryExpressionDialog.java @@ -32,14 +32,14 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { private String[] attributeList; private ParameterDataModel[] parameterData; final String[] columnNames = new String[] {"Parameter","Value"}; - + protected TCFContextQueryExpressionDialog(Shell parentShell, String[] attributes, String initialExpression) { super(parentShell); setShellStyle(getShellStyle() | SWT.RESIZE); expression = initialExpression; attributeList = attributes; } - + String getParameterInitialValue (String comparator, int initIndex){ if (expression != null && expression.length() > 0) { int indexExpr = expression.indexOf (comparator, initIndex); @@ -49,8 +49,8 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { String testChar = expression.substring(indexExpr-1, indexExpr); if (!testChar.equals(",")) { return getParameterInitialValue(comparator,indexExpr+1); - } - } + } + } int startOfVal = expression.indexOf ('=', indexExpr) + 1; int endOfVal = -1; if (startOfVal != 0) { @@ -71,7 +71,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { * */ public static class ParameterDataModel { - + private String attribute; private String value; @@ -79,19 +79,19 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { attribute = label; value =""; } - + public String getLabel() { return attribute; } - + public void setLabel(String label) { attribute = label; } - + public String getData() { return value; } - + public void setData(Object data) { if (data != null) { value = (String)data; @@ -114,7 +114,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { } return parameterData; } - + public final class ParameterTableLabelProvider extends LabelProvider implements ITableLabelProvider { public Image getColumnImage(Object element, int columnIndex) { return null; @@ -131,7 +131,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { } } } - + public class ValueCellEditor extends TextCellEditor { private Object tableElement; public ValueCellEditor(Composite parent) { @@ -160,13 +160,13 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { String testChar = expression.substring(indexExpr-1, indexExpr); if (!testChar.equals(",")) { return findParameter(comparator,indexExpr+1); - } + } } } - } + } return indexExpr; } - + public final class CellEditorListener implements ICellEditorListener { private ValueCellEditor fcellEditor; public CellEditorListener(ValueCellEditor cellEditor) { @@ -183,7 +183,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { if (cellString == null) { return; } - cellString = cellString.trim(); + cellString = cellString.trim(); if (cellString.length() != 0) { if (expression == null || expression.length() == 0) { expression = new String(paramName + "=" + cellString); @@ -207,7 +207,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { String testChar = expression.substring(strIndex+paramName.length(), strIndex+1+paramName.length()); if (!testChar.equals("=")) { // malformed expression - getButton(IDialogConstants.OK_ID).setEnabled(false); + getButton(IDialogConstants.OK_ID).setEnabled(false); return; } testChar = expression.substring(strIndex-1, strIndex); @@ -218,7 +218,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { } else { strIndex-=1; - } + } } int endLocation = expression.indexOf(',', strIndex+1); if (endLocation == -1) { @@ -233,7 +233,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { getButton(IDialogConstants.OK_ID).setEnabled(false); } else { - getButton(IDialogConstants.OK_ID).setEnabled(true); + getButton(IDialogConstants.OK_ID).setEnabled(true); } } @@ -283,8 +283,8 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { fviewer.update(element, null); } } - } - + } + protected Control createDialogArea(Composite parent) { Composite page = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(1, true); @@ -318,14 +318,14 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { }); return parent; } - + public String getExpression() { return expression; } - + /* * (non-Javadoc) - * + * * @see * org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets * .Shell) @@ -334,7 +334,7 @@ public class TCFContextQueryExpressionDialog extends SelectionDialog { super.configureShell(newShell); newShell.setText("Select Expression Parameters"); } - + public void create() { super.create(); getButton(IDialogConstants.OK_ID).setEnabled(false); diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java index 70c694777..1cf99242c 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java @@ -266,7 +266,7 @@ public class TCFThreadFilterEditor { private ControlDecoration scopeExpressionDecoration; private Button radioBasic; private Button radioAdvanced; - + public class ScopingModeListener implements SelectionListener { private Composite fParent; @@ -276,7 +276,7 @@ public class TCFThreadFilterEditor { public void widgetSelected(SelectionEvent e) { if (radioBasic.getSelection()) { stackLayout.topControl = basicPage; - } + } else { stackLayout.topControl = advancedPage; } @@ -285,7 +285,7 @@ public class TCFThreadFilterEditor { public void widgetDefaultSelected(SelectionEvent e) { } } - + /** * Returns the dialog settings or <code>null</code> if none * @@ -302,7 +302,7 @@ public class TCFThreadFilterEditor { } return section; } - + public TCFThreadFilterEditor(Composite parent, TCFBreakpointThreadFilterPage page) { fPage = page; fContentProvider = new ThreadFilterContentProvider(); @@ -322,12 +322,12 @@ public class TCFThreadFilterEditor { radioAdvanced = new Button(buttonComposite, SWT.RADIO); radioAdvanced.setText(Messages.TCFThreadFilterQueryButtonAdvanced); radioAdvanced.addSelectionListener(new ScopingModeListener(mainComposite)); - + IDialogSettings settings= getDialogSettings(false); if (settings != null) { boolean basicSelected = settings.getBoolean(Messages.TCFThreadFilterQueryModeButtonState); if ( basicSelected ) { - radioBasic.setSelection(true); + radioBasic.setSelection(true); } else { radioAdvanced.setSelection(true); @@ -342,7 +342,7 @@ public class TCFThreadFilterEditor { protected TCFBreakpointThreadFilterPage getPage() { return fPage; } - + private String getBPFilterExpression() { String expression = null; ICBreakpoint bp = (ICBreakpoint)fPage.getElement().getAdapter(ICBreakpoint.class); @@ -357,10 +357,10 @@ public class TCFThreadFilterEditor { } } } - + return expression; } - + private String[] getAvailableAttributes() { String[] result = null; TCFLaunch launch = (TCFLaunch)getAttributeLaunch(); @@ -373,7 +373,7 @@ public class TCFThreadFilterEditor { } result = new TCFTask<String[]>() { public void run() { - IContextQuery service = channel.getRemoteService(IContextQuery.class); + IContextQuery service = channel.getRemoteService(IContextQuery.class); service.getAttrNames(new IContextQuery.DoneGetAttrNames() { public void doneGetAttrNames(IToken token, Exception error, String[] attributes) { if (error != null) { @@ -446,29 +446,29 @@ public class TCFThreadFilterEditor { } private class ExpressionSelectButton implements Listener { - + private Shell parentShell; - + public ExpressionSelectButton(Shell shell) { parentShell = shell; } public void handleEvent(Event event) { String[] attrsList = getAvailableAttributes(); - String result = null; + String result = null; TCFContextQueryExpressionDialog dlg = new TCFContextQueryExpressionDialog(parentShell, attrsList, scopeExprCombo.getText()); - + if (dlg.open() == Window.OK) { result = dlg.getExpression(); } if (result != null) { - scopeExprCombo.setText(result); + scopeExprCombo.setText(result); } } } - + private void setupScopeExpressionCombo(IDialogSettings settings, String bpContextQuery) { - String [] expresionList = null; + String [] expresionList = null; if ( settings != null ) { expresionList = settings.getArray(Messages.TCFThreadFilterQueryExpressionStore); if ( expresionList != null ) { @@ -483,14 +483,14 @@ public class TCFThreadFilterEditor { String[] copyList = new String[index]; int found = -1; for (int loop = 0; loop < index; loop++) { - copyList[loop] = expresionList[loop]; + copyList[loop] = expresionList[loop]; if (bpContextQuery != null && copyList[loop].equals(bpContextQuery)) { found = loop; } } if (found != -1) { scopeExprCombo.setItems(copyList); - scopeExprCombo.select(found); + scopeExprCombo.select(found); } else { int pad = 0; @@ -510,19 +510,19 @@ public class TCFThreadFilterEditor { } else if (bpContextQuery != null) { scopeExprCombo.setItems(new String[]{bpContextQuery}); - scopeExprCombo.select(0); + scopeExprCombo.select(0); } } else if (bpContextQuery != null) { scopeExprCombo.setItems(new String[]{bpContextQuery}); - scopeExprCombo.select(0); - } + scopeExprCombo.select(0); + } } - + private void createThreadViewer(Composite parent) { GridData twoColumnLayout = new GridData(SWT.FILL,0, true, false); twoColumnLayout.horizontalSpan = 2; - advancedPage = new Composite(parent,SWT.NONE); + advancedPage = new Composite(parent,SWT.NONE); advancedPage.setLayout(new GridLayout(2,false)); advancedPage.setFont(parent.getFont()); Label epressionLabel = new Label(advancedPage, SWT.NONE); @@ -536,10 +536,10 @@ public class TCFThreadFilterEditor { scopeExprCombo.addModifyListener(new ExpressionModifier()); scopeExpressionDecoration = new ControlDecoration(scopeExprCombo, SWT.LEFT, advancedPage); scopeExpressionDecoration.hide(); - scopeExpressionDecoration.setDescriptionText(Messages.TCFThreadFilterEditorFormatError); - FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR); + scopeExpressionDecoration.setDescriptionText(Messages.TCFThreadFilterEditorFormatError); + FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR); scopeExpressionDecoration.setImage(fieldDecoration.getImage()); - + String bpContextQuery = getBPFilterExpression(); IDialogSettings settings= getDialogSettings(false); setupScopeExpressionCombo(settings, bpContextQuery); @@ -547,7 +547,7 @@ public class TCFThreadFilterEditor { selectExpression.setText(Messages.TCFThreadFilterQueryButtonEdit); selectExpression.setLayoutData(new GridData(SWT.RIGHT,0, false, false)); selectExpression.addListener(SWT.Selection, new ExpressionSelectButton(parent.getShell())); - + basicPage = new Composite(parent, SWT.NONE); basicPage .setLayout(new GridLayout(1,false)); basicPage .setFont(parent.getFont()); @@ -564,15 +564,15 @@ public class TCFThreadFilterEditor { fThreadViewer.setContentProvider(fContentProvider); fThreadViewer.setLabelProvider(new ThreadFilterLabelProvider()); fThreadViewer.setInput(DebugPlugin.getDefault().getLaunchManager()); - setInitialCheckedState(); + setInitialCheckedState(); if (radioBasic.getSelection()) { stackLayout.topControl = basicPage; - } + } else { stackLayout.topControl = advancedPage; } - parent.layout(); + parent.layout(); } protected ILaunch getAttributeLaunch() { @@ -619,7 +619,7 @@ public class TCFThreadFilterEditor { protected final CheckboxTreeViewer getThreadViewer() { return fThreadViewer; } - + protected final String getScopeExpression() { return scopeExprCombo.getText(); } @@ -677,7 +677,7 @@ public class TCFThreadFilterEditor { } return null; } - + void updateExpressionsDialogSettings(IDialogSettings settings, String scopedExpression) { String[] list = settings.getArray(Messages.TCFThreadFilterQueryExpressionStore); if (list == null) { @@ -699,7 +699,7 @@ public class TCFThreadFilterEditor { System.arraycopy(list, 0, copyList, 1, list.length-1); settings.put(Messages.TCFThreadFilterQueryExpressionStore, copyList); } - + protected void doStore() { IDialogSettings settings= getDialogSettings(true); if (settings != null) { @@ -733,7 +733,7 @@ public class TCFThreadFilterEditor { } TCFBreakpointScopeExtension filterExtension = fPage.getFilterExtension(); if (filterExtension == null) return; - filterExtension.setThreadFilter(threadIds); + filterExtension.setThreadFilter(threadIds); } } |