當前位置: 首頁>>代碼示例>>Java>>正文


Java ToolItem.setText方法代碼示例

本文整理匯總了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);
}
 
開發者ID:technology16,項目名稱:pgsqlblocks,代碼行數:26,代碼來源:DBProcessInfoView.java

示例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;
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:25,代碼來源:SWTCoolBarTestDemo.java

示例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;
}
 
開發者ID:juanerasmoe,項目名稱:pmTrans,代碼行數:11,代碼來源:BarManager.java

示例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);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:9,代碼來源:SchemaView.java

示例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;
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:17,代碼來源:FileViewerWindow.java

示例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;
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:17,代碼來源:FileViewerWindow.java

示例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;
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:13,代碼來源:BookButtonBar.java

示例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());
	}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:31,代碼來源:WordTranscriptionWidget.java


注:本文中的org.eclipse.swt.widgets.ToolItem.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。