本文整理汇总了Java中org.eclipse.swt.custom.ScrolledComposite.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java ScrolledComposite.setSize方法的具体用法?Java ScrolledComposite.setSize怎么用?Java ScrolledComposite.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.ScrolledComposite
的用法示例。
在下文中一共展示了ScrolledComposite.setSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createValuesComposite
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createValuesComposite(SashForm parent) {
final ScrolledComposite scrolledComposite = new ScrolledComposite(
parent, SWT.V_SCROLL | SWT.H_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setSize(SWT.DEFAULT, 100);
entriesComposite = new Composite(scrolledComposite, SWT.BORDER);
scrolledComposite.setContent(entriesComposite);
scrolledComposite.setMinSize(entriesComposite.computeSize(SWT.DEFAULT,
editor.getBundleGroup().getLocales().length * TEXT_MIN_HEIGHT));
entriesComposite.setLayout(new GridLayout(1, false));
Locale[] locales = editor.getBundleGroup().getLocales();
UIUtils.sortLocales(locales);
locales = UIUtils.filterLocales(locales);
for (int i = 0; i < locales.length; i++) {
Locale locale = locales[i];
addI18NEntry(locale);
}
/*editor.addChangeListener(new MessagesEditorChangeAdapter() {
public void selectedKeyChanged(String oldKey, String newKey) {
boolean isKey = newKey != null && editor.getBundleGroup().isMessageKey(newKey);
scrolledComposite.setBackground(isKey);
}
});*/
return scrolledComposite;
}
示例2: createValuesComposite
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createValuesComposite(SashForm parent) {
final ScrolledComposite scrolledComposite =
new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setSize(SWT.DEFAULT, 100);
final Composite entriesComposite =
new Composite(scrolledComposite, SWT.BORDER);
scrolledComposite.setContent(entriesComposite);
scrolledComposite.setMinSize(entriesComposite.computeSize(
SWT.DEFAULT,
editor.getBundleGroup().getLocales().length * TEXT_MIN_HEIGHT));
entriesComposite.setLayout(new GridLayout(1, false));
Locale[] locales = editor.getBundleGroup().getLocales();
UIUtils.sortLocales(locales);
locales = UIUtils.filterLocales(locales);
for (int i = 0; i < locales.length; i++) {
Locale locale = locales[i];
I18NEntry i18NEntry = new I18NEntry(
entriesComposite, editor, locale);
// entryComposite.addFocusListener(localBehaviour);
entryComposites.put(locale, i18NEntry);
}
editor.addChangeListener(new MessagesEditorChangeAdapter() {
public void selectedKeyChanged(String oldKey, String newKey) {
boolean isKey =
newKey != null && editor.getBundleGroup().isMessageKey(newKey);
// scrolledComposite.setBackground(isKey);
}
});
return scrolledComposite;
}
示例3: createValuesComposite
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createValuesComposite(final SashForm parent) {
final ScrolledComposite scrolledComposite =
new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setSize(SWT.DEFAULT, 100);
final Composite entriesComposite =
new Composite(scrolledComposite, SWT.BORDER);
scrolledComposite.setContent(entriesComposite);
scrolledComposite.setMinSize(entriesComposite.computeSize(
SWT.DEFAULT,
editor.getBundleGroup().getLocales().length * TEXT_MIN_HEIGHT));
entriesComposite.setLayout(new GridLayout(1, false));
Locale[] locales = editor.getBundleGroup().getLocales();
UIUtils.sortLocales(locales);
locales = UIUtils.filterLocales(locales);
for (int i = 0; i < locales.length; i++) {
final Locale locale = locales[i];
final I18NEntry i18NEntry = new I18NEntry(
entriesComposite, editor, locale);
// entryComposite.addFocusListener(localBehaviour);
entryComposites.put(locale, i18NEntry);
}
editor.addChangeListener(new MessagesEditorChangeAdapter() {
@Override
public void selectedKeyChanged(final String oldKey, final String newKey) {
final boolean isKey =
newKey != null && editor.getBundleGroup().isMessageKey(newKey);
// scrolledComposite.setBackground(isKey);
}
});
return scrolledComposite;
}
示例4: createControl
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
container = new Composite(sc, SWT.NONE);
GridLayout layout = new GridLayout(4, false);
container.setLayout(layout);
final Label label = new Label(container, SWT.TOP);
label.setText("txtUML Diagrams: ");
addInitialLayoutFields();
// diagram descriptions tree
ScrolledComposite treeComposite = new ScrolledComposite(container, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
tree = getDiagramTreeViewer(treeComposite);
tree.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
Iterator<?> selectedElements = ((IStructuredSelection) selection).iterator();
if (selectedElements.hasNext()) {
Object selectedElement = selectedElements.next();
if (selectedElement instanceof IJavaProject) {
List<Object> expandedElements = new ArrayList<>(Arrays.asList(tree.getExpandedElements()));
if (expandedElements.contains(selectedElement)) {
expandedElements.remove(selectedElement);
} else {
expandedElements.add(selectedElement);
}
tree.setExpandedElements(expandedElements.toArray());
} else if (selectedElement instanceof IType) {
List<Object> checkedElements = new ArrayList<>(Arrays.asList(tree.getCheckedElements()));
boolean isChecked = checkedElements.contains(selectedElement);
tree.setChecked(selectedElement, !isChecked);
IType selectedType = (IType) selectedElement;
if (!isChecked && !txtUMLLayout.contains(selectedType)) {
txtUMLLayout.add(selectedType);
} else {
txtUMLLayout.remove(selectedType);
}
selectElementsInDiagramTree(txtUMLLayout.toArray(), true);
}
}
}
});
selectElementsInDiagramTree(txtUMLLayout.toArray(), false);
setExpandedLayouts(txtUMLLayout);
GridData treeGd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
treeGd.heightHint = 200;
treeGd.widthHint = 150;
GridData labelGd = new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1);
labelGd.verticalIndent = 5;
label.setLayoutData(labelGd);
treeComposite.setLayoutData(treeGd);
treeComposite.setContent(tree.getControl());
treeComposite.setExpandHorizontal(true);
treeComposite.setExpandVertical(true);
sc.setContent(container);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
container.setSize(container.computeSize(450, 300, true));
sc.setMinSize(container.getSize());
sc.setSize(container.getSize());
setControl(parent);
setPageComplete(true);
}