Search in sources :

Example 11 with SashForm

use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.

the class JSONFileOutputStep1Form method addFields.

@Override
protected void addFields() {
    createOutputSettingArea();
    createOutputFile(this, WIDTH_GRIDDATA_PIXEL, 50);
    SashForm sash = new SashForm(this, SWT.HORIZONTAL | SWT.SMOOTH);
    GridData sashData = new GridData(GridData.FILL_BOTH);
    sash.setLayoutData(sashData);
    createFileContentViewer(sash, 400, 100);
    createFileContentText(sash, 400, 100);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridData(org.eclipse.swt.layout.GridData)

Example 12 with SashForm

use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.

the class BatchExpressionBuilderDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    container.setLayout(layout);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(container);
    final SashForm sashForm = new SashForm(container, SWT.NONE);
    sashForm.setOrientation(SWT.VERTICAL);
    final Composite lowerComposite = new Composite(sashForm, SWT.NONE);
    lowerComposite.setLayout(new FillLayout());
    categoryComposite = new BatchCategoryComposite(lowerComposite, SWT.NONE, manager);
    final Composite upperComposite = new Composite(sashForm, SWT.NONE);
    upperComposite.setLayout(new FillLayout());
    final SashForm upperSashform = new SashForm(upperComposite, SWT.NONE);
    expressionComposite = new BatchExpressionComposite(this, upperSashform, SWT.NONE, dataBean);
    expressionComposite.setExpression(defaultExpression, true);
    final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    sashForm.setLayoutData(gridData);
    sashForm.setWeights(new int[] { 4, 1 });
    return container;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 13 with SashForm

use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.

the class MapperUI method init.

public void init(MapperModel mapperModel) {
    // long time1 = System.currentTimeMillis();
    // CommandStack commandStack = new CommandStackForComposite(this.mapperUIParent);
    // mapperManager.setCommandStack(commandStack);
    final UIManager uiManager = mapperManager.getUiManager();
    final ExternalDbMapUiProperties uiProperties = uiManager.getUiProperties();
    addParentListeners(uiManager, uiProperties);
    final Display display = mapperUIParent.getDisplay();
    bgColorLinksZone = ColorProviderMapper.getColor(ColorInfo.COLOR_BACKGROUND_LINKS_ZONE);
    GridLayout parentLayout = new GridLayout(1, true);
    mapperUIParent.setLayout(parentLayout);
    addKeyListener(uiManager, display);
    addBackgroundRefreshLimiters(display);
    this.dropTargetOperationListener = new DropTargetOperationListener(mapperManager);
    dropTargetOperationListener.addControl(this.mapperUIParent.getShell());
    mainSashForm = new SashForm(mapperUIParent, SWT.SMOOTH | SWT.VERTICAL);
    GridData mainSashFormGridData = new GridData(GridData.FILL_BOTH);
    mainSashForm.setLayoutData(mainSashFormGridData);
    datasFlowViewSashForm = new SashForm(mainSashForm, SWT.SMOOTH | SWT.HORIZONTAL | SWT.BORDER);
    datasFlowViewSashForm.setBackgroundMode(SWT.INHERIT_FORCE);
    initBackgroundComponents();
    if (WindowSystem.isGTK()) {
        datasFlowViewSashForm.setBackground(display.getSystemColor(SWT.COLOR_DARK_GRAY));
    }
    // dropTargetOperationListener.addControl(datasFlowViewSashForm);
    // datasFlowViewSashForm.addControlListener(new ControlListener() {
    //
    // public void controlMoved(ControlEvent e) {
    // }
    //
    // public void controlResized(ControlEvent e) {
    // createBgImages();
    // updateBackground(true, false);
    // }
    //
    // });
    /* Create the tabs */
    String dbmsId = null;
    if (mapperModel.getInputDataMapTables() != null && !mapperModel.getInputDataMapTables().isEmpty()) {
        InputTable input = mapperModel.getInputDataMapTables().get(0);
        if (input.getMetadataTable() != null) {
            dbmsId = input.getMetadataTable().getDbms();
        }
    }
    tabFolderEditors = new TabFolderEditors(mainSashForm, SWT.BORDER, mapperManager, dbmsId);
    createInputZoneWithTables(mapperModel, uiManager, display);
    createVarsZoneWithTables(mapperModel, display);
    createOutputZoneWithTables(mapperModel, uiManager, display);
    mapperManager.initInternalData();
    uiManager.parseAllExpressionsForAllTables();
    mapperManager.getProblemsManager().checkProblemsForAllEntriesOfAllTables(true);
    this.draggingInfosPopup = DraggingInfosPopup.getNewShell(this.mapperUIParent.getShell());
    configureZoneScrollBars(display);
    int[] weightsDatasFlowViewSashForm = uiProperties.getWeightsDatasFlowViewSashForm();
    datasFlowViewSashForm.setWeights(weightsDatasFlowViewSashForm.length != 0 ? weightsDatasFlowViewSashForm : ExternalDbMapUiProperties.DEFAULT_WEIGHTS_DATAS_FLOW_SASH_FORM);
    int[] weightsMainSashForm = uiProperties.getWeightsMainSashForm();
    mainSashForm.setWeights(weightsMainSashForm.length != 0 ? weightsMainSashForm : ExternalDbMapUiProperties.DEFAULT_WEIGHTS_MAIN_SASH_FORM);
    new FooterComposite(this.mapperUIParent, SWT.NONE, mapperManager);
    if (WindowSystem.isGTK()) {
        // resize especially for GTK
        new AsynchronousThreading(1000, false, display, new Runnable() {

            public void run() {
                resizeNotMinimizedTablesAtExpandedSize(display);
                mapperUIParent.getShell().layout();
            }
        }).start();
    }
    if (WindowSystem.isWIN32()) {
        List<DataMapTableView> inputsTablesView = uiManager.getInputsTablesView();
        for (DataMapTableView view : inputsTablesView) {
            ((InputDataMapTableView) view).refreshLabelForJoinDropDown();
        }
    }
    selectFirstInOutTablesView();
    mapperManager.getUiManager().refreshSqlExpression();
}
Also used : TabFolderEditors(org.talend.designer.dbmap.ui.tabs.TabFolderEditors) FooterComposite(org.talend.designer.dbmap.ui.footer.FooterComposite) InputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.InputDataMapTableView) UIManager(org.talend.designer.dbmap.managers.UIManager) InputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.InputDataMapTableView) OutputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView) DataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView) ExternalDbMapUiProperties(org.talend.designer.dbmap.external.data.ExternalDbMapUiProperties) AsynchronousThreading(org.talend.commons.ui.runtime.thread.AsynchronousThreading) SashForm(org.eclipse.swt.custom.SashForm) InputTable(org.talend.designer.dbmap.model.table.InputTable) GridLayout(org.eclipse.swt.layout.GridLayout) DropTargetOperationListener(org.talend.designer.abstractmap.ui.listener.DropTargetOperationListener) GridData(org.eclipse.swt.layout.GridData) Display(org.eclipse.swt.widgets.Display)

Example 14 with SashForm

use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.

the class CallerCalleeTabPage method refreshCallersCalleesPage.

/**
     * Refreshes the callers/callees page.
     */
private void refreshCallersCalleesPage() {
    if (jvm == null || callersCalleesPageBook.isDisposed()) {
        return;
    }
    Label label = null;
    SashForm sashForm = null;
    for (Control control : callersCalleesPageBook.getChildren()) {
        if (control instanceof Label) {
            label = (Label) control;
        } else if (control instanceof SashForm) {
            sashForm = (SashForm) control;
        }
    }
    if (label == null || sashForm == null) {
        //$NON-NLS-1$
        throw new IllegalStateException("label and sashform cannot be null");
    }
    Control control = (jvm.getCpuProfiler().getCpuModel().getCallersCalleesTarget() == null) ? label : sashForm;
    callersCalleesPageBook.showPage(control);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Control(org.eclipse.swt.widgets.Control) Label(org.eclipse.swt.widgets.Label)

Example 15 with SashForm

use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.

the class TutorialsDialog method createContents.

@Override
protected Control createContents(Composite parent) {
    SashForm sash = new SashForm(parent, SWT.NONE);
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.widthHint = 800;
    layoutData.heightHint = 700;
    sash.setLayoutData(layoutData);
    sash.setLayout(new GridLayout());
    sash.setBackground(new Color(null, 255, 255, 255));
    // create the dialog area and button bar
    dialogArea = createDialogArea(sash);
    return sash;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Color(org.eclipse.swt.graphics.Color) GridData(org.eclipse.swt.layout.GridData)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)86 GridData (org.eclipse.swt.layout.GridData)58 GridLayout (org.eclipse.swt.layout.GridLayout)53 Composite (org.eclipse.swt.widgets.Composite)51 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 FillLayout (org.eclipse.swt.layout.FillLayout)26 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 Label (org.eclipse.swt.widgets.Label)23 CTabItem (org.eclipse.swt.custom.CTabItem)13 Button (org.eclipse.swt.widgets.Button)13 StyledText (org.eclipse.swt.custom.StyledText)12 ArrayList (java.util.ArrayList)11 Table (org.eclipse.swt.widgets.Table)11 ToolBar (org.eclipse.swt.widgets.ToolBar)11 Point (org.eclipse.swt.graphics.Point)10 TableViewer (org.eclipse.jface.viewers.TableViewer)9 Event (org.eclipse.swt.widgets.Event)9 Listener (org.eclipse.swt.widgets.Listener)9 TableColumn (org.eclipse.swt.widgets.TableColumn)9 Tree (org.eclipse.swt.widgets.Tree)9