use of org.eclipse.ui.forms.widgets.TableWrapData in project jbosstools-hibernate by jbosstools.
the class FormTextEntry method fillIntoGrid.
private void fillIntoGrid(Composite parent, int indent) {
Layout layout = parent.getLayout();
if (layout instanceof GridLayout) {
GridData gd;
int span = ((GridLayout) layout).numColumns;
gd = new GridData(GridData.VERTICAL_ALIGN_CENTER);
gd.horizontalIndent = indent;
label.setLayoutData(gd);
int tspan = browse != null ? span - 2 : span - 1;
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = tspan;
gd.grabExcessHorizontalSpace = (tspan == 1);
gd.widthHint = 10;
text.setLayoutData(gd);
if (browse != null) {
gd = new GridData(GridData.VERTICAL_ALIGN_CENTER);
browse.setLayoutData(gd);
}
} else if (layout instanceof TableWrapLayout) {
TableWrapData td;
int span = ((TableWrapLayout) layout).numColumns;
td = new TableWrapData();
td.valign = TableWrapData.MIDDLE;
td.indent = indent;
label.setLayoutData(td);
int tspan = browse != null ? span - 2 : span - 1;
td = new TableWrapData(TableWrapData.FILL);
td.colspan = tspan;
td.grabHorizontal = (tspan == 1);
td.valign = TableWrapData.MIDDLE;
text.setLayoutData(td);
if (browse != null) {
td = new TableWrapData();
td.valign = TableWrapData.MIDDLE;
browse.setLayoutData(td);
}
}
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project jbosstools-hibernate by jbosstools.
the class RevEngDetailsPage method createContents.
public final void createContents(Composite parent) {
TableWrapLayout layout = new TableWrapLayout();
layout.topMargin = 5;
layout.leftMargin = 5;
layout.rightMargin = 2;
layout.bottomMargin = 2;
parent.setLayout(layout);
FormToolkit toolkit = mform.getToolkit();
Section section = toolkit.createSection(parent, Section.DESCRIPTION);
section.marginWidth = 10;
TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
td.grabHorizontal = true;
section.setLayoutData(td);
toolkit.createCompositeSeparator(section);
Composite client = toolkit.createComposite(section);
GridLayout glayout = new GridLayout();
glayout.marginWidth = glayout.marginHeight = 2;
glayout.numColumns = 2;
client.setLayout(glayout);
// client.setBackground(client.getDisplay().getSystemColor(SWT.COLOR_CYAN));
toolkit.paintBordersFor(section);
toolkit.paintBordersFor(client);
buildContents(toolkit, section, client);
section.setClient(client);
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project titan.EclipsePlug-ins by eclipse.
the class StatisticalView method createSection.
private Section createSection() {
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED);
TableWrapData td = new TableWrapData(TableWrapData.FILL);
td.colspan = 2;
section.setLayoutData(td);
section.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(final ExpansionEvent e) {
form.reflow(true);
}
});
File file = new File(this.logFileMetaData.getFilePath());
Date date = new Date(file.lastModified());
section.setText(file.getName());
section.setData(this.logFileMetaData.getProjectRelativePath());
// $NON-NLS-1$
section.setDescription(this.logFileMetaData.getProjectRelativePath() + " " + date.toString());
Composite sectionClient = toolkit.createComposite(section);
sectionClient.setLayout(new GridLayout());
createAmountTable(sectionClient);
this.ecError = toolkit.createExpandableComposite(sectionClient, ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
// $NON-NLS-1$
ecError.setText("Error test cases");
this.errorTestCasesTable = createTestCaseTable(ecError);
ecError.setClient(this.errorTestCasesTable);
ecError.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(final ExpansionEvent e) {
form.reflow(true);
}
});
this.ecFail = toolkit.createExpandableComposite(sectionClient, ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
// $NON-NLS-1$
ecFail.setText("Fail test cases");
this.failTestCasesTable = createTestCaseTable(ecFail);
ecFail.setClient(this.failTestCasesTable);
ecFail.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(final ExpansionEvent e) {
form.reflow(true);
}
});
this.ecTestCases = toolkit.createExpandableComposite(sectionClient, ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
// $NON-NLS-1$
ecTestCases.setText("Test cases");
this.testCases = createTestCaseTable(ecTestCases);
ecTestCases.setClient(this.testCases);
ecTestCases.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(final ExpansionEvent e) {
form.reflow(true);
}
});
section.setClient(sectionClient);
cachedSections.put(this.logFileMetaData.getProjectRelativePath(), section);
return section;
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class AlarmComments method createAlarmDetailsSection.
/**
* Create alarm details section
*/
private void createAlarmDetailsSection() {
final Section details = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
details.setText(Messages.get().AlarmComments_Details);
TableWrapData twd = new TableWrapData();
twd.grabHorizontal = true;
twd.align = TableWrapData.FILL;
details.setLayoutData(twd);
final Composite clientArea = toolkit.createComposite(details);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.makeColumnsEqualWidth = true;
clientArea.setLayout(layout);
details.setClient(clientArea);
alarmSeverity = new CLabel(clientArea, SWT.NONE);
toolkit.adapt(alarmSeverity);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
alarmSeverity.setLayoutData(gd);
alarmState = new CLabel(clientArea, SWT.NONE);
toolkit.adapt(alarmState);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
alarmState.setLayoutData(gd);
alarmSource = new CLabel(clientArea, SWT.NONE);
toolkit.adapt(alarmSource);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
alarmSource.setLayoutData(gd);
// $NON-NLS-1$
alarmText = toolkit.createLabel(clientArea, "", SWT.WRAP);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
alarmText.setLayoutData(gd);
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class SnmpCredentials method createSnmpCommunitySection.
/**
* Create "SNMP Communities" section
*/
private void createSnmpCommunitySection() {
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);
section.setText(Messages.get().SnmpConfigurator_SectionCommunities);
section.setDescription(Messages.get().SnmpConfigurator_SectionCommunitiesDescr);
TableWrapData td = new TableWrapData();
td.align = TableWrapData.FILL;
td.grabHorizontal = true;
section.setLayoutData(td);
Composite clientArea = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
clientArea.setLayout(layout);
section.setClient(clientArea);
snmpCommunityList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
toolkit.adapt(snmpCommunityList.getTable());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.verticalSpan = 2;
gd.heightHint = 150;
snmpCommunityList.getTable().setLayoutData(gd);
snmpCommunityList.getTable().setSortDirection(SWT.UP);
snmpCommunityList.setContentProvider(new ArrayContentProvider());
snmpCommunityList.setComparator(new StringComparator());
final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkAdd.setText(Messages.get().SnmpConfigurator_Add);
linkAdd.setImage(SharedIcons.IMG_ADD_OBJECT);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkAdd.setLayoutData(gd);
linkAdd.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addCommunity();
}
});
final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkRemove.setText(Messages.get().SnmpConfigurator_Remove);
linkRemove.setImage(SharedIcons.IMG_DELETE_OBJECT);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkRemove.setLayoutData(gd);
linkRemove.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
removeCommunity();
}
});
}
Aggregations