本文整理汇总了Java中org.eclipse.jface.window.ToolTip类的典型用法代码示例。如果您正苦于以下问题:Java ToolTip类的具体用法?Java ToolTip怎么用?Java ToolTip使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ToolTip类属于org.eclipse.jface.window包,在下文中一共展示了ToolTip类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createColumns
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
private void createColumns(final TableViewer tableViewer) {
final String[] titles = { "Icon", "Name", "Small", "Medium", "Large", "Source", "Class" };
final int[] bounds = { 40, 200, 60, 60, 60, 200, 200 };
for (int i = 0; i < titles.length; i++) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
tableViewer.setSorter(new TableViewerSorter(titles));
viewerColumn.setLabelProvider(new TableCellLabelProvider());
final TableColumn column = viewerColumn.getColumn();
column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
column.setText(titles[i]);
column.setWidth(bounds[i]);
column.setResizable(true);
column.setMoveable(false);
}
final Table table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
}
示例2: createColumns
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
private void createColumns(final TableViewer tableViewer) {
final String[] titles = { "Relation", "Type", "Name" };
final int[] bounds = { 120, 100, 200 };
for (int i = 0; i < titles.length; i++) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
tableViewer.setSorter(new TableViewerSorter(titles));
viewerColumn.setLabelProvider(new TableCellLabelProvider());
final TableColumn column = viewerColumn.getColumn();
column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
column.setText(titles[i]);
column.setWidth(bounds[i]);
column.setResizable(true);
column.setMoveable(false);
}
final Table table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
// Object[] projectsToSelect = openProjects.toArray();
// IViewPart view = window.getActivePage().showView( "org.eclipse.jdt.ui.PackageExplorer" );
// view.getSite().getSelectionProvider().setSelection( new StructuredSelection( projectsToSelect ) );
}
示例3: createColumns
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
private void createColumns(final TableViewer tableViewer) {
final String[] titles = { "Class" };
final int[] bounds = { 120, 100, 200 };
for (int i = 0; i < titles.length; i++) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
tableViewer.setSorter(new TableViewerSorter(titles));
viewerColumn.setLabelProvider(new TableCellLabelProvider());
final TableColumn column = viewerColumn.getColumn();
column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
column.setText(titles[i]);
column.setWidth(bounds[i]);
column.setResizable(true);
column.setMoveable(false);
}
final Table table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
}
示例4: createDialogArea
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite container) {
Control area = super.createDialogArea(container);
TableViewer tableViewer = getTableViewer();
Table table = tableViewer.getTable();
tableViewer.setLabelProvider(new DefaultCellLabelProvider());
ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.NO_RECREATE);
table.setHeaderVisible(true);
newTableColumn(table, "Description", 200);
newTableColumn(table, "ID", 200);
newTableColumn(table, "Name", 200);
tableViewer.refresh();
return area;
}
示例5: updateFormBookmarkProblems
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
private void updateFormBookmarkProblems(Bookmark bookmark) {
if (bookmark == null) {
form.setMessage(null);
return;
}
// We do not consider bookmark problems with severity info
Set<BookmarkProblem> problems = bookmarkProblems.getBookmarkProblems(bookmark.getId()).stream()
.filter(bookmarkProblem -> getBookmarkProblemSeverity(bookmarkProblem) != Severity.INFO)
.collect(Collectors.toSet());
if (problems.size() == 0) {
form.setMessage(null);
return;
}
BookmarkProblem firstProblem = problems.iterator().next();
int type = getBookmarkProblemSeverity(firstProblem) == Severity.ERROR ? IMessageProvider.ERROR
: IMessageProvider.WARNING;
form.setMessage(problems.size() == 1 ? "One bookmark problem detected"
: "" + problems.size() + " bookmark problems detected", type);
if (bookmarkProblemsTooltip == null) {
Control control = Stream.of(form.getHead().getChildren()).filter(child -> child instanceof CLabel)
.findFirst().get();
// bug in form ? Without this line, background for the message is
// sometimes gray
control.setBackground(getSite().getShell().getDisplay().getSystemColor(SWT.COLOR_TRANSPARENT));
bookmarkProblemsTooltip = new BookmarkProblemsTooltip(toolkit, control, ToolTip.NO_RECREATE,
bookmarkProblems) {
public Point getLocation(Point tipSize, Event event) {
Rectangle bounds = control.getBounds();
return control.getParent().toDisplay(bounds.x, bounds.y);
}
};
bookmarkProblemsTooltip.setHideOnMouseDown(false);
}
bookmarkProblemsTooltip.setBookmark(bookmark.getId());
}
示例6: ConfigurationCellEditor
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
/**
* Constructs a CellEditor with a given viewer for the given column.
*
* @param viewer for the table
* @param columnType Parameter for the Cell editor.
*/
public ConfigurationCellEditor(TreeViewer viewer, ColumnType columnType) {
super(viewer);
this.columnType = columnType;
this.viewer = viewer;
// Activate the tooltip support for the viewer
ColumnViewerToolTipSupport.enableFor(viewer, ToolTip.NO_RECREATE);
}
示例7: ToolTipListener
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
/**
* Creates a tooltip listener.
*
* @param control the control to attach to
* @param tooltip the tooltip string
*/
public ToolTipListener(Control control, String tooltip) {
this.control = control;
this.tooltip = new DefaultToolTip(control, ToolTip.NO_RECREATE, true);
this.tooltip.setText(tooltip);
this.tooltip.setHideDelay(0);
}
示例8: createControl
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
super.createControl(parent);
Composite container = new Composite(parent, SWT.NONE);
GridLayout layout = WizardUtils.createGridLayout(1, 5);
container.setLayout(layout);
_newRadio = WizardUtils.createRadio(container, "Create a new application:", 1, this); // $NLX-NameBluemixWizardPage.Createanewapplication-1$
_newRadio.setSelection(true);
_nameText = WizardUtils.createText(container, 1, 20);
_nameText.addModifyListener(this);
_existingRadio = WizardUtils.createRadio(container, "Overwrite an existing application:", 1, this); // $NLX-NameBluemixWizardPage.Overwriteanexistingapplication-1$
_appViewer = WizardUtils.createTableViewer(container, 1, 1, null, SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL, 20);
ColumnViewerToolTipSupport.enableFor(_appViewer, ToolTip.NO_RECREATE);
_appViewer.getTable().setToolTipText("Choose application"); // $NLX-NameBluemixWizardPage.ChooseApplication-1$
_appViewer.getTable().setHeaderVisible(false);
_appViewer.getTable().setLinesVisible(false);
_appViewer.getTable().addControlListener(this);
_appViewer.setContentProvider(new ArrayContentProvider());
_appViewer.addSelectionChangedListener(this);
_appViewer.getTable().addSelectionListener(this);
// Create the only column
TableViewerColumn col = new TableViewerColumn(_appViewer, SWT.LEFT);
col.getColumn().setResizable(false);
col.setLabelProvider(new ColumnLabelProvider());
// Create Host Group
_hostGroup = WizardUtils.createGroup(container, 3, 3);
WizardUtils.createLabel(_hostGroup, "Host:", 1); // $NLX-NameBluemixWizardPage.Host-1$
_hostText = WizardUtils.createText(_hostGroup, 1, 0);
_hostText.addModifyListener(this);
_domainLabel = WizardUtils.createLabel(_hostGroup, "", 1);
setControl(container);
}
示例9: CheckBoxToolTip
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
public CheckBoxToolTip(Control control) {
super(control, ToolTip.RECREATE, true);
image = control.getDisplay().getSystemImage(SWT.ICON_INFORMATION);
listeners = new ArrayList<CheckBoxToolTipListener>();
visible = false;
display=control.getDisplay();
super.setRespectMonitorBounds(true);
super.setRespectDisplayBounds(true);
super.setHideDelay(50000);
super.setPopupDelay(0);
super.setHideOnMouseDown(false);
}
示例10: createTableViewer
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
/**
* Create a table viewer under the given parent. Initializes the viewer with
* the given input. Uses SpotterExtensionsContentProvider as content
* provider and SpotterExtensionsLabelProvider as label provider.
*
* @param parent
* The parent composite. Must not be <code>null</code>.
* @param input
* The input of the viewer. Must not be <code>null</code>.
* @param editor
* The underlying editor if any or <code>null</code>.
* @param dragAndDropSupport
* Determines whether drag 'n drop is supported.
*
* @return the created table viewer
*
* @see SpotterExtensionsContentProvider
* @see SpotterExtensionsLabelProvider
*/
public static TableViewer createTableViewer(Composite parent, IExtensionItem input,
AbstractExtensionsEditor editor, boolean dragAndDropSupport) {
if (parent == null) {
throw new IllegalArgumentException("parent must not be null");
}
if (input == null) {
throw new IllegalArgumentException("input must not be null");
}
// configure table layout
Composite tblExtensionsComp = new Composite(parent, SWT.NONE);
tblExtensionsComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
TableColumnLayout tblExtensionsColLayout = new TableColumnLayout();
tblExtensionsComp.setLayout(tblExtensionsColLayout);
// create table
Table table = new Table(tblExtensionsComp, VIEWER_CONTROL_STYLE);
table.setHeaderVisible(false);
table.setLinesVisible(false);
// create viewer for table
TableViewer tableViewer = new TableViewer(table);
ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.NO_RECREATE);
TableViewerColumn extensionsColumn = new TableViewerColumn(tableViewer, SWT.NONE);
tblExtensionsColLayout.setColumnData(extensionsColumn.getColumn(), new ColumnWeightData(1));
if (dragAndDropSupport) {
addDragAndDropSupport(tableViewer, editor, false);
}
tableViewer.setContentProvider(new SpotterExtensionsContentProvider());
tableViewer.setLabelProvider(new SpotterExtensionsLabelProvider());
tableViewer.setInput(input);
return tableViewer;
}
示例11: createTreeViewer
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
/**
* Create a tree viewer under the given parent. Initializes the viewer with
* the given input. Uses SpotterExtensionsContentProvider as content
* provider and SpotterExtensionsLabelProvider as label provider.
*
* @param parent
* The parent composite. Must not be <code>null</code>. It is
* recommended to use a {@link GridLayout} on the parent or at
* least a layout that has set the <i>fill flag</i>.
* @param input
* The input of the viewer. Must not be <code>null</code>.
* @param editor
* The underlying editor if any or <code>null</code>.
* @param dragAndDropSupport
* Determines whether drag 'n drop is supported.
*
* @return the created table viewer
*
* @see SpotterExtensionsContentProvider
* @see SpotterExtensionsLabelProvider
*/
public static TreeViewer createTreeViewer(Composite parent, IExtensionItem input, AbstractExtensionsEditor editor,
boolean dragAndDropSupport) {
if (parent == null) {
throw new IllegalArgumentException("parent must not be null");
}
if (input == null) {
throw new IllegalArgumentException("input must not be null");
}
// configure tree layout
Composite treeExtensionsComp = new Composite(parent, SWT.NONE);
if (parent.getLayout() instanceof GridLayout) {
treeExtensionsComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}
TreeColumnLayout treeExtensionsColLayout = new TreeColumnLayout();
treeExtensionsComp.setLayout(treeExtensionsColLayout);
// create tree
Tree tree = new Tree(treeExtensionsComp, VIEWER_CONTROL_STYLE);
tree.setHeaderVisible(false);
tree.setLinesVisible(false);
// create viewer for tree
TreeViewer treeViewer = new TreeViewer(tree);
ColumnViewerToolTipSupport.enableFor(treeViewer, ToolTip.NO_RECREATE);
TreeViewerColumn extensionsColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
treeExtensionsColLayout.setColumnData(extensionsColumn.getColumn(), new ColumnWeightData(1));
if (dragAndDropSupport) {
addDragAndDropSupport(treeViewer, editor, true);
}
treeViewer.setContentProvider(new SpotterExtensionsContentProvider());
treeViewer.setLabelProvider(new SpotterExtensionsLabelProvider());
treeViewer.setInput(input);
return treeViewer;
}
示例12: createTableViewer
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
private void createTableViewer(Composite grpProperties) {
// configure table layout
Composite tblPropertiesComp = new Composite(grpProperties, SWT.NONE);
tblPropertiesComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, TABLE_COMPOSITE_HOR_SPAN, 1));
TableColumnLayout tableColLayout = new TableColumnLayout();
tblPropertiesComp.setLayout(tableColLayout);
// create table
tblProperties = new Table(tblPropertiesComp, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL
| SWT.V_SCROLL);
tblProperties.setHeaderVisible(true);
tblProperties.setLinesVisible(true);
// create viewer for table
propertiesTblViewer = new TableViewer(tblProperties);
ColumnViewerToolTipSupport.enableFor(propertiesTblViewer, ToolTip.NO_RECREATE);
TableViewerColumn nameColumn = new TableViewerColumn(propertiesTblViewer, SWT.NONE);
nameColumn.getColumn().setText("name");
tableColLayout.setColumnData(nameColumn.getColumn(), new ColumnWeightData(TABLE_COLUMN_NAME_WEIGHT));
TableViewerColumn valueColumn = new TableViewerColumn(propertiesTblViewer, SWT.NONE);
valueColumn.getColumn().setText("value");
tableColLayout.setColumnData(valueColumn.getColumn(), new ColumnWeightData(TABLE_COLUMN_VALUE_WEIGHT));
editingSupport = new PropertiesEditingSupport(valueColumn.getViewer(), editor, this);
valueColumn.setEditingSupport(editingSupport);
propertiesTblViewer.setContentProvider(new PropertiesContentProvider());
propertiesTblViewer.setLabelProvider(new PropertiesLabelProvider(this));
PropertiesComparator comparator = new PropertiesComparator();
nameColumn.getColumn().addSelectionListener(createColumnSelectionAdapter(comparator));
propertiesTblViewer.setComparator(comparator);
}
示例13: MedicationHistoryTableComposite
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
public MedicationHistoryTableComposite(Composite parent, int style){
super(parent, style);
setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
layout = new TableColumnLayout();
setLayout(layout);
viewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
viewer.getTable().setHeaderVisible(true);
ColumnViewerToolTipSupport.enableFor(viewer, ToolTip.NO_RECREATE);
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent e){
IStructuredSelection is = (IStructuredSelection) viewer.getSelection();
MedicationTableViewerItem presc = (MedicationTableViewerItem) is.getFirstElement();
// set last disposition information
IPersistentObject po = (presc != null) ? presc.getLastDisposed() : null;
medicationComposite.setLastDisposalPO(po);
// set writable databinding value
medicationComposite.setSelectedMedication(presc);
ElexisEventDispatcher
.fireSelectionEvent((presc != null) ? presc.getPrescription() : null);
}
});
MedicationViewerHelper.createTypeColumn(viewer, layout, 0);
MedicationViewerHelper.createArticleColumn(viewer, layout, 1);
MedicationViewerHelper.createDosageColumn(viewer, layout, 2);
MedicationViewerHelper.createBeginColumn(viewer, layout, 3);
MedicationViewerHelper.createIntakeCommentColumn(viewer, layout, 4);
MedicationViewerHelper.createStopColumn(viewer, layout, 5);
MedicationViewerHelper.createStopReasonColumn(viewer, layout, 6);
MedicationViewerHelper.createMandantColumn(viewer, layout, 7);
viewer.setContentProvider(new MedicationTableViewerContentProvider(viewer));
}
示例14: CheckBoxToolTip
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
public CheckBoxToolTip( Control control ) {
super( control, ToolTip.RECREATE, true );
image = control.getDisplay().getSystemImage( SWT.ICON_INFORMATION );
listeners = new ArrayList<CheckBoxToolTipListener>();
visible = false;
display = control.getDisplay();
super.setRespectMonitorBounds( true );
super.setRespectDisplayBounds( true );
super.setHideDelay( 50000 );
super.setPopupDelay( 0 );
super.setHideOnMouseDown( false );
}
示例15: TreeViewerBuilder
import org.eclipse.jface.window.ToolTip; //导入依赖的package包/类
/**
* Creates a new TreeViewerBuilder.
*/
public TreeViewerBuilder(Composite parent, int style) {
mappings = Collections.emptyMap();
checkable = (style & SWT.CHECK) == SWT.CHECK;
if (checkable) {
viewer = new CheckboxTreeViewer(parent, style);
}
else {
viewer = new TreeViewer(parent, style);
}
// enable tooltip support
ColumnViewerToolTipSupport.enableFor(viewer, ToolTip.NO_RECREATE);
}