本文整理汇总了Java中org.eclipse.jface.util.Util.isCocoa方法的典型用法代码示例。如果您正苦于以下问题:Java Util.isCocoa方法的具体用法?Java Util.isCocoa怎么用?Java Util.isCocoa使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.util.Util
的用法示例。
在下文中一共展示了Util.isCocoa方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hookApplicationMenu
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
private void hookApplicationMenu(@Nullable final Listener quitListener, final CallbackObject callbackObject) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
// Check platform
if (!Util.isCocoa()) {
logger.log(Level.WARNING, JFaceMessages.get("err.cocoa.enhancer.platform"));
}
initialize(callbackObject);
// Connect the quit/exit menu.
if (!display.isDisposed() && quitListener != null) {
display.addListener(SWT.Close, quitListener);
}
// Schedule disposal of callback object.
display.disposeExec(new Runnable() {
@Override
public void run() {
proc3Args.dispose();
}
});
}
示例2: constrainShellSize
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
@Override
protected void constrainShellSize() {
super.constrainShellSize();
if (Util.isCocoa()) {
final Tree tree = getTreeViewer().getTree();
final FontDescriptor treeFontDescriptor = FontDescriptor.createFrom(JFaceResources.getBannerFont()).setStyle(SWT.NORMAL);
final Font treeFont = treeFontDescriptor.createFont(tree.getDisplay());
updateTreeFont(treeFont);
tree.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
treeFontDescriptor.destroyFont(treeFont);
}
});
}
}
示例3: fixTextControlHeight
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
private void fixTextControlHeight(final Control control) {
if (Util.isCocoa() && control instanceof Text) {
control.getParent().layout(new Control[] { control });
}
}