1
1
/*******************************************************************************
2
- * Copyright (c) 2016, 2019, 2020 Rogue Wave Software Inc. and others.
2
+ * Copyright (c) 2016, 2021 Rogue Wave Software Inc. and others.
3
3
* All rights reserved. This program and the accompanying materials
4
4
* are made available under the terms of the Eclipse Public License v1.0
5
5
* which accompanies this distribution, and is available at
@@ -147,7 +147,7 @@ public Color getToolTipForegroundColor(Object object) {
147
147
public String getToolTipText (Object element ) {
148
148
if (element instanceof Match ) {
149
149
SymbolInformation si = getSymbolInformation ((Match <?>)element );
150
- if (si != null ) {
150
+ if (si != null ) {
151
151
return si .getName ();
152
152
}
153
153
}
@@ -199,8 +199,7 @@ public void dispose() {
199
199
}
200
200
201
201
protected String getSymbolLocationText (SymbolInformation symbol ) {
202
- Optional <String > location = GotoSymbolSection .this
203
- .getSymbolLocation (symbol );
202
+ Optional <String > location = GotoSymbolSection .this .getSymbolLocation (symbol );
204
203
if (location .isPresent ()) {
205
204
return " -- [" + location .get () + "]" ;
206
205
}
@@ -262,6 +261,7 @@ public void createContents(Composite dialogArea) {
262
261
disposables .add (model .getSymbols ().onChange (UIValueListener .from ((e , v ) -> {
263
262
if (!viewer .getControl ().isDisposed ()) viewer .refresh ();
264
263
})));
264
+
265
265
//TODO: somehow show selection in local file, (but not in other file ?)
266
266
// viewer.addSelectionChangedListener(event -> {
267
267
// IStructuredSelection selection = (IStructuredSelection) event.getSelection();
@@ -373,7 +373,7 @@ private String inputDialog(String dialogTitle, String prompt, String defaultValu
373
373
public void run () {
374
374
InputDialog dlg = new InputDialog (owner .getShell (), dialogTitle , prompt , defaultValue , null );
375
375
int code = dlg .open ();
376
- if (code == IDialogConstants .OK_ID ) {
376
+ if (code == IDialogConstants .OK_ID ) {
377
377
result .set (dlg .getValue ());
378
378
}
379
379
}
@@ -388,7 +388,7 @@ public void keyPressed(KeyEvent e) {
388
388
if (list .getTree ().getItemCount () > 0 ) {
389
389
list .getTree ().setFocus ();
390
390
TreeItem [] items = list .getTree ().getItems ();
391
- if (items != null && items .length > 0 ) {
391
+ if (items != null && items .length > 0 ) {
392
392
list .getTree ().setSelection (items [0 ]);
393
393
//programatic selection may not fire selection events so...
394
394
list .getTree ().notifyListeners (SWT .Selection ,
@@ -452,7 +452,7 @@ private SymbolInformation getTarget(TreeViewer list) {
452
452
Object selected = ss .getFirstElement ();
453
453
if (selected instanceof Match ) {
454
454
SymbolInformation si = getSymbolInformation ((Match <?>) selected );
455
- if (si != null ) {
455
+ if (si != null ) {
456
456
return si ;
457
457
}
458
458
}
@@ -464,12 +464,12 @@ private SymbolInformation getTarget(TreeViewer list) {
464
464
465
465
private SymbolInformation getFirstElement (TreeViewer list ) {
466
466
TreeItem [] items = list .getTree ().getItems ();
467
- if (items != null && items .length >0 ) {
467
+ if (items != null && items .length >0 ) {
468
468
TreeItem item = items [0 ];
469
469
Object data = item .getData ();
470
470
if (data instanceof Match ) {
471
471
SymbolInformation si = getSymbolInformation ((Match <?>) data );
472
- if (si != null ) {
472
+ if (si != null ) {
473
473
return si ;
474
474
}
475
475
}
0 commit comments