Search in sources :

Example 86 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class JobHierarchyViewPart method createPartControl.

@Override
public void createPartControl(Composite container) {
    fParent = container;
    addResizeListener(fParent);
    fPagebook = new PageBook(container, SWT.NONE);
    // page 1 of page book (no hierarchy label)
    fNoHierarchyShownLabel = new Label(fPagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
    fNoHierarchyShownLabel.setText(showEmptyLabel);
    // page 2 of page book (viewers)
    fTypeMethodsSplitter = new SashForm(fPagebook, SWT.VERTICAL);
    fTypeMethodsSplitter.setVisible(false);
    fTypeViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
    Control typeViewerControl = createTypeViewerControl(fTypeViewerViewForm);
    fTypeViewerViewForm.setContent(typeViewerControl);
    dependencyViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
    fTypeMethodsSplitter.setWeights(new int[] { 65, 35 });
    Control dependencyViewerPart = createMethodViewerControl(dependencyViewerViewForm);
    dependencyViewerViewForm.setContent(dependencyViewerPart);
    dependencyViewerPaneLabel = new CLabel(dependencyViewerViewForm, SWT.NONE);
    dependencyViewerViewForm.setTopLeft(dependencyViewerPaneLabel);
    ToolBar methodViewerToolBar = new ToolBar(dependencyViewerViewForm, SWT.FLAT | SWT.WRAP);
    dependencyViewerViewForm.setTopCenter(methodViewerToolBar);
    initDragAndDrop();
    MenuManager menu = new MenuManager();
    menu.add(focusOnTypeAction);
    fNoHierarchyShownLabel.setMenu(menu.createContextMenu(fNoHierarchyShownLabel));
    fPagebook.showPage(fNoHierarchyShownLabel);
    int layout;
    try {
        layout = fDialogSettings.getInt(DIALOGSTORE_VIEWLAYOUT);
        if (layout < 0 || layout > 3) {
            layout = VIEW_LAYOUT_AUTOMATIC;
        }
    } catch (NumberFormatException e) {
        layout = VIEW_LAYOUT_AUTOMATIC;
    }
    // force the update
    fCurrentLayout = -1;
    // will fill the main tool bar
    setViewLayout(layout);
    // set the filter menu items
    IActionBars actionBars = getViewSite().getActionBars();
    IMenuManager viewMenu = actionBars.getMenuManager();
    // for (int i = 0; i < fViewActions.length; i++) {
    // ToggleViewAction action = fViewActions[i];
    // viewMenu.add(action);
    // action.setEnabled(false);
    // }
    // viewMenu.add(new Separator());
    // IMenuManager layoutSubMenu = new MenuManager(TypeHierarchyMessages.TypeHierarchyViewPart_layout_submenu);
    //$NON-NLS-1$
    IMenuManager layoutSubMenu = new MenuManager(Messages.getString("FocusOnJobAction.TypeHierarchyViewPart_layout_submenu"));
    viewMenu.add(layoutSubMenu);
    for (int i = 0; i < fToggleOrientationActions.length; i++) {
        layoutSubMenu.add(fToggleOrientationActions[i]);
    }
    viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    // selection provider
    int nHierarchyViewers = fAllViewers.length;
    StructuredViewer[] trackedViewers = new StructuredViewer[nHierarchyViewers + 1];
    for (int i = 0; i < nHierarchyViewers; i++) {
        trackedViewers[i] = fAllViewers[i];
    }
    trackedViewers[nHierarchyViewers] = dependencyViewer;
    fSelectionProviderMediator = new SelectionProviderMediator(trackedViewers, getCurrentViewer());
    getSite().setSelectionProvider(fSelectionProviderMediator);
    ActionGroup[] actionGroups = new ActionGroup[] { new JobActionGroup() };
    fActionGroups = new CompositeActionGroup(actionGroups);
    fActionGroups.fillActionBars(actionBars);
}
Also used : CLabel(org.eclipse.swt.custom.CLabel) CompositeActionGroup(org.eclipse.jdt.internal.ui.actions.CompositeActionGroup) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) SelectionProviderMediator(org.eclipse.jdt.internal.ui.viewsupport.SelectionProviderMediator) Point(org.eclipse.swt.graphics.Point) SashForm(org.eclipse.swt.custom.SashForm) ViewForm(org.eclipse.swt.custom.ViewForm) Control(org.eclipse.swt.widgets.Control) PageBook(org.eclipse.ui.part.PageBook) ActionGroup(org.eclipse.ui.actions.ActionGroup) CompositeActionGroup(org.eclipse.jdt.internal.ui.actions.CompositeActionGroup) ToolBar(org.eclipse.swt.widgets.ToolBar) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) StructuredViewer(org.eclipse.jface.viewers.StructuredViewer) IActionBars(org.eclipse.ui.IActionBars) Separator(org.eclipse.jface.action.Separator)

Example 87 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class MapperManager method addOutput.

/**
     * DOC amaumont Comment method "addOutput".
     */
public void addOutput() {
    String joinTableName = null;
    OutputTable abstractDataMapTable = null;
    String name = uiManager.openNewOutputCreationDialog();
    if (name == null) {
        return;
    }
    String[] split = name.split(uiManager.NAME_SEPARATOR);
    String tableName = split[0];
    boolean isCreatingJoinTable = split.length == 2;
    if (isCreatingJoinTable) {
        joinTableName = split[1];
    }
    IProcess process = getAbstractMapComponent().getProcess();
    OutputTable orignalOutputTable = null;
    if (isCreatingJoinTable) {
        orignalOutputTable = getOutputTableByName(tableName);
        if (orignalOutputTable != null) {
            IMetadataTable metadataTable = orignalOutputTable.getMetadataTable();
            if (metadataTable != null) {
                process.addUniqueConnectionName(joinTableName);
                abstractDataMapTable = new OutputTable(this, metadataTable, joinTableName);
                abstractDataMapTable.setIsJoinTableOf(tableName);
            }
        }
    } else {
        process.addUniqueConnectionName(tableName);
        IMetadataTable metadataTable = getNewMetadataTable();
        metadataTable.setTableName(tableName);
        abstractDataMapTable = new OutputTable(this, metadataTable, tableName);
    }
    if (abstractDataMapTable == null) {
        return;
    }
    abstractDataMapTable.initFromExternalData(null);
    List<DataMapTableView> outputsTablesView = uiManager.getOutputsTablesView();
    int sizeOutputsView = outputsTablesView.size();
    Control lastChild = null;
    if (sizeOutputsView - 1 >= 0) {
        lastChild = outputsTablesView.get(sizeOutputsView - 1);
    }
    TablesZoneView tablesZoneViewOutputs = uiManager.getTablesZoneViewOutputs();
    DataMapTableView dataMapTableView = uiManager.createNewOutputTableView(lastChild, abstractDataMapTable, tablesZoneViewOutputs);
    tablesZoneViewOutputs.setSize(tablesZoneViewOutputs.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    tablesZoneViewOutputs.layout();
    uiManager.moveOutputScrollBarZoneToMax();
    uiManager.refreshBackground(true, false);
    tablesZoneViewOutputs.layout();
    uiManager.selectDataMapTableView(dataMapTableView, true, false);
}
Also used : IMetadataTable(org.talend.core.model.metadata.IMetadataTable) Control(org.eclipse.swt.widgets.Control) DataMapTableView(org.talend.designer.mapper.ui.visualmap.table.DataMapTableView) TablesZoneView(org.talend.designer.mapper.ui.visualmap.zone.scrollable.TablesZoneView) IProcess(org.talend.core.model.process.IProcess) OutputTable(org.talend.designer.mapper.model.table.OutputTable)

Example 88 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class SaveChartSetAsDialog method validate.

/**
     * Validates the specified chart set.
     */
void validate() {
    //$NON-NLS-1$
    String errorMessage = "";
    for (String predefinedChartSet : predefinedChartSets) {
        if (predefinedChartSet.equals(chartSetText.getText())) {
            errorMessage = Messages.illiegalChartSetMsg;
            break;
        }
    }
    errorImageLabel.setVisible(!errorMessage.isEmpty());
    errorMessageLabel.setText(errorMessage);
    Control button = getButton(IDialogConstants.OK_ID);
    if (button != null) {
        button.setEnabled(!chartSetText.getText().isEmpty());
    }
}
Also used : Control(org.eclipse.swt.widgets.Control)

Example 89 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class ExtendedNodeReviewDialog method createContents.

@Override
protected Control createContents(Composite parent) {
    Control control = super.createContents(parent);
    getButton(IDialogConstants.OK_ID).setEnabled(false);
    return control;
}
Also used : Control(org.eclipse.swt.widgets.Control)

Example 90 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class SchemaReferenceController method createControl.

@Override
public Control createControl(Composite subComposite, IElementParameter param, int numInRow, int nbInRow, int top, Control lastControl) {
    Control lastControlUsed = lastControl;
    if (elem instanceof Node) {
        lastControlUsed = super.createControl(subComposite, param, numInRow, nbInRow, top, lastControl);
    }
    lastControlUsed = addButton(subComposite, param, lastControlUsed, numInRow, top);
    return lastControlUsed;
}
Also used : Control(org.eclipse.swt.widgets.Control) Node(org.talend.designer.core.ui.editor.nodes.Node) RepositoryNode(org.talend.repository.model.RepositoryNode) INode(org.talend.core.model.process.INode)

Aggregations

Control (org.eclipse.swt.widgets.Control)475 Point (org.eclipse.swt.graphics.Point)149 Composite (org.eclipse.swt.widgets.Composite)141 GridData (org.eclipse.swt.layout.GridData)102 Button (org.eclipse.swt.widgets.Button)93 Label (org.eclipse.swt.widgets.Label)73 GridLayout (org.eclipse.swt.layout.GridLayout)71 Text (org.eclipse.swt.widgets.Text)70 FormData (org.eclipse.swt.layout.FormData)62 FormAttachment (org.eclipse.swt.layout.FormAttachment)61 Node (org.talend.designer.core.ui.editor.nodes.Node)46 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)45 SelectionEvent (org.eclipse.swt.events.SelectionEvent)44 StyledText (org.eclipse.swt.custom.StyledText)42 GC (org.eclipse.swt.graphics.GC)41 CLabel (org.eclipse.swt.custom.CLabel)38 ArrayList (java.util.ArrayList)36 Shell (org.eclipse.swt.widgets.Shell)35 FieldDecoration (org.eclipse.jface.fieldassist.FieldDecoration)33 CCombo (org.eclipse.swt.custom.CCombo)32