|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jface.action.ContributionItem org.eclipse.jface.action.ControlContribution
An abstract contribution item implementation for adding an arbitrary SWT control to a tool bar. Note, however, that these items cannot be contributed to menu bars.
The createControl framework method must be implemented by concrete subclasses.
Constructor Summary | |
protected | ControlContribution(String id)
Creates a control contribution item with the given id. |
Method Summary | |
protected int | computeWidth(Control control)
Computes the width of the given control which is being added to a tool bar. |
protected abstract Control | createControl(Composite parent)
Creates and returns the control for this contribution item under the given parent composite. |
void | fill(Composite parent)
The control item implementation of this IContributionItem method calls the createControl framework method. |
void | fill(Menu parent,
int index)
The control item implementation of this IContributionItem method throws an exception since controls cannot be added to menus. |
void | fill(ToolBar parent,
int index)
The control item implementation of this IContributionItem method calls the createControl framework method to create a control under the given parent, and then creates a new tool item to hold it. |
Methods inherited from class org.eclipse.jface.action.ContributionItem |
dispose, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setParent, setVisible, toString, update, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected ControlContribution(String id)
Method Detail |
protected int computeWidth(Control control)
The default implementation of this framework method returns control.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x. Subclasses may override if required.
protected abstract Control createControl(Composite parent)
This framework method must be implemented by concrete subclasses.
public final void fill(Composite parent)
public final void fill(Menu parent, int index)
public final void fill(ToolBar parent, int index)
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.