本文整理汇总了Java中org.eclipse.swt.widgets.ToolItem.setText方法的典型用法代码示例。如果您正苦于以下问题:Java ToolItem.setText方法的具体用法?Java ToolItem.setText怎么用?Java ToolItem.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.ToolItem
的用法示例。
在下文中一共展示了ToolItem.setText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContent
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
private void createContent() {
toolBar = new ToolBar(this, SWT.HORIZONTAL);
toolBar.setEnabled(false);
GridLayout layout = new GridLayout();
GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
toolBar.setLayout(layout);
toolBar.setLayoutData(layoutData);
ToolItem cancelProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
cancelProcessToolItem.setText(resourceBundle.getString("cancel_process"));
cancelProcessToolItem.addListener(SWT.Selection, event -> {
listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewCancelProcessToolItemClicked);
});
ToolItem terminateProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
terminateProcessToolItem.setText(resourceBundle.getString("kill_process"));
terminateProcessToolItem.addListener(SWT.Selection, event -> {
listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewTerminateProcessToolItemClicked);
});
processInfoText = new Text(this, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
GridData textLayoutData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
textLayoutData.heightHint = 200;
processInfoText.setLayoutData(textLayoutData);
}
示例2: createContents
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
protected Control createContents(Composite parent) {
// --- Create the window title. ---
getShell().setText("CoolBar Test");
String asCoolItemSection[] = { "File", "Formatting", "Search" };
CoolBar composite = new CoolBar(parent, SWT.NONE);
for (int idxCoolItem = 0; idxCoolItem < 3; ++idxCoolItem) {
CoolItem item = new CoolItem(composite, SWT.NONE);
ToolBar tb = new ToolBar(composite, SWT.FLAT);
for (int idxItem = 0; idxItem < 3; ++idxItem) {
ToolItem ti = new ToolItem(tb, SWT.NONE);
ti
.setText(asCoolItemSection[idxCoolItem] + " Item #"
+ idxItem);
}
Point p = tb.computeSize(SWT.DEFAULT, SWT.DEFAULT);
tb.setSize(p);
Point p2 = item.computeSize(p.x, p.y);
item.setControl(tb);
item.setSize(p2);
}
return composite;
}
示例3: addItemToToolBar
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
private ToolItem addItemToToolBar(ToolBar bar, String text, String toolTip,
int type) {
ToolItem cit = new ToolItem(bar, type);
if (text != null)
cit.setText(text);
if (toolTip != null)
cit.setToolTipText(toolTip);
return cit;
}
示例4: setToolItemIcon
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
private void setToolItemIcon(ToolItem toolItem, String iconPath, String text, String tooltip) {
try {
toolItem.setImage(ConvertigoPlugin.getDefault().getStudioIcon(iconPath));
} catch (IOException e1) {
toolItem.setText(text);
}
toolItem.setToolTipText(tooltip);
}
示例5: createCopyToolItem
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
/**
* Create the copy tool item (button).
*/
protected ToolItem createCopyToolItem() {
ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setImage(imageManager.get(ImageManager.ICON_COPY));
toolItem.setText(textBundle.get("FileViewerWindow.CopyButton")); //$NON-NLS-1$
toolItem.setToolTipText(textBundle.get("FileViewerWindow.CopyTooltip")); //$NON-NLS-1$
toolItem.setEnabled(true);
toolItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getContentTypeAdapter().copy();
}
});
return toolItem;
}
示例6: createPrintToolItem
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
/**
* Create the print tool item (button).
*/
protected ToolItem createPrintToolItem() {
ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setImage(imageManager.get(ImageManager.ICON_PRINT_FILE));
toolItem.setText(textBundle.get("PrintButton")); //$NON-NLS-1$
toolItem.setToolTipText(textBundle.get("FileViewerWindow.PrintTooltip")); //$NON-NLS-1$
toolItem.setEnabled(true);
toolItem.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {
getContentTypeAdapter().print();
}
});
return toolItem;
}
示例7: addIconButton
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
public ToolItem addIconButton(ToolBar toolBar, Command cmd) {
final ToolItem item = new ToolItem(toolBar, SWT.PUSH);
String icon = "icons/" + cmd.name().toLowerCase() + ".png";
item.setImage(PaintShop.getImage(icon));
item.setText("");
item.setToolTipText(cmd.getToolTip());
item.setData(cmd);
item.addSelectionListener(this);
return item;
}
示例8: WordTranscriptionWidget
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
public WordTranscriptionWidget(final Composite parent, int style, TrpSettings settings, TrpMainWidgetView view) {
super(parent, style, settings, view);
deleteWordTextItem.setEnabled(true);
applyTextFromWords = new ToolItem(regionsPagingToolBar.getToolBar(), SWT.CHECK);
applyTextFromWords.setImage(Images.getOrLoad("/icons/arrow_merge.png"));
applyTextFromWords.setText("Sync with lines");
applyTextFromWords.setToolTipText("Enable to sync the text in the words with the text in the corresponding lines - warning: overwrites the text content in the lines!");
applyTextFromWords.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (currentRegionObject != null) {
logger.debug("applying text from words to lines and region!");
if (applyTextFromWords.getSelection()) {
if (DialogUtil.showYesNoDialog(parent.getShell(),
"Synchronize word text to lines", "Do you really want to overwrite the text in the lines with text from the words?") == SWT.YES) {
applyTextFromWords();
}
else {
applyTextFromWords.setSelection(false);
}
}
}
}
});
// applyTextFromWords.setEnabled(!isLinesInSyncWithWordsText());
}