本文整理汇总了Java中org.eclipse.ui.forms.widgets.SharedScrolledComposite类的典型用法代码示例。如果您正苦于以下问题:Java SharedScrolledComposite类的具体用法?Java SharedScrolledComposite怎么用?Java SharedScrolledComposite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SharedScrolledComposite类属于org.eclipse.ui.forms.widgets包,在下文中一共展示了SharedScrolledComposite类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScrolledComposite
import org.eclipse.ui.forms.widgets.SharedScrolledComposite; //导入依赖的package包/类
/**
* Creates a scrolled composite
*
* @param parent the parent to add to
* @param columns the number of columns for the composite
* @param hspan the horizontal span to take up in the parent
* @param marginwidth the width of the margins
* @param marginheight the height of the margins
* @return a new scrolled composite
*/
public static SharedScrolledComposite createScrolledComposite(Composite parent, int columns, int hspan, int marginwidth, int marginheight) {
SharedScrolledComposite comp = new SharedScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL) {};
GridLayout layout = new GridLayout(columns, false);
layout.marginHeight = marginheight;
layout.marginWidth = marginwidth;
comp.setLayout(layout);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = hspan;
comp.setLayoutData(gd);
comp.setExpandHorizontal(true);
comp.setExpandVertical(true);
return comp;
}
示例2: internalRefresh
import org.eclipse.ui.forms.widgets.SharedScrolledComposite; //导入依赖的package包/类
@Override
protected void internalRefresh(Widget widget, Object element,
boolean doStruct, boolean updateLabels) {
super.internalRefresh(widget, element, doStruct, updateLabels);
IEditorPart current = EditorPartUtils.getCurrent(getSite());
if(current != null) {
Object adapter = current.getAdapter(SharedScrolledComposite.class);
if(adapter instanceof SharedScrolledComposite) {
SharedScrolledComposite composite = (SharedScrolledComposite) adapter;
boolean flushCache = true;
composite.reflow(flushCache);
}
}
}