KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > texteditor > IReadOnlyDependent


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
12 package org.eclipse.ui.texteditor;
13
14
15 /**
16  * Extension interface for actions. Actions implementing this interface not
17  * only manage an enable/disable state but also manage a "hypothetical"
18  * enable state, depending on whether the target they work on is writable
19  * or read-only.
20  *
21  * @since 2.0
22  */

23 public interface IReadOnlyDependent {
24
25     /**
26      * Returns whether the actions would be enabled if its target
27      * would be enabled given the writable state described by <code>isWritable</code>.
28      * <code>isEnabled()</code> and <code>isEnabled(boolean)</code> holds the following
29      * invariants:
30      * isEnabled() == false, if isEnabled(true) == false || isEnabled(false) == false
31      * isEnabled() == true, if isEnabled(true) == true || isEnabled(false) == true
32      *
33      * @param isWritable
34      * @return the hypothetical enable state of the action
35      */

36     boolean isEnabled(boolean isWritable);
37 }
38
Popular Tags