Search in sources :

Example 81 with SashForm

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

the class SQLBuilderDialog method createDialogArea.

/**
     * Create contents of the dialog.
     * 
     * @param parent
     */
@Override
protected Control createDialogArea(Composite parent) {
    container = (Composite) super.createDialogArea(parent);
    // container.setLayout(new GridLayout());
    final SashForm mainSashForm = new SashForm(container, SWT.NONE | SWT.VERTICAL);
    mainSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    final SashForm sashFormStructureAndEditor = new SashForm(mainSashForm, SWT.NONE);
    final SashForm sashFormResultAndDetail = new SashForm(mainSashForm, SWT.NONE);
    mainSashForm.setWeights(new int[] { 3, 1 });
    createResult(sashFormResultAndDetail);
    createDetail(sashFormResultAndDetail);
    sashFormResultAndDetail.setWeights(new int[] { 4, 3 });
    createDatabaseStructure(sashFormStructureAndEditor);
    createSQLEditor(sashFormStructureAndEditor);
    sashFormStructureAndEditor.setWeights(new int[] { 4, 6 });
    if (connParameters.isFromRepository() && connParameters.getQueryObject() != null) {
        structureComposite.openNewQueryEditor();
    } else if (connParameters.isFromRepository() && connParameters.getMetadataTable() != null) {
        structureComposite.openNewTableEditor();
    } else {
        structureComposite.openNewEditor();
    }
    // RefreshDetailCompositeAction refreshAction =
    new RefreshDetailCompositeAction(structureComposite.getTreeViewer(), this.getShell());
    return container;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridData(org.eclipse.swt.layout.GridData)

Example 82 with SashForm

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

the class RowGeneratorUI method init.

/**
     * yzhang Comment method "init".
     * 
     * @param fromDialog
     */
public void init(boolean fromDialog) {
    uiManager = generatorManager.getUiManager();
    final ExternalRowGeneratorUiProperties uiProperties = uiManager.getUiProperties();
    addParentListeners(uiManager, uiProperties);
    final Display display = rowGenUIParent.getDisplay();
    GridLayout parentLayout = new GridLayout(1, true);
    rowGenUIParent.setLayout(parentLayout);
    addKeyListener(uiManager, display);
    mainSashForm = new SashForm(rowGenUIParent, 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.setLayoutData(mainSashFormGridData);
    datasFlowViewSashForm.setBackgroundMode(SWT.INHERIT_FORCE);
    initBackgroundComponents();
    // if (WindowSystem.isGTK()) {
    // datasFlowViewSashForm.setBackground(display.getSystemColor(SWT.COLOR_DARK_GRAY));
    // }
    /* Create Schema Table Editor */
    createSchemaComposite();
    /* Create the tabs */
    tabFolderEditors = new TabFolderEditors(mainSashForm, SWT.BORDER, externalNode, dataTableView);
    tabFolderEditors.setRowGeneratorUI(this);
    tabFolderEditors.getProcessPreview().refreshTablePreview(outputMetaTable.getListColumns(), null, true);
    if (!fromDialog) {
        new FooterComposite(this.rowGenUIParent, SWT.NONE, generatorManager);
    }
    dataTableView.getTable().addSelectionListener(new SelectionAdapter() {

        /*
             * (non-Java)
             * 
             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
        @SuppressWarnings("unchecked")
        @Override
        public void widgetSelected(SelectionEvent e) {
            updateFunParameter((Table) e.getSource());
        }
    });
    dataTableView.getTable().addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            dataTableView.getTableViewerCreator().refresh();
        }

        @Override
        public void focusLost(FocusEvent e) {
        // TODO Auto-generated method stub
        }
    });
}
Also used : TabFolderEditors(org.talend.designer.rowgenerator.ui.tabs.TabFolderEditors) Table(org.eclipse.swt.widgets.Table) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) FooterComposite(org.talend.designer.rowgenerator.ui.footer.FooterComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) FocusEvent(org.eclipse.swt.events.FocusEvent) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) ExternalRowGeneratorUiProperties(org.talend.designer.rowgenerator.external.data.ExternalRowGeneratorUiProperties) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FocusListener(org.eclipse.swt.events.FocusListener) Display(org.eclipse.swt.widgets.Display)

Example 83 with SashForm

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

the class MultiSchemasUI method init.

public void init() {
    uiParent.setLayout(new GridLayout());
    Composite composite = new Composite(uiParent, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setLayout(new FillLayout());
    ExpandBar bar = new ExpandBar(composite, SWT.V_SCROLL);
    final Composite fileGroup = new Composite(bar, SWT.NONE);
    createFileGroup(fileGroup);
    final ExpandItem settingItem = new ExpandItem(bar, SWT.NONE, 0);
    settingItem.setText(ExternalMultiSchemasUIProperties.SETTINGS_LABEL);
    settingItem.setHeight(fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    settingItem.setControl(fileGroup);
    settingItem.setExpanded(true);
    allContentForm = new SashForm(bar, SWT.NONE);
    createViewers(allContentForm);
    final ExpandItem previewItem = new ExpandItem(bar, SWT.NONE, 1);
    previewItem.setText(ExternalMultiSchemasUIProperties.PREVIEW_LABEL);
    previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 100);
    previewItem.setControl(allContentForm);
    previewItem.setExpanded(true);
    bar.addExpandListener(new ExpandListener() {

        public void itemExpanded(ExpandEvent e) {
            if (e.item != null && e.item instanceof ExpandItem) {
                if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.PREVIEW_LABEL)) {
                    if (settingItem.getExpanded()) {
                        previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
                    } else {
                        previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
                    }
                } else if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.SETTINGS_LABEL)) {
                    settingItem.setHeight(fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
                }
            }
        }

        public void itemCollapsed(ExpandEvent e) {
            if (e.item != null && e.item instanceof ExpandItem) {
                if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.PREVIEW_LABEL)) {
                // settingItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y
                // + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
                } else if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.SETTINGS_LABEL)) {
                    previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
                }
            }
        }
    });
    initFieldValues();
    // listener
    addFieldListeners();
    addButtonListeners();
    addFieldsListenersGroupFileSettings();
    addFieldsListenersGroupsEscapeChar();
    // preview
    refreshPreview();
    checkDialog();
    // reload
    reloadSchemaDataFromNode();
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Composite(org.eclipse.swt.widgets.Composite) CommandStackForComposite(org.talend.commons.ui.command.CommandStackForComposite) ExpandItem(org.eclipse.swt.widgets.ExpandItem) GridData(org.eclipse.swt.layout.GridData) ExpandEvent(org.eclipse.swt.events.ExpandEvent) FillLayout(org.eclipse.swt.layout.FillLayout) ExpandListener(org.eclipse.swt.events.ExpandListener)

Example 84 with SashForm

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

the class MapperUI method createCompositeContent.

public void createCompositeContent(MapperModel mapperModel) {
    // long time1 = System.currentTimeMillis();
    // CommandStack commandStack = new CommandStackForComposite(this.mapperUIParent);
    // mapperManager.setCommandStack(commandStack);
    updateBackgroundEnabled = false;
    List<? extends IConnection> inConnections = mapperManager.getAbstractMapComponent().getIncomingConnections();
    List<? extends IConnection> outConnections = mapperManager.getAbstractMapComponent().getOutgoingConnections();
    // see bug 7471, record the precolumns value
    for (IConnection conn : inConnections) {
        conn.getMetadataTable();
        if (conn.getMetadataTable() != null) {
            List<IMetadataColumn> inputColumns = conn.getMetadataTable().getListColumns();
            for (IMetadataColumn inputColumn : inputColumns) {
                Set<String> columnSet = preColumnSet.get(conn);
                if (columnSet == null) {
                    columnSet = new HashSet<String>();
                    preColumnSet.put(conn, columnSet);
                }
                columnSet.add(inputColumn.getLabel());
                preColumnSet.put(conn, columnSet);
            }
        }
    }
    for (IConnection conn : outConnections) {
        if (conn.getMetadataTable() != null) {
            List<IMetadataColumn> outputColumns = conn.getMetadataTable().getListColumns();
            for (IMetadataColumn outputColumn : outputColumns) {
                Set<String> columnSet = preColumnSet.get(conn);
                if (columnSet == null) {
                    columnSet = new HashSet<String>();
                    preColumnSet.put(conn, columnSet);
                }
                columnSet.add(outputColumn.getLabel());
                preColumnSet.put(conn, columnSet);
            }
        }
    }
    final UIManager uiManager = mapperManager.getUiManager();
    final ExternalMapperUiProperties uiProperties = uiManager.getUiProperties();
    addParentListeners(uiManager, uiProperties);
    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 */
    tabFolderEditors = new TabFolderEditors(mainSashForm, SWT.BORDER, mapperManager);
    createInputZoneWithTables(mapperModel, display);
    createVarsZoneWithTables(mapperModel, display);
    createOutputZoneWithTables(mapperModel, uiManager, display);
    uiManager.parseAllExpressionsForAllTables();
    mapperManager.getProblemsManager().checkProblemsForAllEntriesOfAllTables(true);
    mapperManager.getProblemsManager().checkLookupExpressionProblem();
    this.draggingInfosPopup = DraggingInfosPopup.getNewShell(this.mapperUIParent.getShell());
    configureZoneScrollBars(display);
    int[] weightsDatasFlowViewSashForm = uiProperties.getWeightsDatasFlowViewSashForm();
    datasFlowViewSashForm.setWeights(weightsDatasFlowViewSashForm.length != 0 ? weightsDatasFlowViewSashForm : ExternalMapperUiProperties.DEFAULT_WEIGHTS_DATAS_FLOW_SASH_FORM);
    int[] weightsMainSashForm = uiProperties.getWeightsMainSashForm();
    weightsMainSashForm = weightsMainSashForm.length != 0 ? weightsMainSashForm : ExternalMapperUiProperties.DEFAULT_WEIGHTS_MAIN_SASH_FORM;
    mainSashForm.setWeights(weightsMainSashForm);
    footerComposite = new FooterComposite(this.mapperUIParent, SWT.NONE, mapperManager);
    selectFirstInOutTablesView();
    updateBackgroundEnabled = true;
    updateBackground(true, false);
// List<DataMapTableView> inputsTablesView = uiManager.getInputsTablesView();
// for (DataMapTableView table : inputsTablesView) {
//
// table.showTableGlobalMap(false);
// table.showTableGlobalMap(true);
//
// // table.updateGridDataHeightForTableGlobalMap();
// // table.resizeAtExpandedSize();
// }
}
Also used : TabFolderEditors(org.talend.designer.mapper.ui.tabs.TabFolderEditors) FooterComposite(org.talend.designer.mapper.ui.footer.FooterComposite) UIManager(org.talend.designer.mapper.managers.UIManager) IConnection(org.talend.core.model.process.IConnection) IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) DropTargetOperationListener(org.talend.designer.abstractmap.ui.listener.DropTargetOperationListener) ExternalMapperUiProperties(org.talend.designer.mapper.external.data.ExternalMapperUiProperties) GridData(org.eclipse.swt.layout.GridData)

Example 85 with SashForm

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

the class CpuDumpEditor method createCallerCalleePage.

/**
     * Creates the caller/callee page.
     */
private void createCallerCalleePage() {
    callersCalleesPageBook = new PageBook(getContainer(), SWT.NONE);
    Label messageLabel = new Label(callersCalleesPageBook, SWT.WRAP);
    messageLabel.setText(Messages.noCallersCalleesMessage);
    SashForm sashForm = new SashForm(callersCalleesPageBook, SWT.NONE);
    sashForm.setOrientation(SWT.VERTICAL);
    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
    int page = addPage(callersCalleesPageBook);
    createCallerViewer(sashForm, page);
    createCalleeViewer(sashForm, page);
    setPageText(page, Messages.callerCalleePageLabel);
    setPageImage(page, getCallerCalleeImage());
    callersCalleesPageBook.showPage(sashForm);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) PageBook(org.eclipse.ui.part.PageBook) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)96 GridData (org.eclipse.swt.layout.GridData)65 GridLayout (org.eclipse.swt.layout.GridLayout)57 Composite (org.eclipse.swt.widgets.Composite)56 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 FillLayout (org.eclipse.swt.layout.FillLayout)30 Label (org.eclipse.swt.widgets.Label)26 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 CTabItem (org.eclipse.swt.custom.CTabItem)14 Button (org.eclipse.swt.widgets.Button)13 StyledText (org.eclipse.swt.custom.StyledText)12 ToolBar (org.eclipse.swt.widgets.ToolBar)12 ArrayList (java.util.ArrayList)11 Point (org.eclipse.swt.graphics.Point)11 Table (org.eclipse.swt.widgets.Table)11 ToolItem (org.eclipse.swt.widgets.ToolItem)11 TableViewer (org.eclipse.jface.viewers.TableViewer)10 Event (org.eclipse.swt.widgets.Event)10 Listener (org.eclipse.swt.widgets.Listener)9 Tree (org.eclipse.swt.widgets.Tree)9