当前位置: 首页>>代码示例>>Java>>正文


Java ToolItem.setToolTipText方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.ToolItem.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java ToolItem.setToolTipText方法的具体用法?Java ToolItem.setToolTipText怎么用?Java ToolItem.setToolTipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.ToolItem的用法示例。


在下文中一共展示了ToolItem.setToolTipText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createToolItem

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
public ToolItem createToolItem(final ToolBar toolbar) {
    configureResources();
    item = new ToolItem(toolbar, SWT.RADIO);
    item.setImage(getImage());
    item.setToolTipText(getToolTip());
    item.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            js.showPage(JSmoothPage.this);
            ToolItem[] items = toolbar.getItems();
            for (int i = 0; i < items.length; i++) {
                if (items[i] != item) items[i].setSelection(false);
            }
        }
    });
    return item;
}
 
开发者ID:BisonSchweizAG,项目名称:JSmooth,代码行数:17,代码来源:JSmoothPage.java

示例2: 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

示例3: 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

示例4: dialogBuild

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
private void dialogBuild(ToolItem buildModeItem, MenuItem menuItem) {
	MobileBuilderBuildMode newBuildMode = (MobileBuilderBuildMode) menuItem.getData();
	if (dialogBuild(newBuildMode)) {
		buildModeItem.setImage(menuItem.getImage());
		buildModeItem.setToolTipText("Rebuild in: " + buildMode.label() + "\n" + buildMode.description());
		try {
			JSONObject device = new JSONObject(FileUtils.readFileToString(devicePref, "UTF-8"));
			device.put("buildMode", buildMode.name());
			FileUtils.write(devicePref, device.toString(4), "UTF-8");
		} catch (Exception ex) {
			Engine.logStudio.debug("Cannot save build mode", ex);
		}	
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:15,代码来源:ApplicationComponentEditor.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: doToolbar

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
private ViewForm doToolbar( String title, final ItemModel model, final Composite parent){

      final ViewForm vForm = ViewUtils.buildViewForm(title, model, parent);
      final ToolBar bar = new ToolBar(vForm, SWT.FLAT);

      ToolItem i_raw = new ToolItem(bar, SWT.RADIO);
      i_raw.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.RAW));
      i_raw.setToolTipText("Raw View");

      ToolItem i_pretty = new ToolItem(bar, SWT.RADIO);
      i_pretty.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.PRETTY));
      i_pretty.setToolTipText("Pretty View");

      ToolItem i_json = new ToolItem(bar, SWT.RADIO);
      i_json.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.JSON));
      i_json.setToolTipText("JSON View");

      ToolItem i_hex = new ToolItem(bar, SWT.RADIO);
      i_hex.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.HEX));
      i_hex.setToolTipText("Hex View");

      ToolItem i_br = new ToolItem(bar, SWT.RADIO);
      i_br.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.BROWSER));
      i_br.setToolTipText("View in Browser");

      vForm.setTopCenter(bar);

      return vForm;
   }
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:30,代码来源:ResponseView.java

示例9: ParamsAttachManager

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
ParamsAttachManager( final ItemModel model, final StyledText styledText, final ToolBar toolbar) {
   // this.swtText = swtText;
   this.toolBar = toolbar;

   ParamsOpen open = new ParamsOpen(this, model, styledText);

   i_open = new ToolItem(toolBar, SWT.PUSH);
   i_open.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN));
   i_open.setDisabledImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN_DIS));
   i_open.setToolTipText("Add File");
   i_open.addSelectionListener(open);
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:13,代码来源:ParamsAttachManager.java

示例10: initToolBar2

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
/**
 * add all toolbar buttons that come *after* the canvas toolbar
 */
private void initToolBar2() {
	
	new ToolItem(toolBar, SWT.SEPARATOR);
	
	bugReportItem = new ToolItem(toolBar, SWT.PUSH);
	bugReportItem.setToolTipText("Send a bug report or feature request");
	bugReportItem.setImage(Images.BUG);
	
	//new ToolItem(toolBar, SWT.SEPARATOR);
	
	toolBar.pack();
	updateToolBarSize();
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:17,代码来源:TrpMainWidgetView.java

示例11: 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

示例12: createLinkToolBar

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
private ToolBar createLinkToolBar(final CoolBar parent) {
    final ToolBar toolBar = new ToolBar(parent, toolbarStyle);

    linkButtonItem = new ToolItem(toolBar, SWT.PUSH);
    linkButtonItem.setToolTipText(Messages.getString("HTMLEditor.ConvertToHyperlinkToolTip")); //$NON-NLS-1$
    linkButtonItem.setImage(imageHelper.getImage("/images/htmleditor/link.gif")); //$NON-NLS-1$
    linkButtonItem.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            /*
             * IE and Mozilla do not give us the existing link on the
             * selecte item (if there is one) through any
             * queryCommandValue() invocation. To retrieve the current link,
             * call a special method on the HTMLEditor.
             */
            final Object existingLinkObject = evaluate("return editor.getLinkUnderSelection() || '';"); //$NON-NLS-1$
            final String initialValue =
                ((existingLinkObject instanceof String) && existingLinkObject.toString().length() > 0)
                    ? (String) existingLinkObject : "http://"; //$NON-NLS-1$

            final StringInputDialog dialog =
                new StringInputDialog(
                    getShell(),
                    Messages.getString("HTMLEditor.HyperlinkInputDialogPrompt"), //$NON-NLS-1$
                    initialValue,
                    Messages.getString("HTMLEditor.HyperlinkInputDialogTitle"), //$NON-NLS-1$
                    "HTMLEditor.toolBar.linkButtonItem"); //$NON-NLS-1$

            /*
             * Allow an empty string, to unset the link.
             */
            dialog.setRequired(false);

            if (dialog.open() == IDialogConstants.OK_ID) {
                if (dialog.getInput() != null && dialog.getInput().length() > 0) {
                    /*
                     * Disallow Javascript links. These would be removed
                     * during the round-trip through save anyway (see
                     * HtmlFilter).
                     */

                    if (dialog.getInput().startsWith("javascript:") == false) //$NON-NLS-1$
                    {
                        doEditorCommand("CreateLink", false, dialog.getInput()); //$NON-NLS-1$
                    }
                } else {
                    doEditorCommand("Unlink", false, null); //$NON-NLS-1$
                }
            }
        }
    });

    return toolBar;

}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:56,代码来源:HTMLEditor.java

示例13: AttachManager

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
AttachManager( final ItemModel model, final StyledText swtText, final ToolBar toolbar) {
//      this.swtText = swtText;
      this.toolBar = toolbar;

      Open open = new Open(model, swtText);
      
      i_open = new ToolItem(toolBar, SWT.PUSH);
      i_open.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN));
      i_open.setDisabledImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN_DIS));
      i_open.setToolTipText("Add File");
      i_open.addSelectionListener(open);
//      i_open.addSelectionListener(new SelectionAdapter() {
//         public void widgetSelected( SelectionEvent e){
//         }
//      });
      
//      // Menu(bar)
//      menu = new Menu(toolBar.getShell(), SWT.POP_UP);
//
//      MenuItem m_addBody = new MenuItem(menu, SWT.PUSH);
//      m_addBody.setText("Add File");
//      m_addBody.addSelectionListener(open);
//      m_attachPart = new MenuItem(menu, SWT.PUSH);
//      m_attachPart.setText("Attach File");
//      m_attachPart.addSelectionListener(open);
//
//      addBody = new ToolItem(toolBar, SWT.DROP_DOWN);
//      addBody.setImage(ResourceUtils.getImage(CoreImages.ATTACH));
//      addBody.setToolTipText("Add Body");
//      addBody.addListener(SWT.Selection, new Listener() {
//         public void handleEvent( Event event){
//            if (event.detail == SWT.ARROW) {
//               Rectangle rect = addBody.getBounds();
//               menu.setLocation(toolBar.toDisplay(rect.x, rect.y + rect.height));
//               menu.setVisible(true);
//            } else {
//               FileDialog fd = new FileDialog(toolBar.getShell(), SWT.OPEN);
//               fd.setText("Open");
//               // fd.setFilterPath("C:/");
//               fd.setFilterExtensions(CoreConstants.FILE_FILTER_EXT);
//               String file = fd.open();
//               if (file != null) {
//                  fileReadAction(file);
//               }
//            }
//         }
//      });
   }
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:49,代码来源:AttachManager.java

示例14: createViewItems

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
public void createViewItems(ToolBar tb) {
	visibilityItem = new DropDownToolItem(tb, false, true, true, SWT.CHECK);		
	visibilityItem.ti.setImage(Images.EYE);
	String vtt = "Visibility of items on canvas"; 
	
	showRegionsItem = visibilityItem.addItem("Show Regions", Images.EYE, vtt);
	showLinesItem = visibilityItem.addItem("Show Lines", Images.EYE, vtt);
	showBaselinesItem = visibilityItem.addItem("Show Baselines", Images.EYE, vtt);
	showWordsItem = visibilityItem.addItem("Show Words", Images.EYE, vtt);
	showPrintspaceItem = visibilityItem.addItem("Show Printspace", Images.EYE, vtt);
	renderBlackeningsItem = visibilityItem.addItem("Render Blackenings", Images.EYE, vtt);
	showReadingOrderRegionsMenuItem = visibilityItem.addItem("Show regions reading order", Images.EYE, vtt);
	showReadingOrderLinesMenuItem = visibilityItem.addItem("Show lines reading order", Images.EYE, vtt);
	showReadingOrderWordsMenuItem = visibilityItem.addItem("Show words reading order", Images.EYE, vtt);		

	selectionMode = new ToolItem(tb, SWT.RADIO);
	selectionMode.setToolTipText("Selection mode");
	selectionMode.setSelection(true);
	selectionMode.setImage(Images.getOrLoad("/icons/cursor.png"));
	modeMap.put(selectionMode, CanvasMode.SELECTION);

	zoomSelection = new ToolItem(tb, SWT.RADIO);
	zoomSelection.setToolTipText("Zoom selection mode");
	zoomSelection.setImage(Images.getOrLoad("/icons/zoom_rect.png"));
	modeMap.put(zoomSelection, CanvasMode.ZOOM);
	
	loupe = new ToolItem(tb, SWT.RADIO);
	loupe.setToolTipText("Loupe mode");
	loupe.setImage(Images.getOrLoad("/icons/zoom.png"));
	modeMap.put(loupe, CanvasMode.LOUPE);		
	
	// toolItem = new ToolItem(this, SWT.SEPARATOR);

	zoomIn = new ToolItem(tb, SWT.NONE);

	zoomIn.setToolTipText("Zoom in");
	zoomIn.setImage(Images.getOrLoad("/icons/zoom_in.png"));

	zoomOut = new ToolItem(tb, SWT.NONE);

	zoomOut.setToolTipText("Zoom out");
	zoomOut.setImage(Images.getOrLoad("/icons/zoom_out.png"));
			
	fitItem = new DropDownToolItem(tb, false, true, false, SWT.NONE);
	fitItem.addItem("Fit to page", Images.getOrLoad("/icons/arrow_in.png"), "Fit to page");
	fitItem.addItem("Original size", Images.getOrLoad( "/icons/arrow_out.png"), "Original size");
	fitItem.addItem("Fit to width", Images.getOrLoad("/icons/arrow_left_right.png"), "Fit to width");
	fitItem.addItem("Fit to height", Images.getOrLoad("/icons/arrow_up_down.png"), "Fit to height");
	
	rotateItem = new DropDownToolItem(tb, false, true, false, SWT.NONE);
	rotateItem.addItem("Rotate left", Images.getOrLoad("/icons/arrow_turn_left.png"), "Rotate left");
	rotateItem.addItem("Rotate right", Images.getOrLoad("/icons/arrow_turn_right.png"), "Rotate right");
	rotateItem.addItem("Rotate left 90 degress", Images.getOrLoad("/icons/arrow_turn_left_90.png"), "Rotate left 90 degress");
	rotateItem.addItem("Rotate right 90 degrees", Images.getOrLoad("/icons/arrow_turn_right_90.png"), "Rotate right 90 degrees");
	rotateItem.addItem("Translate left", Images.getOrLoad("/icons/arrow_left.png"), "Translate left");
	rotateItem.addItem("Translate right", Images.getOrLoad("/icons/arrow_right.png"), "Translate right");
	rotateItem.addItem("Translate up", Images.getOrLoad("/icons/arrow_up.png"), "Translate up");
	rotateItem.addItem("Translate down", Images.getOrLoad("/icons/arrow_down.png"), "Translate down");
	
	imageVersionDropdown = new DropDownToolItem(tb, true, false, true, SWT.RADIO);
	
	String versText = "Image file type displayed\n\torig: original image\n\tview: compressed viewing file\n\tbin: binarized image";
	imageVersionDropdown.addItem("orig", null, versText, false);
	imageVersionDropdown.addItem("view", null, versText, true);
	imageVersionDropdown.addItem("bin", null, versText, false);
	imageVersionDropdown.selectItem(1, false);
	
	imgEnhanceItem = new ToolItem(tb, SWT.PUSH);
	imgEnhanceItem.setImage(Images.CONTRAST);
	
	viewSettingsMenuItem = new ToolItem(tb, SWT.PUSH);
	viewSettingsMenuItem.setToolTipText("Change &viewing settings...");
	viewSettingsMenuItem.setImage(Images.getOrLoad("/icons/palette.png"));
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:75,代码来源:CanvasToolBar.java

示例15: initToolBar

import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
void initToolBar() {
		ToolBar toolBar = new ToolBar(this, SWT.FLAT | SWT.RIGHT);
		toolBar.setBounds(0, 0, 93, 25);
		
		expandAll = new ToolItem(toolBar, SWT.NONE);
		expandAll.setToolTipText("Expand all");
		expandAll.setImage(Images.getOrLoad("/icons/expandall.gif"));
		
		collapseAll = new ToolItem(toolBar, SWT.NONE);
		collapseAll.setToolTipText("Collapse all");
		collapseAll.setImage(Images.getOrLoad("/icons/collapseall.png"));
		
		clearPageItem = new ToolItem(toolBar, 0);
		clearPageItem.setToolTipText("Clear page content");
		clearPageItem.setImage(Images.CROSS);

		updateIDsItem = new ToolItem(toolBar, SWT.NONE);
		updateIDsItem.setToolTipText("Assigns unique IDs to all elements according to their current sorting");
//		updateIDsItem.setImage(Images.getOrLoad("/icons/refresh.gif"));
		updateIDsItem.setImage(Images.getOrLoad("/icons/update_id.png"));
//		updateIDsItem.setText("Update IDs");
		
		setReadingOrderRegions = new ToolItem(toolBar, SWT.NONE);
		setReadingOrderRegions.setToolTipText("Sets the reading order of the children of the selected element(s) according to their coordinates!");
		setReadingOrderRegions.setImage(Images.getOrLoad("/icons/reading_order_r.png"));
		
		assignGeometrically = new ToolItem(toolBar, SWT.NONE);
		assignGeometrically.setToolTipText("Assign child shapes to selected shape according to geometric overlap. If page is selected, all shapes will be reinserted according to geometric overlap");
		assignGeometrically.setImage(Images.getOrLoad("/icons/layout.png"));
//		
//		deleteReadingOrderRegions = new ToolItem(toolBar, SWT.NONE);
//		deleteReadingOrderRegions.setToolTipText("Deletes the reading order from the children of the selected element(s)!");
//		deleteReadingOrderRegions.setImage(Images.getOrLoad("/icons/reading_order_r_delete.png"));	
		
		moveUpButton = new ToolItem(toolBar, SWT.NONE);
		moveUpButton.setToolTipText("move shape up");
		moveUpButton.setImage(Images.getOrLoad("/icons/up2.gif"));

		moveDownButton = new ToolItem(toolBar, SWT.NONE);
		moveDownButton.setToolTipText("move shape down");
		moveDownButton.setImage(Images.getOrLoad("/icons/down2.gif"));
		
//		setReadingOrderLines = new ToolItem(toolBar, SWT.NONE);
//		setReadingOrderLines.setToolTipText("Sets the reading order of lines in the selected regions according to their y-x-coordinates!");
//		setReadingOrderLines.setImage(Images.getOrLoad("/icons/reading_order_lines.png"));
//		
//		setReadingOrderWords = new ToolItem(toolBar, SWT.NONE);
//		setReadingOrderWords.setToolTipText("Sets the reading order of words in the selected lines according to their x-y-coordinates!");
//		setReadingOrderWords.setImage(Images.getOrLoad("/icons/reading_order_words.png"));		
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:51,代码来源:StructureTreeWidget.java


注:本文中的org.eclipse.swt.widgets.ToolItem.setToolTipText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。