Search in sources :

Example 1 with ViewInputDialog2

use of org.talend.mdm.repository.ui.dialogs.ViewInputDialog2 in project tmdm-studio-se by Talend.

the class NewViewAction method doRun.

@Override
protected void doRun() {
    updateParentItem();
    int type = getType();
    IWorkbenchPartSite site = commonViewer.getCommonNavigator().getSite();
    ViewInputDialog2 vid = new ViewInputDialog2(site, getShell(), getDialogTitle(), Messages.Common_inputName, getInputValidator(), false, type);
    vid.setBtnShow(true);
    vid.create();
    vid.getShell().setSize(new Point(500, 320));
    vid.setBlockOnOpen(true);
    if (vid.open() == Window.CANCEL) {
        return;
    }
    String key = vid.getEntityName();
    String filterName = vid.getFilterName();
    Item item = null;
    if (filterName == null) {
        item = createServerObject(key);
    } else {
        // $NON-NLS-1$
        String filterPart = "";
        if (!filterName.isEmpty()) {
            // $NON-NLS-1$
            filterPart = "#" + filterName;
        }
        item = createServerObject(PREFIX_VIEW_UPPER + key + filterPart);
    }
    commonViewer.refresh(selectObj);
    commonViewer.expandToLevel(selectObj, 1);
    openEditor(item);
}
Also used : IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) Item(org.talend.core.model.properties.Item) WSViewItem(org.talend.mdm.repository.model.mdmproperties.WSViewItem) ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) ViewInputDialog2(org.talend.mdm.repository.ui.dialogs.ViewInputDialog2) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Aggregations

Point (org.eclipse.swt.graphics.Point)1 IWorkbenchPartSite (org.eclipse.ui.IWorkbenchPartSite)1 Item (org.talend.core.model.properties.Item)1 ContainerItem (org.talend.mdm.repository.model.mdmproperties.ContainerItem)1 WSViewItem (org.talend.mdm.repository.model.mdmproperties.WSViewItem)1 ViewInputDialog2 (org.talend.mdm.repository.ui.dialogs.ViewInputDialog2)1