use of org.eclipse.swt.layout.RowLayout in project sling by apache.
the class DebugEditorSection method createSection.
@Override
public void createSection(Composite parent) {
super.createSection(parent);
FormToolkit toolkit = getFormToolkit(parent.getDisplay());
Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
section.setText("Debug");
section.setDescription("Resolving sources when connecting in debug mode ensure that you have up-to-date source attachments which reflect the " + "bundles running in the remote instance. However, initial resolve can be slow.");
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
// ports
Composite composite = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginHeight = 8;
layout.marginWidth = 8;
composite.setLayout(layout);
GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
composite.setLayoutData(gridData);
toolkit.paintBordersFor(composite);
section.setClient(composite);
resolveSourcesButton = toolkit.createButton(composite, "Resolve sources when connecting", SWT.CHECK);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
resolveSourcesButton.setLayoutData(data);
actionArea = toolkit.createComposite(composite);
RowLayout actionAreaLayout = new RowLayout();
actionAreaLayout.center = true;
actionArea.setLayout(actionAreaLayout);
initialize();
}
use of org.eclipse.swt.layout.RowLayout in project sling by apache.
the class InstallEditorSection method createSection.
@Override
public void createSection(Composite parent) {
super.createSection(parent);
FormToolkit toolkit = getFormToolkit(parent.getDisplay());
Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
section.setText("Install");
section.setDescription("Specify how to install bundles on the server");
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
// ports
Composite composite = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginHeight = 8;
layout.marginWidth = 8;
composite.setLayout(layout);
GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
composite.setLayoutData(gridData);
toolkit.paintBordersFor(composite);
section.setClient(composite);
bundleLocalInstallButton = toolkit.createButton(composite, "Install bundles via bundle upload", SWT.RADIO);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
bundleLocalInstallButton.setLayoutData(data);
quickLocalInstallButton = toolkit.createButton(composite, "Install bundles directly from the filesystem", SWT.RADIO);
data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
quickLocalInstallButton.setLayoutData(data);
actionArea = toolkit.createComposite(composite);
RowLayout actionAreaLayout = new RowLayout();
actionAreaLayout.center = true;
actionArea.setLayout(actionAreaLayout);
initialize();
}
use of org.eclipse.swt.layout.RowLayout in project eclipse.platform.text by eclipse.
the class MarkerInformationControl method setInput.
@SuppressWarnings("unchecked")
@Override
public void setInput(Object input) {
this.composites.values().forEach(Composite::dispose);
this.markers = (List<IMarker>) input;
for (IMarker marker : this.markers) {
Composite markerComposite = new Composite(parent, SWT.NONE);
this.composites.put(marker, markerComposite);
GridLayout gridLayout = new GridLayout(1, false);
gridLayout.verticalSpacing = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
markerComposite.setLayout(gridLayout);
Composite markerLine = new Composite(markerComposite, SWT.NONE);
RowLayout rowLayout = new RowLayout();
rowLayout.marginTop = 0;
rowLayout.marginBottom = 0;
rowLayout.marginLeft = 0;
rowLayout.marginRight = 0;
markerLine.setLayout(rowLayout);
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(marker);
if (resolutions.length > 0) {
Label markerImage = new Label(markerLine, SWT.NONE);
markerImage.setImage(getImage(marker));
}
Label markerLabel = new Label(markerLine, SWT.NONE);
// $NON-NLS-1$
markerLabel.setText(marker.getAttribute(IMarker.MESSAGE, "missing message"));
for (IMarkerResolution resolution : resolutions) {
Composite resolutionComposite = new Composite(markerComposite, SWT.NONE);
GridData layoutData = new GridData();
layoutData.horizontalIndent = 10;
resolutionComposite.setLayoutData(layoutData);
RowLayout resolutionRowLayout = new RowLayout();
resolutionRowLayout.marginBottom = 0;
resolutionComposite.setLayout(resolutionRowLayout);
Label resolutionImage = new Label(resolutionComposite, SWT.NONE);
// TODO: try to retrieve icon from QuickFix command
Image resolutionPic = null;
if (resolution instanceof IMarkerResolution2) {
resolutionPic = ((IMarkerResolution2) resolution).getImage();
}
if (resolutionPic == null) {
resolutionPic = PlatformUI.getWorkbench().getSharedImages().getImage(SharedImages.IMG_OPEN_MARKER);
}
resolutionImage.setImage(resolutionPic);
Link resolutionLink = new Link(resolutionComposite, SWT.NONE);
// $NON-NLS-1$ //$NON-NLS-2$
resolutionLink.setText("<A>" + resolution.getLabel() + "</a>");
resolutionLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Job resolutionJob = new // $NON-NLS-1$
Job(// $NON-NLS-1$
"apply resolution - " + resolution.getLabel()) {
@Override
protected IStatus run(IProgressMonitor monitor) {
resolution.run(marker);
return Status.OK_STATUS;
}
};
resolutionJob.setUser(true);
resolutionJob.setSystem(true);
resolutionJob.setPriority(Job.INTERACTIVE);
resolutionJob.schedule();
getShell().dispose();
}
});
}
}
parent.layout(true);
}
use of org.eclipse.swt.layout.RowLayout in project linuxtools by eclipse.
the class ChartDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
Composite titleComp = new Composite(composite, SWT.NONE);
titleComp.setLayout(new RowLayout(SWT.HORIZONTAL));
Label icon = new Label(titleComp, SWT.NONE);
// $NON-NLS-1$
icon.setImage(Activator.getImage("icons/chart_icon.png"));
Label label = new Label(titleComp, SWT.WRAP);
label.setText(Messages.ChartConstants_CHART_BUILDER);
GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
titleComp.setLayoutData(data);
Group chartTypeGroup = new Group(composite, SWT.NONE);
data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
chartTypeGroup.setLayoutData(data);
chartTypeGroup.setLayout(new GridLayout(2, false));
chartTypeGroup.setText(Messages.ChartConstants_SELECT_YOUR_CHART_TYPE);
SelectionListener listener = SelectionListener.widgetSelectedAdapter(e -> validateInput());
barGraphButton = new Button(chartTypeGroup, SWT.RADIO);
barGraphButton.setText(Messages.ChartConstants_BAR_GRAPH);
barGraphButton.addSelectionListener(listener);
barGraphButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> verticalBarsButton.setEnabled(barGraphButton.getSelection())));
data = new GridData();
barGraphButton.setLayoutData(data);
verticalBarsButton = new Button(chartTypeGroup, SWT.CHECK);
verticalBarsButton.setText(Messages.ChartConstants_VERTICAL_BARS);
data = new GridData();
verticalBarsButton.setLayoutData(data);
pieChartButton = new Button(chartTypeGroup, SWT.RADIO);
pieChartButton.setText(Messages.ChartConstants_PIE_CHART);
pieChartButton.addSelectionListener(listener);
data = new GridData();
data.horizontalSpan = 2;
pieChartButton.setLayoutData(data);
Group chartColumnGroup = new Group(composite, SWT.NONE);
chartColumnGroup.setLayout(new GridLayout(1, true));
data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
chartColumnGroup.setLayoutData(data);
chartColumnGroup.setText(Messages.ChartConstants_SELECT_COLUMNS_TO_SHOW);
addColumnButtons(chartColumnGroup, listener);
errorMessageText = new Text(composite, SWT.READ_ONLY);
errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
applyDialogFont(composite);
setWidgetsValues();
return composite;
}
use of org.eclipse.swt.layout.RowLayout in project linuxtools by eclipse.
the class MainPackagePage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
super.createFormContent(managedForm);
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText(Messages.MainPackagePage_2);
GridLayout layout = new GridLayout();
layout.marginWidth = layout.marginHeight = 5;
layout.numColumns = 2;
RowLayout rowLayout = new RowLayout();
rowLayout.type = SWT.VERTICAL;
rowLayout.justify = true;
rowLayout.fill = true;
form.getBody().setLayout(rowLayout);
form.getBody().setLayoutData(rowLayout);
layout.numColumns = 2;
GridData gd = new GridData();
gd.horizontalSpan = 2;
gd.horizontalAlignment = SWT.FILL;
final Section mainPackageSection = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
mainPackageSection.setText(Messages.MainPackagePage_3);
mainPackageSection.setLayout(new GridLayout());
Composite mainPackageClient = toolkit.createComposite(mainPackageSection);
GridLayout gridLayout = new GridLayout();
gridLayout.marginWidth = gridLayout.marginHeight = 5;
gridLayout.numColumns = 2;
mainPackageClient.setLayout(gridLayout);
new RpmTagText(mainPackageClient, RpmTags.NAME, specfile);
new RpmTagText(mainPackageClient, RpmTags.VERSION, specfile);
new RpmTagText(mainPackageClient, RpmTags.RELEASE, specfile);
new RpmTagText(mainPackageClient, RpmTags.URL, specfile);
new RpmTagText(mainPackageClient, RpmTags.LICENSE, specfile);
new RpmTagText(mainPackageClient, RpmTags.GROUP, specfile);
new RpmTagText(mainPackageClient, RpmTags.EPOCH, specfile);
new RpmTagText(mainPackageClient, RpmTags.BUILD_ROOT, specfile);
new RpmTagText(mainPackageClient, RpmTags.BUILD_ARCH, specfile);
new RpmTagText(mainPackageClient, RpmTags.SUMMARY, specfile, SWT.MULTI);
// BuildRequires
final Section buildRequiresSection = toolkit.createSection(mainPackageClient, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
buildRequiresSection.setText(Messages.MainPackagePage_4);
buildRequiresSection.setLayout(rowLayout);
buildRequiresSection.setExpanded(false);
Composite buildRequiresClient = toolkit.createComposite(buildRequiresSection);
buildRequiresClient.setLayout(gridLayout);
for (SpecfileTag buildRequire : specfile.getBuildRequires()) {
new RpmTagText(buildRequiresClient, buildRequire, specfile);
}
buildRequiresSection.setClient(buildRequiresClient);
toolkit.paintBordersFor(buildRequiresClient);
toolkit.paintBordersFor(buildRequiresSection);
// Requires
final Section requiresSection = toolkit.createSection(mainPackageClient, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
requiresSection.setText(Messages.MainPackagePage_5);
requiresSection.setLayout(rowLayout);
requiresSection.setExpanded(false);
Composite requiresClient = toolkit.createComposite(requiresSection);
requiresClient.setLayout(gridLayout);
requiresClient.setLayoutData(gd);
for (SpecfileTag require : specfile.getRequires()) {
new RpmTagText(requiresClient, require, specfile);
}
requiresSection.setClient(requiresClient);
toolkit.paintBordersFor(requiresClient);
toolkit.paintBordersFor(requiresSection);
mainPackageSection.setClient(mainPackageClient);
toolkit.paintBordersFor(mainPackageClient);
toolkit.paintBordersFor(mainPackageSection);
// subpackages
final Section packagesSection = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
packagesSection.setText(Messages.MainPackagePage_6);
packagesSection.setLayout(gridLayout);
Composite packagesClient = toolkit.createComposite(packagesSection);
packagesClient.setLayout(gridLayout);
packagesClient.setLayoutData(gd);
for (SpecfilePackage specfilePackage : specfile.getPackages().getPackages()) {
if (specfilePackage.isMainPackage()) {
continue;
}
final Section packageSection = toolkit.createSection(packagesClient, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
packageSection.setText(specfilePackage.getFullPackageName());
packageSection.setExpanded(false);
packageSection.setLayout(rowLayout);
Composite packageClient = toolkit.createComposite(packageSection);
packageClient.setLayout(gridLayout);
packageClient.setLayoutData(gd);
new RpmTagText(packageClient, RpmTags.SUMMARY, specfile, specfilePackage, SWT.MULTI);
new RpmTagText(packageClient, RpmTags.GROUP, specfile, specfilePackage, SWT.MULTI);
final Section packageRequiresSection = toolkit.createSection(packageClient, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
packageRequiresSection.setText(Messages.MainPackagePage_7);
packageRequiresSection.setLayout(rowLayout);
packageRequiresSection.setLayoutData(gd);
Composite packageRequiresClient = toolkit.createComposite(packageRequiresSection);
packageRequiresClient.setLayout(gridLayout);
packageRequiresClient.setLayoutData(gd);
for (SpecfileTag require : specfilePackage.getRequires()) {
new RpmTagText(packageRequiresClient, require, specfile);
}
packageRequiresSection.setClient(packageRequiresClient);
toolkit.paintBordersFor(packageRequiresClient);
toolkit.paintBordersFor(packageRequiresSection);
packageSection.setClient(packageClient);
toolkit.paintBordersFor(packageClient);
toolkit.paintBordersFor(packageSection);
}
packagesSection.setClient(packagesClient);
toolkit.paintBordersFor(packagesClient);
toolkit.paintBordersFor(packagesSection);
managedForm.refresh();
}
Aggregations