KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > search > SortAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.search;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.swt.custom.BusyIndicator;
15
16
17 public class SortAction extends Action {
18     private int fSortOrder;
19     private JavaSearchResultPage fPage;
20     
21     public SortAction(String JavaDoc label, JavaSearchResultPage page, int sortOrder) {
22         super(label);
23         fPage= page;
24         fSortOrder= sortOrder;
25     }
26
27     public void run() {
28         BusyIndicator.showWhile(fPage.getViewer().getControl().getDisplay(), new Runnable JavaDoc() {
29             public void run() {
30                 fPage.setSortOrder(fSortOrder);
31             }
32         });
33     }
34
35     public int getSortOrder() {
36         return fSortOrder;
37     }
38 }
39
Popular Tags