本文整理了Java中org.eclipse.swt.widgets.Tree.getDisplay()
方法的一些代码示例,展示了Tree.getDisplay()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getDisplay()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:getDisplay
暂无
代码示例来源:origin: pentaho/pentaho-kettle
public static final void setOptimalWidthOnColumns( Tree tree ) {
int nrCols = tree.getColumnCount();
int[] max = new int[nrCols];
Image image = new Image( tree.getDisplay(), 10, 10 );
GC gc = new GC( image );
for ( int i = 0; i < max.length; i++ ) {
TreeColumn treeColumn = tree.getColumn( i );
Point point = gc.textExtent( treeColumn.getText() );
max[i] = point.x;
}
getMaxWidths( tree.getItems(), max, gc );
gc.dispose();
image.dispose();
for ( int i = 0; i < max.length; i++ ) {
TreeColumn treeColumn = tree.getColumn( i );
treeColumn.setWidth( max[i] + 30 );
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
private void update(final Tree tree) {
tree.getDisplay().asyncExec(new Runnable() {
public void run() {
tree.update();
tree.getParent().layout();
}
});
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void postSetSelection(final ISelection selection) {
if (isOkToUse(fTreeControl)) {
Display d= fTreeControl.getDisplay();
d.asyncExec(new Runnable() {
public void run() {
if (isOkToUse(fTreeControl)) {
selectElements(selection);
}
}
});
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui
protected void init(Viewer viewer) {
Control control = viewer.getControl();
if (control instanceof Tree) {
fTree = (Tree) control;
fTree.getDisplay().asyncExec(new Runnable() {
public void run() {
fTree.addTreeListener(JavaThreadEventHandler.this);
}
});
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
public void postSetSelection(final ISelection selection) {
if (isOkToUse(fTreeControl)) {
Display d= fTreeControl.getDisplay();
d.asyncExec(new Runnable() {
@Override
public void run() {
if (isOkToUse(fTreeControl)) {
selectElements(selection);
}
}
});
}
}
代码示例来源:origin: org.eclipse/org.eclipse.compare
private void sendPair(final Pair pair) {
if (fEditionTree != null && !fEditionTree.isDisposed()) {
Display display= fEditionTree.getDisplay();
display.asyncExec(
new Runnable() {
public void run() {
addMemberEdition(pair);
}
}
);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.compare
private void sendPair(final Pair pair) {
if (fEditionTree != null && !fEditionTree.isDisposed()) {
Display display= fEditionTree.getDisplay();
display.asyncExec(
() -> addMemberEdition(pair)
);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.pde.runtime
public void run() {
BusyIndicator.showWhile(fTreeViewer.getTree().getDisplay(),
new Runnable() {
public void run() {
fTreeViewer.refresh();
}
});
}
};
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
private void addUnableToPopulateTreeMessage(GC gc) {
// here we print a message when the document cannot be displayed just
// to give the
// user a visual cue
// so that they know how to proceed to edit the blank view
gc.setForeground(fTree.getDisplay().getSystemColor(SWT.COLOR_BLACK));
gc.setBackground(fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
gc.drawString(XMLEditorMessages.TreeExtension_0, 10, 10);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void stateChanged(final State newState) {
if (!this.equals(fView.getCurrentPage()) || fTreeViewer == null || fTreeViewer.getTree().isDisposed())
// if this page is not active, then wait until we call refresh on next activation
return;
fTreeViewer.getTree().getDisplay().asyncExec(() -> fTreeViewer.setInput(newState));
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
private void update(final Tree tree) {
tree.getDisplay().asyncExec(() -> {
if (!tree.isDisposed()) {
tree.update();
tree.getParent().layout();
}
});
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
private void update(final Tree tree) {
tree.getDisplay().asyncExec(() -> {
if (!tree.isDisposed()) {
tree.update();
tree.getParent().layout();
}
});
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible && fTreeViewer != null)
fTreeViewer.getTree().setFocus();
if (!fTreeUpdated){
fTreeViewer.getTree().getDisplay().asyncExec(new ValidTypesTask());
fTreeUpdated= true;
}
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible && fTreeViewer != null)
fTreeViewer.getTree().setFocus();
if (!fTreeUpdated){
fTreeViewer.getTree().getDisplay().asyncExec(new ValidTypesTask());
fTreeUpdated= true;
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible && fTreeViewer != null)
fTreeViewer.getTree().setFocus();
if (!fTreeUpdated){
fTreeViewer.getTree().getDisplay().asyncExec(new ValidTypesTask());
fTreeUpdated= true;
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
protected void addEmptyTreeMessage(GC gc) {
// here we print a message when the document is empty just to give the
// user a visual cue
// so that they know how to proceed to edit the blank view
gc.setForeground(fTree.getDisplay().getSystemColor(SWT.COLOR_BLACK));
gc.setBackground(fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
gc.drawString(XMLEditorMessages.XMLTreeExtension_3, 10, 10);
gc.drawString(XMLEditorMessages.XMLTreeExtension_4, 10, 10 + gc.getFontMetrics().getHeight());
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.runtime
@Override
public void run() {
BusyIndicator.showWhile(fTreeViewer.getTree().getDisplay(), () -> refresh(fTreeViewer.getInput()));
}
};
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void modelsChanged(PluginModelDelta delta) {
if (fTreeViewer == null || fTreeViewer.getTree().isDisposed())
return;
if (delta.getAddedEntries().length > 0 || delta.getChangedEntries().length > 0 || delta.getRemovedEntries().length > 0)
fTreeViewer.getTree().getDisplay().asyncExec(() -> fTreeViewer.refresh());
}
代码示例来源:origin: org.eclipse/org.eclipse.team.ui
private Font getCurrentRevisionFont() {
if (currentRevisionFont == null) {
Font defaultFont = JFaceResources.getDefaultFont();
FontData[] data = defaultFont.getFontData();
for (int i = 0; i < data.length; i++) {
data[i].setStyle(SWT.BOLD);
}
currentRevisionFont = new Font(viewer.getTree().getDisplay(), data);
}
return currentRevisionFont;
}
}
代码示例来源:origin: org.xworker/xworker_swt
private void initItem(Thing attribute, TreeItem item) {
item.setBackground(0, tree.getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
item.setData(attribute);
String name = attribute.getMetadata().getName();
String label = attribute.getMetadata().getLabel();
String value = editThing.getStringBlankAsNull(name);
if(value == null) {
item.setText(new String[] {label, ""});
}else {
item.setText(new String[] {label, value});
}
}
内容来源于网络,如有侵权,请联系作者删除!