KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > ui > views > FeatureAction


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.update.internal.ui.views;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.jface.dialogs.MessageDialog;
15 import org.eclipse.swt.widgets.Shell;
16
17 public abstract class FeatureAction extends Action {
18     
19     protected String JavaDoc windowTitle;
20     
21     protected Shell shell;
22
23     public FeatureAction(Shell shell, String JavaDoc text) {
24         super(text);
25         this.shell = shell;
26     }
27
28     protected boolean confirm(String JavaDoc message) {
29         return MessageDialog.openConfirm( shell, windowTitle, message);
30     }
31     
32     public void setWindowTitle( String JavaDoc windowTitle) {
33         this.windowTitle = windowTitle;
34     }
35     
36     public abstract boolean canExecuteAction();
37 }
38
Popular Tags