use of org.eclipse.swt.events.ExpandAdapter in project convertigo by convertigo.
the class ComponentExplorerComposite method initialize.
/**
* This method initializes this
*/
protected void initialize() {
setLayout(new GridLayout(3, true));
GridData gridData;
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 3;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = GridData.BEGINNING;
Composite searchComposite = new Composite(this, SWT.NONE);
searchComposite.setLayoutData(gridData);
searchComposite.setLayout(new GridLayout(3, false));
CLabel searchLabel = new CLabel(searchComposite, SWT.NONE);
searchLabel.setText("Search:");
Text searchText = new Text(searchComposite, SWT.LEFT | SWT.BORDER | SWT.SINGLE);
searchText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
searchText.setText("");
searchText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
search(searchText.getText());
}
});
Button btnClear = new Button(searchComposite, SWT.NONE);
btnClear.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
searchText.setText("");
searchText.setFocus();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
searchText.setText("");
searchText.setFocus();
}
});
btnClear.setText("Clear");
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 2;
gridData.verticalAlignment = SWT.TOP;
gridData.grabExcessVerticalSpace = true;
scrolledComposite = new ScrolledComposite(this, SWT.V_SCROLL);
scrolledComposite.setLayoutData(gridData);
bar = new ExpandBar(scrolledComposite, SWT.NONE);
bar.setSpacing(8);
bar.addExpandListener(new ExpandAdapter() {
@Override
public void itemExpanded(ExpandEvent e) {
refresh();
}
@Override
public void itemCollapsed(ExpandEvent e) {
refresh();
}
});
scrolledComposite.setContent(bar);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
refresh();
}
});
helpBrowser = new C8oBrowser(this, SWT.MULTI | SWT.WRAP);
helpBrowser.setUseExternalBrowser(true);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessVerticalSpace = true;
gridData.grabExcessHorizontalSpace = true;
helpBrowser.setLayoutData(gridData);
ComponentManager.refresh();
getDisplay().asyncExec(() -> {
search("");
});
}
use of org.eclipse.swt.events.ExpandAdapter in project convertigo by convertigo.
the class ComponentExplorerComposite method initialize.
/**
* This method initializes this
*/
protected void initialize() {
setLayout(new GridLayout(3, true));
GridData gridData;
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 3;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = GridData.BEGINNING;
Composite searchComposite = new Composite(this, SWT.NONE);
searchComposite.setLayoutData(gridData);
searchComposite.setLayout(new GridLayout(3, false));
CLabel searchLabel = new CLabel(searchComposite, SWT.NONE);
searchLabel.setText("Search:");
Text searchText = new Text(searchComposite, SWT.LEFT | SWT.BORDER | SWT.SINGLE);
searchText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
searchText.setText("");
searchText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
search(searchText.getText());
}
});
Button btnClear = new Button(searchComposite, SWT.NONE);
btnClear.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
searchText.setText("");
searchText.setFocus();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
searchText.setText("");
searchText.setFocus();
}
});
btnClear.setText("Clear");
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 2;
gridData.verticalAlignment = SWT.TOP;
gridData.grabExcessVerticalSpace = true;
scrolledComposite = new ScrolledComposite(this, SWT.V_SCROLL);
scrolledComposite.setLayoutData(gridData);
bar = new ExpandBar(scrolledComposite, SWT.NONE);
bar.setSpacing(8);
bar.addExpandListener(new ExpandAdapter() {
@Override
public void itemExpanded(ExpandEvent e) {
refresh();
}
@Override
public void itemCollapsed(ExpandEvent e) {
refresh();
}
});
scrolledComposite.setContent(bar);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
refresh();
}
});
helpBrowser = new C8oBrowser(this, SWT.MULTI | SWT.WRAP);
helpBrowser.setUseExternalBrowser(true);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessVerticalSpace = true;
gridData.grabExcessHorizontalSpace = true;
helpBrowser.setLayoutData(gridData);
ComponentManager.refresh();
getDisplay().asyncExec(() -> {
search("");
});
}
Aggregations