Search in sources :

Example 76 with SashForm

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

the class CamelDependenciesEditor method createPartControl.

@Override
public void createPartControl(Composite parent) {
    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    parent.setLayout(new GridLayout());
    //create search group, hide button and refresh button
    Composite toolsPanel = toolkit.createComposite(parent);
    toolsPanel.setLayout(new GridLayout(4, false));
    toolsPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    toolsPanel.setBackgroundMode(SWT.INHERIT_FORCE);
    toolkit.createLabel(toolsPanel, Messages.RouterDependenciesEditor_filterLabel);
    SearchControl searchComposite = new SearchControl(toolsPanel, SWT.NONE);
    searchComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    searchComposite.setActiveImage(CamelDesignerPlugin.getImage(CamelDesignerPlugin.HIGHLIGHT_REM_ICON));
    searchComposite.setDeactiveImage(CamelDesignerPlugin.getImage(CamelDesignerPlugin.GRAY_REM_ICON));
    Text filterText = searchComposite.getText();
    Button hideBuiltIn = toolkit.createButton(toolsPanel, Messages.RouterDependenciesEditor_hideBuiltInItems, SWT.CHECK);
    Button refreshBtn = toolkit.createButton(toolsPanel, null, SWT.PUSH);
    refreshBtn.setImage(CamelDesignerPlugin.getImage(CamelDesignerPlugin.REFRESH_ICON));
    refreshBtn.setToolTipText(Messages.RouterDependenciesEditor_refreshDependenciesTooltip);
    refreshBtn.setEnabled(!isReadOnly());
    // create data tables
    ScrolledComposite top = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    top.setLayoutData(new GridData(GridData.FILL_BOTH));
    SashForm mainForm = new SashForm(top, SWT.VERTICAL);
    manageRouteResourcePanel = createResourceTableViewer(mainForm, toolkit, Messages.CamelDependenciesEditor_Resources);
    SashForm topPart = new SashForm(mainForm, SWT.HORIZONTAL);
    importPackageViewer = createTableViewer(topPart, toolkit, Messages.RouterDependenciesEditor_importPackageSec, ManifestItem.IMPORT_PACKAGE);
    bundleClasspathViewer = createTableViewer(topPart, toolkit, Messages.RouterDependenciesEditor_classpathSec, ManifestItem.BUNDLE_CLASSPATH);
    SashForm centerPart = new SashForm(mainForm, SWT.HORIZONTAL);
    exportPackageViewer = createTableViewer(centerPart, toolkit, Messages.RouterDependenciesEditor_exportPackage, ManifestItem.EXPORT_PACKAGE);
    requireBundleViewer = createTableViewer(centerPart, toolkit, Messages.RouterDependenciesEditor_requireBundleSec, ManifestItem.REQUIRE_BUNDLE);
    top.setExpandHorizontal(true);
    top.setExpandVertical(true);
    top.setContent(mainForm);
    top.setMinSize(mainForm.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    //create status
    Composite statusComposite = toolkit.createComposite(parent);
    statusComposite.setLayout(new GridLayout(2, false));
    statusComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    statusLabel = toolkit.createLabel(statusComposite, null);
    statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    //		if (isReadOnly()) {
    //			statusLabel.setText(Messages.RouterDependenciesEditor_itemIsLockedByOther);
    //		}
    Label shortCuts = toolkit.createLabel(statusComposite, Messages.RouterDependenciesEditor_KeyBindingw, SWT.SHADOW_OUT);
    shortCuts.setEnabled(false);
    // add filter listener
    filterText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            final String filterString = ((Text) e.widget).getText().trim();
            importPackageViewer.setFilterString(filterString);
            requireBundleViewer.setFilterString(filterString);
            bundleClasspathViewer.setFilterString(filterString);
            exportPackageViewer.setFilterString(filterString);
            manageRouteResourcePanel.setFilterString(filterString);
        }
    });
    // add hide listener
    hideBuiltIn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            final boolean show = ((Button) e.widget).getSelection();
            importPackageViewer.setShowBuiltIn(!show);
            requireBundleViewer.setShowBuiltIn(!show);
            bundleClasspathViewer.setShowBuiltIn(!show);
            exportPackageViewer.setShowBuiltIn(!show);
            manageRouteResourcePanel.setShowBuiltIn(!show);
        }
    });
    refreshBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            //	          setDirty(false);
            updateInput();
        }
    });
}
Also used : FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) SearchControl(org.talend.camel.designer.ui.editor.dependencies.controls.SearchControl)

Example 77 with SashForm

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

the class TabFolderEditors method createComponents.

/**
     * DOC amaumont Comment method "createComponents".
     */
private void createComponents() {
    setSimple(false);
    // TableEditorCompositeBase metaDatasDescriptorView3 = new TableEditorCompositeBase(tabFolder1);
    // item.setControl(metaDatasDescriptorView3);
    CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.SchemaEditor.Title"));
    SashForm inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
    inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
    item.setControl(inOutMetaEditorContainer);
    // input metadata table view
    inputMetaEditor = new XmlMapMetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
    inputMetaEditor.initGraphicComponents();
    // inputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
    ILineSelectionListener metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {

        @Override
        public void handle(LineSelectionEvent e) {
            if (inputMetaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
                if (inputMetaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
                    mapperManage.selectLinkedInputTableEntries(inputMetaEditor.getTableViewerCreator().getTable().getSelectionIndices(), false);
                }
            }
        }
    };
    inputMetaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
    addListenersToInputButtons();
    // output metadata table view
    outputMetaEditor = new XmlMapMetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
    outputMetaEditor.initGraphicComponents();
    // outputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
    metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {

        @Override
        public void handle(LineSelectionEvent e) {
            if (outputMetaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
                if (outputMetaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
                    mapperManage.selectLinkedOutputTableEntries(outputMetaEditor.getTableViewerCreator().getTable().getSelectionIndices(), false);
                }
            }
        }
    };
    outputMetaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
    addListenersToOutputButtons();
    item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.TreeSchemaEditor.Title"));
    SashForm xmlTreeEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
    xmlTreeEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
    item.setControl(xmlTreeEditorContainer);
    // input tree schema table view
    inputTreeSchemaEditor = new XmlTreeSchemaTableView(xmlTreeEditorContainer, SWT.BORDER);
    inputTreeSchemaEditor.initGraphicComponents();
    metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {

        @Override
        public void handle(LineSelectionEvent e) {
            if (inputTreeSchemaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
                if (inputTreeSchemaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
                    mapperManage.selectLinkedInputTableEntries(inputTreeSchemaEditor.getTableViewerCreator().getTable().getSelectionIndices(), true);
                }
            }
        }
    };
    inputTreeSchemaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
    // output tree schema table view
    outputTreeSchemaEditor = new OutputXmlTreeSchemaTableView(xmlTreeEditorContainer, SWT.BORDER);
    outputTreeSchemaEditor.initGraphicComponents();
    metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {

        @Override
        public void handle(LineSelectionEvent e) {
            if (outputTreeSchemaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
                if (outputTreeSchemaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
                    mapperManage.selectLinkedOutputTableEntries(outputTreeSchemaEditor.getTableViewerCreator().getTable().getSelectionIndices(), true);
                }
            }
        }
    };
    outputTreeSchemaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
    item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.ExpressionEditor.Title"));
    StyledText styledText = createStyledText(item);
    this.styledTextHandler = new StyledTextHandler(styledText, mapperManage);
    tabFolderEditors.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event event) {
            mapperManage.fireCurrentDirectEditApply();
            // TDI-18185
            if (styledTextHandler.getSelectedNode() != null && XmlMapUtil.DOCUMENT.equals(styledTextHandler.getSelectedNode().getType())) {
                styledTextHandler.setTextWithoutNotifyListeners("");
                styledTextHandler.getStyledText().setEnabled(false);
                styledTextHandler.getStyledText().setEditable(false);
                styledTextHandler.getStyledText().setText("");
            }
            lastSelectedTab = tabFolderEditors.getSelectionIndex();
        }
    });
    tabFolderEditors.setSelection(0);
}
Also used : StyledText(org.eclipse.swt.custom.StyledText) UnnotifiableColorStyledText(org.talend.commons.ui.swt.colorstyledtext.UnnotifiableColorStyledText) DisposeListener(org.eclipse.swt.events.DisposeListener) IExtendedButtonListener(org.talend.commons.ui.swt.extended.table.IExtendedButtonListener) Listener(org.eclipse.swt.widgets.Listener) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) CTabItem(org.eclipse.swt.custom.CTabItem) SashForm(org.eclipse.swt.custom.SashForm) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) OutputXmlTreeSchemaTableView(org.talend.designer.xmlmap.ui.tabs.table.OutputXmlTreeSchemaTableView) XmlTreeSchemaTableView(org.talend.designer.xmlmap.ui.tabs.table.XmlTreeSchemaTableView) RowLayout(org.eclipse.swt.layout.RowLayout) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Event(org.eclipse.swt.widgets.Event) ExtendedButtonEvent(org.talend.commons.ui.swt.extended.table.ExtendedButtonEvent) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) XmlMapMetadataTableEditorView(org.talend.designer.xmlmap.ui.tabs.table.XmlMapMetadataTableEditorView) OutputXmlTreeSchemaTableView(org.talend.designer.xmlmap.ui.tabs.table.OutputXmlTreeSchemaTableView)

Example 78 with SashForm

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

the class ExpressionBuilderDialog method createDialogArea.

/**
     * Create contents of the dialog
     * 
     * @param parent
     */
@Override
protected Control createDialogArea(Composite parent) {
    container = (Composite) super.createDialogArea(parent);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.makeColumnsEqualWidth = true;
    container.setLayout(gridLayout);
    final SashForm sashForm = new SashForm(container, SWT.NONE);
    sashForm.setOrientation(SWT.VERTICAL);
    final Composite upperComposite = new Composite(sashForm, SWT.NONE);
    upperComposite.setLayout(new FillLayout());
    final SashForm upperSashform = new SashForm(upperComposite, SWT.NONE);
    expressionComposite = new ExpressionComposite(this, upperSashform, SWT.NONE, dataBean);
    expressionComposite.setExpression(defaultExpression, true);
    testComposite = new TestComposite(upperSashform, SWT.NONE);
    testComposite.addVariables(defaultVariables);
    upperSashform.setWeights(new int[] { 3, 2 });
    final Composite lowerComposite = new Composite(sashForm, SWT.NONE);
    lowerComposite.setLayout(new FillLayout());
    categoryComposite = new CategoryComposite(lowerComposite, SWT.NONE, manager);
    final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    sashForm.setLayoutData(gridData);
    sashForm.setWeights(new int[] { 3, 2 });
    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 79 with SashForm

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

the class FOXUI method createContent.

/**
     * Comment method "createContent".
     * 
     * @param child
     */
private void createContent(Composite mainComposite) {
    header = new HeaderComposite(mainComposite, SWT.NONE);
    if (this.foxManager.isNoLoopInComponent()) {
        //$NON-NLS-1$
        header.updateStatus(Messages.getString("FOXUI.NoLoop"));
    }
    // Splitter
    xmlToSchemaSash = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
    xmlToSchemaSash.setLayoutData(new GridData(GridData.FILL_BOTH));
    xmlToSchemaSash.setBackgroundMode(SWT.INHERIT_FORCE);
    canModify = externalNode.getProcess().isReadOnly();
    if (externalNode.getOriginalNode().getJobletNode() != null) {
        canModify = externalNode.getOriginalNode().isReadOnly();
    }
    IElementParameter elem = externalNode.getElementParameter("PROPERTY_TYPE");
    if (elem != null) {
        String value = (String) elem.getValue();
        if (value != null && value.equals("REPOSITORY")) {
            isRepository = true;
        }
    }
    addSchemaViewer(xmlToSchemaSash, 300, 110);
    addXMLViewer(xmlToSchemaSash, 400, 110);
    xmlToSchemaSash.setWeights(new int[] { 40, 60 });
    linker = new Schema2XMLLinker(this.xmlToSchemaSash);
    linker.init(schemaViewer.getTable(), xmlViewer);
    linker.setManager(foxManager);
    initSchemaTable();
    footerComp = new FooterComposite(mainComposite, SWT.NONE, foxManager);
    xmlViewer.expandToLevel(3);
    linker.createLinks();
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Schema2XMLLinker(org.talend.designer.fileoutputxml.ui.edit.Schema2XMLLinker) FooterComposite(org.talend.designer.fileoutputxml.ui.footer.FooterComposite) HeaderComposite(org.talend.designer.fileoutputxml.ui.header.HeaderComposite) GridData(org.eclipse.swt.layout.GridData) IElementParameter(org.talend.core.model.process.IElementParameter)

Example 80 with SashForm

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

the class TabFolderEditors method createComponents.

/**
     * DOC amaumont Comment method "createComponents".
     */
private void createComponents() {
    setSimple(false);
    // TableEditorCompositeBase metaDatasDescriptorView3 = new TableEditorCompositeBase(tabFolder1);
    // item.setControl(metaDatasDescriptorView3);
    CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.schemaEditor"));
    SashForm inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
    inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
    item.setControl(inOutMetaEditorContainer);
    CommandStack commandStack = mapperManager.getCommandStack();
    inputMetaEditor = new MetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
    inputMetaEditor.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(mapperManager.getAbstractMapComponent()));
    inputMetaEditor.initGraphicComponents();
    inputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
    addListenersToInputButtons();
    outputMetaEditor = new MetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
    outputMetaEditor.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(mapperManager.getAbstractMapComponent()));
    outputMetaEditor.initGraphicComponents();
    outputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
    addListenersToOutputButtons();
    item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.expressionEditor"));
    StyledText styledText = createStyledText(item);
    this.styledTextHandler = new StyledTextHandler(styledText, mapperManager);
    tabFolderEditors.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            lastSelectedTab = tabFolderEditors.getSelectionIndex();
        }
    });
    tabFolderEditors.setSelection(0);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) CommandStack(org.eclipse.gef.commands.CommandStack) StyledText(org.eclipse.swt.custom.StyledText) UnnotifiableColorStyledText(org.talend.commons.ui.swt.colorstyledtext.UnnotifiableColorStyledText) DisposeListener(org.eclipse.swt.events.DisposeListener) IExtendedButtonListener(org.talend.commons.ui.swt.extended.table.IExtendedButtonListener) Listener(org.eclipse.swt.widgets.Listener) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) RowLayout(org.eclipse.swt.layout.RowLayout) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Event(org.eclipse.swt.widgets.Event) ExtendedButtonEvent(org.talend.commons.ui.swt.extended.table.ExtendedButtonEvent) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) CTabItem(org.eclipse.swt.custom.CTabItem) MetadataTableEditorView(org.talend.core.ui.metadata.editor.MetadataTableEditorView)

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