Search in sources :

Example 1 with TMAP_LOOKUP_MODE

use of org.talend.designer.mapper.model.table.TMAP_LOOKUP_MODE in project tdi-studio-se by Talend.

the class InputDataMapTableView method addToolItems.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.mapper.ui.visualmap.table.DataMapTableView#addEntriesActionsComponents()
     */
@Override
protected boolean addToolItems() {
    // TODO: unlock this tentatively.
    if (!getInputTable().isMainConnection()) {
        final InputTable table = getInputTable();
        // condensed Item
        condensedItem = new ToolItem(toolBarActions, SWT.CHECK);
        // condensedItem.setEnabled(!mapperManager.componentIsReadOnly());
        condensedItem.setSelection(table.isActivateCondensedTool());
        condensedItem.setToolTipText("tMap settings");
        initCondensedItemImage();
        condensedItem.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                table.setActivateCondensedTool(condensedItem.getSelection());
                showTableMapSetting(condensedItem.getSelection());
            }
        });
        if (mapperManager.isPersistentMap()) {
            TMAP_LOOKUP_MODE lookupMode = (TMAP_LOOKUP_MODE) table.getLookupMode();
            switch(lookupMode) {
                case LOAD_ONCE:
                case LOAD_ONCE_AND_UPDATE:
                case RELOAD:
                    persistentCheckEditable = true;
                    previousValidPersistentMode = table.isPersistent();
                    break;
                case CACHE_OR_RELOAD:
                    persistentCheckEditable = false;
                    getInputTable().setPersistent(false);
                    break;
                default:
                    break;
            }
        }
    }
    createActivateFilterCheck();
    createColumnNameFilterCheck();
    return true;
}
Also used : InputTable(org.talend.designer.mapper.model.table.InputTable) TMAP_LOOKUP_MODE(org.talend.designer.mapper.model.table.TMAP_LOOKUP_MODE) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ToolItem(org.eclipse.swt.widgets.ToolItem)

Aggregations

SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 ToolItem (org.eclipse.swt.widgets.ToolItem)1 InputTable (org.talend.designer.mapper.model.table.InputTable)1 TMAP_LOOKUP_MODE (org.talend.designer.mapper.model.table.TMAP_LOOKUP_MODE)1