01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.texteditor;
11:
12: /**
13: * Extension interface for actions. Actions implementing this interface not
14: * only manage an enable/disable state but also manage a "hypothetical"
15: * enable state, depending on whether the target they work on is writable
16: * or read-only.
17: *
18: * @since 2.0
19: */
20: public interface IReadOnlyDependent {
21:
22: /**
23: * Returns whether the actions would be enabled if its target
24: * would be enabled given the writable state described by <code>isWritable</code>.
25: * <code>isEnabled()</code> and <code>isEnabled(boolean)</code> holds the following
26: * invariants:
27: * isEnabled() == false, if isEnabled(true) == false || isEnabled(false) == false
28: * isEnabled() == true, if isEnabled(true) == true || isEnabled(false) == true
29: *
30: * @param isWritable
31: * @return the hypothetical enable state of the action
32: */
33: boolean isEnabled(boolean isWritable);
34: }
|