Skip to main content
summaryrefslogtreecommitdiffstats
blob: 9941884be9a0bc91a8f3a87c74a2e8e429a15f46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.tags;

import java.util.*;
import java.util.List;

import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.viewers.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.ccvs.ui.repo.NewDateTagAction;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.tags.TagSourceWorkbenchAdapter.ProjectElementSorter;
import org.eclipse.team.internal.ui.PixelConverter;
import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.dialogs.DialogArea;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.part.PageBook;

/**
 * A dialog area that displays a list of tags for selection and supports
 * filtering of the displayed tags.
 */
public class TagSelectionArea extends DialogArea {
	
    /*
     * Property constant which identifies the selected tag or
     * null if no tag is selected
     */
    public static final String SELECTED_TAG = "selectedTag"; //$NON-NLS-1$
    
    /*
     * Property constant which indicates that a tag has been selected in such 
     * a way as to indicate that this is the desired tag (e.g double-click)
     */
    public static final String OPEN_SELECTED_TAG = "openSelectedTag";  //$NON-NLS-1$
    
    /*
     * Constants used to configure which tags are shown
     */
	public static final int INCLUDE_HEAD_TAG = TagSourceWorkbenchAdapter.INCLUDE_HEAD_TAG;
	public static final int INCLUDE_BASE_TAG = TagSourceWorkbenchAdapter.INCLUDE_BASE_TAG;
	public static final int INCLUDE_BRANCHES = TagSourceWorkbenchAdapter.INCLUDE_BRANCHES;
	public static final int INCLUDE_VERSIONS = TagSourceWorkbenchAdapter.INCLUDE_VERSIONS;
	public static final int INCLUDE_DATES = TagSourceWorkbenchAdapter.INCLUDE_DATES;
	public static final int INCLUDE_ALL_TAGS = TagSourceWorkbenchAdapter.INCLUDE_ALL_TAGS;
	
    private String tagAreaLabel;
    private final int includeFlags;
    private CVSTag selection;
    private String helpContext;
    private Text filterText;
    private TagSource tagSource;
    private Label tagAreaTextLabel;
    private final Shell shell;
    private TagRefreshButtonArea tagRefreshArea;
    private final TagSource.ITagSourceChangeListener listener = new TagSource.ITagSourceChangeListener() {
        public void tagsChanged(TagSource source) {
			Shell shell = getShell();
			if (!shell.isDisposed()) {
	            shell.getDisplay().syncExec(new Runnable() {
					public void run() {								    
						refresh();					   
					}
				});
			}
        }
    };
    private final DisposeListener disposeListener = new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            if (tagSource != null)
                tagSource.removeListener(listener);
        }
    };

    private PageBook switcher;
    private TreeViewer tagTree;
    private TableViewer tagTable;
    private boolean treeVisible = true;
    private boolean includeFilterInputArea = true;
    private String filterPattern = ""; //$NON-NLS-1$

    private IRunnableContext context;
    
    public TagSelectionArea(Shell shell, TagSource tagSource, int includeFlags, String helpContext) {
        this.shell = shell;
        this.includeFlags = includeFlags;
        this.helpContext = helpContext;
        this.tagSource = tagSource;
        setSelection(null);
    }

    /* (non-Javadoc)
     * @see org.eclipse.team.internal.ui.dialogs.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
     */
    public void createArea(Composite parent) {
        initializeDialogUnits(parent);
        Dialog.applyDialogFont(parent);
        final PixelConverter converter= new PixelConverter(parent);
        
        // Create a composite for the entire area
        Composite composite= new Composite(parent, SWT.NONE);
        composite.setLayoutData(SWTUtils.createHVFillGridData());
        composite.setLayout(SWTUtils.createGridLayout(1, converter, SWTUtils.MARGINS_NONE));
        
		// Add F1 help
		if (helpContext != null) {
            PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, helpContext);
		}
		
		// Create the tree area and refresh buttons with the possibility to add stuff in between
		createTagDisplayArea(composite);	
		createCustomArea(composite);
		createRefreshButtons(composite);
		
        Dialog.applyDialogFont(parent);
        updateTagDisplay(true);
    }

    private void createTagDisplayArea(Composite parent) {
        Composite inner = createGrabbingComposite(parent, 1);
        if (isIncludeFilterInputArea()) {
            createFilterInput(inner);
            tagAreaTextLabel = createWrappingLabel(inner, CVSUIMessages.TagSelectionArea_0, 1); //$NON-NLS-1$
        } else {
		    tagAreaTextLabel = createWrappingLabel(inner, NLS.bind(CVSUIMessages.TagSelectionArea_1, new String[] { getTagAreaLabel() }), 1);  //$NON-NLS-1$
        }
		switcher = new PageBook(inner, SWT.NONE);
		GridData gridData = new GridData(GridData.FILL_BOTH);
		gridData.heightHint = 0;
		gridData.widthHint = 0;
        switcher.setLayoutData(gridData);
		tagTree = createTree(switcher);
		tagTable = createTable(switcher);
    }

    private void createFilterInput(Composite inner) {
        createWrappingLabel(inner, NLS.bind(CVSUIMessages.TagSelectionArea_2, new String[] { getTagAreaLabel() }), 1); //$NON-NLS-1$
        filterText = createText(inner, 1);
        filterText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                setFilter(filterText.getText());
            }
        });
        filterText.addKeyListener(new KeyListener() {
            public void keyPressed(KeyEvent e) {
        		if (e.keyCode == SWT.ARROW_DOWN && e.stateMask == 0) {			
        			tagTable.getControl().setFocus();
        		}
            }
            public void keyReleased(KeyEvent e) {
                // Ignore
            }
        });
    }

    /**
     * Return the label that should be used for the tag area.
     * It should not have any trailing punctuations as the tag area
     * may position it differently depending on whether the filter
     * text input is included in the area.
     * @return the tag area label
     */
    public String getTagAreaLabel() {
        if (tagAreaLabel == null)
            tagAreaLabel = CVSUIMessages.TagSelectionArea_3; //$NON-NLS-1$
        return tagAreaLabel;
    }

    /**
     * Set the label that should be used for the tag area.
     * It should not have any trailing punctuations as the tag area
     * may position it differently depending on whether the filter
     * text input is included in the area.
     * @param tagAreaLabel the tag area label
     */
    public void setTagAreaLabel(String tagAreaLabel) {
        this.tagAreaLabel = tagAreaLabel;
    }
    
    /**
     * Update the tag display to show the tags that match the
     * include flags and the filter entered by the user.
     */
    protected void updateTagDisplay(boolean firstTime) {
        String filter = getFilterString();
        if ((filter != null && filter.length() > 0) || isTableOnly()) {
            // Show the table and filter it accordingly
            try {
	            switcher.setRedraw(false);
	            treeVisible = false;
	            switcher.showPage(tagTable.getControl());
	            FilteredTagList list = (FilteredTagList)tagTable.getInput();
	            list.setPattern(filter);
	            tagTable.refresh();
                int maxWidth = getMaxWidth(list.getChildren(null));
                if (maxWidth > 0) {
                    maxWidth = maxWidth + 40; /* space for the tag icon */
                    tagTable.getTable().getColumn(0).setWidth(maxWidth);
                }
	            if (filterText == null || filter == null || filter.length() == 0) {
	                setSelection(selection);
	            } else {
	                // Only set the top selection if there is a filter from the filter text
	                // of this area. This is done to avoid selection loops
	                selectTopElement();
	            }
            } finally {
                switcher.setRedraw(true);
            }
        } else {
            // Show the tree
            if (!isTreeVisible() || firstTime) {
                try {
                    switcher.setRedraw(false);
                    treeVisible = true;
	                switcher.showPage(tagTree.getControl());
	                tagTree.refresh();
	                setSelection(selection);
                } finally {
                    switcher.setRedraw(true);
                }
            }
        }
    }
    
    private int getMaxWidth(Object[] children) {
        PixelConverter converter = new PixelConverter(tagTable.getTable());
        int maxWidth = 0;
        for (int i = 0; i < children.length; i++) {
            Object object = children[i];
            if (object instanceof TagElement) {
                TagElement tag = (TagElement) object;
                int width = tag.getTag().getName().length();
                if (width > maxWidth) {
                    maxWidth = width;
                }
            }
        }
        return converter.convertWidthInCharsToPixels(maxWidth);
    }

    /**
     * Return whether only a table should be used
     * @return whether only a table should be used
     */
    protected boolean isTableOnly() {
        return (includeFlags == INCLUDE_VERSIONS) || (includeFlags == INCLUDE_BRANCHES);
    }

    private String getFilterString() {
        return filterPattern;
    }

    /*
     * Select the top element in the tag table
     */
    private void selectTopElement() {
        if (tagTable.getTable().getItemCount() > 0) {
            TableItem item = tagTable.getTable().getItem(0);
            tagTable.getTable().setSelection(new TableItem[] { item });
            tagTable.setSelection(tagTable.getSelection());
        }   
    }

    private FilteredTagList createFilteredInput() {
        return new FilteredTagList(tagSource, TagSource.convertIncludeFlaqsToTagTypes(includeFlags));
    }
    
    private Text createText(Composite parent, int horizontalSpan) {
        Text text = new Text(parent, SWT.BORDER);
		GridData data = new GridData();
		data.horizontalSpan = horizontalSpan;
		data.horizontalAlignment = GridData.FILL;
		data.grabExcessHorizontalSpace = true;
		data.widthHint= 0;
		text.setLayoutData(data);
        return text;
    }

    protected void createRefreshButtons(Composite parent) {
	    tagSource.addListener(listener);
        parent.addDisposeListener(disposeListener);
	    tagRefreshArea = new TagRefreshButtonArea(shell, tagSource, new Listener() {
            public void handleEvent(Event event) {
                CVSTag dateTag = NewDateTagAction.getDateTag(getShell(), getLocation());
                addDateTag(dateTag);
            }
        });
	    if (context != null)
	        tagRefreshArea.setRunnableContext(context);
	    tagRefreshArea.createArea(parent);
    }

    protected void createTreeMenu(TreeViewer tagTree) {
        if ((includeFlags & TagSourceWorkbenchAdapter.INCLUDE_DATES) != 0) {
	        // Create the popup menu
			MenuManager menuMgr = new MenuManager();
			Tree tree = tagTree.getTree();
			Menu menu = menuMgr.createContextMenu(tree);
			menuMgr.addMenuListener(new IMenuListener() {
				public void menuAboutToShow(IMenuManager manager) {
					addMenuItemActions(manager);
				}
	
			});
			menuMgr.setRemoveAllWhenShown(true);
			tree.setMenu(menu);
        }
    }

    /**
     * Create aq custom area that is below the tag selection area but above the refresh busson group
     * @param parent
     */
	protected void createCustomArea(Composite parent) {
		// No default custom area
    }
	
    protected TreeViewer createTree(Composite parent) {
		Tree tree = new Tree(parent, SWT.SINGLE | SWT.BORDER);
		GridData data = new GridData(GridData.FILL_BOTH);
        tree.setLayoutData(data);
		TreeViewer result = new TreeViewer(tree);
		initialize(result);
		result.getControl().addKeyListener(new KeyListener() {
			public void keyPressed(KeyEvent event) {
				handleKeyPressed(event);
			}
			public void keyReleased(KeyEvent event) {
				handleKeyReleased(event);
			}
		});
		result.setInput(createUnfilteredInput());
		createTreeMenu(result);
		return result;
	}

    protected TableViewer createTable(Composite parent) {
		Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
		GridData data = new GridData(GridData.FILL_BOTH);
		table.setLayoutData(data);
		TableLayout layout = new TableLayout();
		layout.addColumnData(new ColumnWeightData(100));
		table.setLayout(layout);
		new TableColumn(table, SWT.NONE);
		TableViewer viewer = new TableViewer(table);
		initialize(viewer);
		viewer.setInput(createFilteredInput());
		return viewer;

	}

    private void initialize(StructuredViewer viewer) {
        viewer.setContentProvider(new WorkbenchContentProvider());
		viewer.setLabelProvider(new WorkbenchLabelProvider());
		viewer.setSorter(new ProjectElementSorter());
		viewer.addSelectionChangedListener(new ISelectionChangedListener() {
			public void selectionChanged(SelectionChangedEvent event) {				
				handleSelectionChange();
			}
		});
		// select and close on double click
		// To do: use defaultselection instead of double click
		viewer.getControl().addMouseListener(new MouseAdapter() {
			public void mouseDoubleClick(MouseEvent e) {
			    CVSTag tag = internalGetSelectedTag();
			    if (tag != null) {
			        firePropertyChangeChange(OPEN_SELECTED_TAG, null, tag);
			    }
			}
		});
    }

    private Object createUnfilteredInput() {
        return TagSourceWorkbenchAdapter.createInput(tagSource, includeFlags);
    }

    public void handleKeyPressed(KeyEvent event) {
		if (event.character == SWT.DEL && event.stateMask == 0) {			
			deleteDateTag();
		}
	}
	private void deleteDateTag() {
		TagElement[] selectedDateTagElements = getSelectedDateTagElement();
		if (selectedDateTagElements.length == 0) return;
		for(int i = 0; i < selectedDateTagElements.length; i++){
			RepositoryManager mgr = CVSUIPlugin.getPlugin().getRepositoryManager();
			CVSTag tag = selectedDateTagElements[i].getTag();
			if(tag.getType() == CVSTag.DATE){
				mgr.removeDateTag(getLocation(),tag);
			}				
		}
		tagTree.refresh();
		handleSelectionChange();
	}
	
	/**
	 * Returns the selected date tag elements
	 */
	private TagElement[] getSelectedDateTagElement() {
		ArrayList dateTagElements = null;
		IStructuredSelection selection = (IStructuredSelection)tagTree.getSelection();
		if (selection!=null && !selection.isEmpty()) {
			dateTagElements = new ArrayList();
			Iterator elements = selection.iterator();
			while (elements.hasNext()) {
				Object next = CVSAction.getAdapter(elements.next(), TagElement.class);
				if (next instanceof TagElement) {
					if(((TagElement)next).getTag().getType() == CVSTag.DATE){
						dateTagElements.add(next);
					}
				}
			}
		}
		if (dateTagElements != null && !dateTagElements.isEmpty()) {
			TagElement[] result = new TagElement[dateTagElements.size()];
			dateTagElements.toArray(result);
			return result;
		}
		return new TagElement[0];
	}
	private void addDateTag(CVSTag tag){
		if(tag == null) return;
		List dateTags = new ArrayList();
		ICVSRepositoryLocation location = getLocation();
		dateTags.addAll(Arrays.asList(CVSUIPlugin.getPlugin().getRepositoryManager().getDateTags(location)));
		if(!dateTags.contains( tag)){
            CVSUIPlugin.getPlugin().getRepositoryManager().addDateTag(location, tag);
		}
		try {
			tagTree.getControl().setRedraw(false);
			tagTree.refresh();
			setSelection(tag);
		} finally {
			tagTree.getControl().setRedraw(true);
		}
		handleSelectionChange();
	}
	private void addMenuItemActions(IMenuManager manager) {
		manager.add(new Action(CVSUIMessages.TagSelectionDialog_0) { //$NON-NLS-1$
			public void run() {
				CVSTag dateTag = NewDateTagAction.getDateTag(getShell(), getLocation());
				addDateTag(dateTag);
			}
		});
		if(getSelectedDateTagElement().length > 0){
			manager.add(new Action(CVSUIMessages.TagSelectionDialog_1) { //$NON-NLS-1$
				public void run() {
					deleteDateTag();
				}
			});			
		}
	}

	protected void handleKeyReleased(KeyEvent event) {
	}
	
	/**
	 * handle a selection change event from the visible tag display
	 * (which could be either the table or the tree).
	 */
	protected void handleSelectionChange() {
	    CVSTag newSelection = internalGetSelectedTag();
	    if (selection != null && newSelection != null && selection.equals(newSelection)) {
	        // the selection hasn't change so return
	        return;
	    }
	    CVSTag oldSelection = selection;
	    selection = newSelection;
	    firePropertyChangeChange(SELECTED_TAG, oldSelection, selection);
	}
	
	private CVSTag internalGetSelectedTag() {
	    IStructuredSelection selection;
	    if (isTreeVisible()) {
	        selection = (IStructuredSelection)tagTree.getSelection();
	    } else {
	        selection = (IStructuredSelection)tagTable.getSelection();
	    }
		Object o = selection.getFirstElement();
		if (o instanceof TagElement)
		    return ((TagElement)o).getTag();
		return null;
	}
	
    private boolean isTreeVisible() {
        return treeVisible;
    }

    private ICVSRepositoryLocation getLocation(){
		return tagSource.getLocation();
	}
    public CVSTag getSelection() {
        return selection;
    }
    public Shell getShell() {
        return shell;
    }

    /**
     * Set the focus to the filter text widget
     */
    public void setFocus() {
        if (filterText != null)
            filterText.setFocus();
        else if (switcher != null)
            switcher.setFocus();
            
        // Refresh in case tags were added since the last time the area had focus
        refresh();
    }

    /**
     * Select the given tag
     * @param selectedTag the tag to be selected
     */
    public void setSelection(CVSTag selectedTag) {
        if (isTreeVisible())
			if (tagTree != null && !tagTree.getControl().isDisposed()) {
				// TODO: Hack to instantiate the model before revealing the selection
				tagTree.expandToLevel(2);
				tagTree.collapseAll();
				// Reveal the selection
				tagTree.reveal(new TagElement(selectedTag));
				tagTree.setSelection(new StructuredSelection(new TagElement(selectedTag)));
			}
		else
		    if (tagTable != null && !tagTable.getControl().isDisposed()) {
		        tagTable.setSelection(new StructuredSelection(new TagElement(selectedTag)));
		    }
    }

    /**
     * Refresh the state of the tag selection area
     */
    public void refresh() {
        if (isTreeVisible()) {
            if (tagTree != null && !tagTree.getControl().isDisposed()) {
                tagTree.refresh();
            }
        } else {
	        if (tagTable != null && !tagTable.getControl().isDisposed()) {
	            tagTable.refresh();
	        }
        }
    }
    
    public void refreshTagList() {
    	tagRefreshArea.refresh(true);
    }

    /**
     * Set the enablement state of the area
     * @param enabled the enablement state
     */
    public void setEnabled(boolean enabled) {
        if (filterText != null)
            filterText.setEnabled(enabled);
        tagTree.getControl().setEnabled(enabled);
        tagTable.getControl().setEnabled(enabled);
    }
    
    /**
     * Set the tag source from which the displayed tags are determined
     * @param tagSource the source of the tags being displayed
     */
    public void setTagSource(TagSource tagSource) {
        if (this.tagSource != null) {
            this.tagSource.removeListener(listener);
        }
        this.tagSource = tagSource;
        this.tagSource.addListener(listener);
        tagRefreshArea.setTagSource(this.tagSource);
        setTreeAndTableInput();
    }

    private void setTreeAndTableInput() {
        if (tagTree != null) {
            tagTree.setInput(createUnfilteredInput());
        }
        if (tagTable != null) {
            tagTable.setInput(createFilteredInput());
        }
        
    }

    /**
     * Set whether the input filter text is to be included in the tag selection area.
     * If excluded, clientscan still set the filter text directly using
     * <code>setFilter</code>.
     * @param include whether filter text input should be included
     */
    public void setIncludeFilterInputArea(boolean include) {
        includeFilterInputArea = include;
    }
    
    /**
     * Return whether the input filter text is to be included in the tag selection area.
     * If excluded, clientscan still set the filter text directly using
     * <code>setFilter</code>.
     * @return whether filter text input should be included
     */
    public boolean isIncludeFilterInputArea() {
        return includeFilterInputArea;
    }

    /**
     * Set the text used to filter the tag list.
     * @param filter the filter pattern
     */
    public void setFilter(String filter) {
        this.filterPattern = filter;
        updateTagDisplay(false);
    }
    
    public void setRunnableContext(IRunnableContext context) {
        this.context = context;
        if (tagRefreshArea != null)
            tagRefreshArea.setRunnableContext(context);
    }
}

Back to the top