@@ -114,10 +114,12 @@ public class MainDialog extends Dialog {
114
114
private Composite compositeDir ;
115
115
private Button btnHideBusses ;
116
116
private Button btnShowHidden ;
117
+ private Combo showFilter ;
117
118
118
119
private AttributeEditingSupport attributeEditor ;
119
120
private Label label ;
120
121
private Label label_1 ;
122
+ private Composite composite_1 ;
121
123
/**
122
124
* Create the dialog.
123
125
*
@@ -206,13 +208,23 @@ protected Control createDialogArea(Composite parent) {
206
208
+ "Select and Instance type. You can optionally enter a custom name. Then click 'Add Instance' button." );
207
209
208
210
columnName .setResizable (true );
211
+
212
+ composite_1 = new Composite (sashForm_1 , SWT .NONE );
213
+
214
+ showFilter = new Combo (composite_1 , SWT .READ_ONLY );
215
+ showFilter .setFont (SWTResourceManager .getFont ("Arial" , 9 , SWT .READ_ONLY ));
216
+ showFilter .setBounds (118 , 0 , 336 , 23 );
217
+
218
+ Label lblAttributeFilter = new Label (composite_1 , SWT .NONE );
219
+ lblAttributeFilter .setFont (SWTResourceManager .getFont ("Arial" , 9 , SWT .NORMAL ));
220
+ lblAttributeFilter .setBounds (15 , 3 , 97 , 15 );
221
+ lblAttributeFilter .setText ("Attribute Filter:" );
209
222
210
223
// Create attribute table
211
224
viewer = new TableViewer (sashForm_1 , SWT .VIRTUAL | SWT .H_SCROLL | SWT .V_SCROLL
212
225
| SWT .FULL_SELECTION | SWT .BORDER );
213
226
214
227
this .createAttributeTable ();
215
- sashForm_1 .setWeights (new int [] { 1 , 1 });
216
228
217
229
// //////////////////////////////////////////////////////////
218
230
// Tab folders
@@ -374,6 +386,14 @@ protected Control createDialogArea(Composite parent) {
374
386
this .initInstanceMode ();
375
387
sashForm .setWeights (new int [] { 1 , 1 });
376
388
columnName .pack ();
389
+ sashForm_1 .setWeights (new int [] {302 , 37 , 171 });
390
+
391
+ showFilter .removeAll ();
392
+ showFilter .add ("" );
393
+ for (String a : controller .getAttributeFilters ().keySet ()) {
394
+ showFilter .add (a );
395
+ }
396
+
377
397
378
398
return container ;
379
399
}
@@ -693,7 +713,12 @@ private void updateView() {
693
713
//A target is selected so show the associated attributes
694
714
TreeItem item = tree .getSelection ()[0 ];
695
715
ConnectionEndpoint ep = this .getEndpoint (item , null );
696
- attributes = controller .getAttributesAndGlobals (targetInstance , "/" +ep .getName ());
716
+ int s = showFilter .getSelectionIndex ();
717
+ String show = "" ;
718
+ if (s >-1 ) {
719
+ show = showFilter .getItem (s );
720
+ }
721
+ attributes = controller .getAttributesAndGlobals (targetInstance , "/" +ep .getName (),show );
697
722
viewer .setInput (attributes );
698
723
viewer .refresh ();
699
724
@@ -1077,6 +1102,12 @@ public void setFilename(String filename) {
1077
1102
}
1078
1103
1079
1104
private void addEvents () {
1105
+ showFilter .addSelectionListener (new SelectionAdapter () {
1106
+ @ Override
1107
+ public void widgetSelected (SelectionEvent arg0 ) {
1108
+ updateView ();
1109
+ }
1110
+ });
1080
1111
btnShowHidden .addSelectionListener (new SelectionAdapter () {
1081
1112
@ Override
1082
1113
public void widgetSelected (SelectionEvent arg0 ) {
@@ -1212,7 +1243,7 @@ public void widgetSelected(SelectionEvent arg0) {
1212
1243
public void widgetSelected (SelectionEvent arg0 ) {
1213
1244
if (listBusses .getSelectionCount () > 0 ) {
1214
1245
Connection conn = (Connection ) listBusses .getData (listBusses .getSelection ()[0 ]);
1215
- attributes = controller .getAttributesAndGlobals (conn .busTarget , "" );
1246
+ attributes = controller .getAttributesAndGlobals (conn .busTarget , "" , "" );
1216
1247
viewer .setInput (attributes );
1217
1248
viewer .refresh ();
1218
1249
}
0 commit comments