本文整理汇总了Java中org.eclipse.jface.action.ControlContribution类的典型用法代码示例。如果您正苦于以下问题:Java ControlContribution类的具体用法?Java ControlContribution怎么用?Java ControlContribution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ControlContribution类属于org.eclipse.jface.action包,在下文中一共展示了ControlContribution类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addResourcesArea
import org.eclipse.jface.action.ControlContribution; //导入依赖的package包/类
private void addResourcesArea(Composite composite) {
ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
public void createToolbarControls(ToolBarManager toolbarManager) {
toolbarManager.add(new ControlContribution("stealLock") {
protected Control createControl(Composite parent) {
stealButton = new Button(parent, SWT.CHECK);
stealButton.setText(Policy.bind("LockDialog.stealLock")); //$NON-NLS-1$
return stealButton;
}
});
}
public int getControlCount() {
return 1;
}
};
resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, "These files will be locked:", files, new HashMap(), null, false, toolbarControlCreator, null); //$NON-NLS-1$
resourceSelectionTree.setShowRemoveFromViewAction(false);
}
示例2: fillLocalToolBar
import org.eclipse.jface.action.ControlContribution; //导入依赖的package包/类
private void fillLocalToolBar(IToolBarManager manager) {
manager.add(new ControlContribution("connection status") {
@Override
protected Control createControl(Composite parent) {
connectionLabel = new Label(parent, SWT.NONE);
connectionLabel.setImage(redIcon);
return connectionLabel;
}
});
manager.add(autoReconnectAction);
manager.add(new Separator());
manager.add(pauseAction);
manager.add(discardAction);
manager.add(showWarningAction);
manager.add(showPrintAction);
manager.add(showTimestampAction);
manager.add(new Separator());
manager.add(clearAction);
}
示例3: contributeToToolBar
import org.eclipse.jface.action.ControlContribution; //导入依赖的package包/类
@Override
protected void contributeToToolBar(IToolBarManager toolBarManager) {
super.contributeToToolBar(toolBarManager);
ControlContribution toolBarCompositeContribution = new ControlContribution(getToolBarCompositeContributionId()) {
@Override
protected Control createControl(Composite parent) {
FormToolkit toolkit = getManagedForm().getToolkit();
Composite toolBarComposite = toolkit.createComposite(parent);
FormLayout toolBarCompositeLayout = new FormLayout();
toolBarCompositeLayout.marginTop = 0;
toolBarCompositeLayout.marginBottom = 0;
toolBarCompositeLayout.marginLeft = 4;
toolBarCompositeLayout.marginRight = 4;
toolBarCompositeLayout.spacing = 4;
toolBarComposite.setLayout(toolBarCompositeLayout);
_ToolBarLabel = toolkit.createLabel(toolBarComposite, "", SWT.RIGHT);
FormData toolBarLabelFormData = new FormData();
toolBarLabelFormData.top = new FormAttachment(0, 0);
toolBarLabelFormData.left = new FormAttachment(0, 0);
toolBarLabelFormData.right = new FormAttachment(100, 0);
// HACK: I really struggled to get this label to show up.
toolBarLabelFormData.width = 100;
_ToolBarLabel.setLayoutData(toolBarLabelFormData);
return toolBarComposite;
}
};
toolBarManager.add(toolBarCompositeContribution);
}