use of org.eclipse.swt.widgets.Layout in project tdi-studio-se by Talend.
the class UIManager method minimizeAllTables.
public void minimizeAllTables(Zone zone, boolean minimize, ToolItem minimizeButton) {
List<DataMapTableView> tablesView = null;
TablesZoneView tablesZoneView = null;
if (zone == Zone.INPUTS) {
tablesView = mapperManager.getUiManager().getInputsTablesView();
tablesZoneView = getTablesZoneViewInputs();
} else if (zone == Zone.OUTPUTS) {
tablesZoneView = getTablesZoneViewOutputs();
tablesView = mapperManager.getUiManager().getOutputsTablesView();
} else {
//$NON-NLS-1$
throw new RuntimeException("Case not found:" + zone);
}
Layout layout = tablesZoneView.getLayout();
try {
tablesZoneView.setLayout(null);
for (DataMapTableView view : tablesView) {
view.minimizeTable(minimize);
}
} catch (RuntimeException e) {
ExceptionHandler.process(e);
} finally {
tablesZoneView.setLayout(layout);
}
tablesZoneView.layout();
for (DataMapTableView view : tablesView) {
view.layout();
}
resizeTablesZoneViewAtComputedSize(zone);
moveScrollBarZoneAtSelectedTable(zone);
}
use of org.eclipse.swt.widgets.Layout in project tdi-studio-se by Talend.
the class UIManager method minimizeAllTables.
public void minimizeAllTables(Zone zone, boolean minimize, ToolItem minimizeButton) {
List<DataMapTableView> tablesView = null;
TablesZoneView tablesZoneView = null;
if (zone == Zone.INPUTS) {
tablesView = getInputsTablesView();
tablesZoneView = getTablesZoneViewInputs();
} else if (zone == Zone.OUTPUTS) {
tablesZoneView = getTablesZoneViewOutputs();
tablesView = getOutputsTablesView();
} else {
//$NON-NLS-1$
throw new RuntimeException("Case not found:" + zone);
}
Layout layout = tablesZoneView.getLayout();
try {
tablesZoneView.setLayout(null);
for (DataMapTableView view : tablesView) {
view.minimizeTable(minimize);
}
} catch (RuntimeException e) {
ExceptionHandler.process(e);
} finally {
tablesZoneView.setLayout(layout);
}
tablesZoneView.layout();
for (DataMapTableView view : tablesView) {
view.layout();
}
resizeTablesZoneViewAtComputedSize(zone);
moveScrollBarZoneAtSelectedTable(zone);
}
use of org.eclipse.swt.widgets.Layout in project linuxtools by eclipse.
the class OprofiledLogDialog method createCustomArea.
@Override
protected Control createCustomArea(Composite parent) {
Composite area = new Composite(parent, 0);
Layout layout = new GridLayout(1, true);
GridData gd = new GridData(GRID_WIDTH, GRID_HEIGHT);
area.setLayout(layout);
area.setLayoutData(gd);
Text txt = new Text(area, SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
// Check if the textContent isn't null
if (textContent != null) {
txt.setText(textContent);
}
txt.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
return area;
}
use of org.eclipse.swt.widgets.Layout in project xtext-eclipse by eclipse.
the class XbaseInformationControl method createContent.
/**
* Xbase - modification+ added detailPane
*/
@Override
protected void createContent(Composite parent) {
fSashForm = new SashForm(parent, parent.getStyle());
fSashForm.setOrientation(SWT.VERTICAL);
fBrowser = new Browser(fSashForm, SWT.NONE);
fBrowser.setJavascriptEnabled(false);
Display display = getShell().getDisplay();
ColorRegistry registry = JFaceResources.getColorRegistry();
// $NON-NLS-1$
Color foreground = registry.get("org.eclipse.ui.workbench.HOVER_FOREGROUND");
// $NON-NLS-1$
Color background = registry.get("org.eclipse.ui.workbench.HOVER_BACKGROUND");
if (background != null && foreground != null) {
fBrowser.setForeground(foreground);
fBrowser.setBackground(background);
} else {
fBrowser.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
fBrowser.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
fBrowser.addProgressListener(new ProgressAdapter() {
@Override
public void completed(ProgressEvent event) {
fCompleted = true;
}
});
fBrowser.addOpenWindowListener(new OpenWindowListener() {
@Override
public void open(WindowEvent event) {
// Cancel opening of new windows
event.required = true;
}
});
// Replace browser's built-in context menu with none
fSashForm.setMenu(new Menu(getShell(), SWT.NONE));
detailPaneComposite = createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
Layout layout = detailPaneComposite.getLayout();
if (layout instanceof GridLayout) {
GridLayout gl = (GridLayout) layout;
gl.marginHeight = 0;
gl.marginWidth = 0;
gl.numColumns = 1;
}
if (background != null && foreground != null) {
detailPaneComposite.setForeground(foreground);
detailPaneComposite.setBackground(background);
} else {
detailPaneComposite.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
detailPaneComposite.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
resourceProvider = new HoverEditedResourceProvider();
embeddedEditor = xbaseHoverConfiguration.getEditorFactory().newEditor(resourceProvider).readOnly().processIssuesBy(new IValidationIssueProcessor() {
@Override
public void processIssues(List<Issue> issues, IProgressMonitor monitor) {
}
}).withParent(detailPaneComposite);
Control viewerControl = embeddedEditor.getViewer().getControl();
if (background != null && foreground != null) {
viewerControl.setForeground(foreground);
viewerControl.setBackground(background);
} else {
viewerControl.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
viewerControl.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
}
embeddedEditor.getDocument().setValidationJob(null);
createTextLayout();
parent.addDisposeListener(e -> {
if (fTextLayout != null && !fTextLayout.isDisposed()) {
fTextLayout.dispose();
}
});
}
use of org.eclipse.swt.widgets.Layout 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);
}
}
}
Aggregations