Search in sources :

Example 6 with FolderProvider

use of org.talend.cwm.management.api.FolderProvider in project tdq-studio-se by Talend.

the class CreateDQRulesAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    DQRulesParameter parameter = new DQRulesParameter();
    FolderProvider folderProvider = new FolderProvider();
    folderProvider.setFolderResource(folder);
    parameter.setFolderProvider(folderProvider);
    NewDQRulesWizard fileWizard = WizardFactory.createNewDQRuleWizard(parameter);
    fileWizard.setWindowTitle(getText());
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), fileWizard);
    if (WizardDialog.OK == dialog.open())
        ProxyRepositoryManager.getInstance().save();
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider) DQRulesParameter(org.talend.dq.analysis.parameters.DQRulesParameter) NewDQRulesWizard(org.talend.dataprofiler.core.ui.wizard.dqrules.NewDQRulesWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 7 with FolderProvider

use of org.talend.cwm.management.api.FolderProvider in project tdq-studio-se by Talend.

the class CreatePatternAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    if (folder.exists()) {
        PatternParameter parameter = new PatternParameter();
        FolderProvider folderProvider = new FolderProvider();
        folderProvider.setFolderResource(folder);
        parameter.setFolderProvider(folderProvider);
        CreatePatternWizard fileWizard;
        if (this.expression != null && this.lanuage != null) {
            fileWizard = (CreatePatternWizard) WizardFactory.createPatternWizard(type, parameter, expression, lanuage);
        } else {
            fileWizard = (CreatePatternWizard) WizardFactory.createPatternWizard(type, parameter);
        }
        fileWizard.setPurpose(purpose);
        IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
        IHelpResource[] relatedTopics = context.getRelatedTopics();
        String href = relatedTopics[0].getHref();
        switch(type) {
            case SQL_LIKE:
                href = relatedTopics[1].getHref();
                break;
            default:
                break;
        }
        WizardDialog dialog = new OpeningHelpWizardDialog(Display.getDefault().getActiveShell(), fileWizard, href);
        fileWizard.setWindowTitle(getText());
        if (WizardDialog.OK == dialog.open())
            ProxyRepositoryManager.getInstance().save();
    }
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider) IContext(org.eclipse.help.IContext) CreatePatternWizard(org.talend.dataprofiler.core.pattern.CreatePatternWizard) IHelpResource(org.eclipse.help.IHelpResource) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) PatternParameter(org.talend.dq.analysis.parameters.PatternParameter) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 8 with FolderProvider

use of org.talend.cwm.management.api.FolderProvider in project tdq-studio-se by Talend.

the class CreateMatcherRuleAction method doRun.

public boolean doRun() {
    DQMatchRuleParameter parameter = new DQMatchRuleParameter();
    FolderProvider folderProvider = new FolderProvider();
    folderProvider.setFolderResource(folder);
    parameter.setFolderProvider(folderProvider);
    parameter.setDefaultAlgorithmType(defaultAlgorithmType);
    NewMatchRuleWizard matchWizard = WizardFactory.createNewMatchRuleWizard(parameter);
    matchWizard.setWindowTitle(getText());
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), matchWizard);
    if (WizardDialog.OK == dialog.open()) {
        ProxyRepositoryManager.getInstance().save();
        return true;
    }
    return false;
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider) NewMatchRuleWizard(org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard) DQMatchRuleParameter(org.talend.dq.analysis.parameters.DQMatchRuleParameter) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 9 with FolderProvider

use of org.talend.cwm.management.api.FolderProvider in project tdq-studio-se by Talend.

the class MetadataWizardPage method createControl.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.wizard.PropertiesWizardPage#createControl
     * (org.eclipse.swt.widgets.Composite)
     */
public void createControl(Composite parent) {
    if (getParameter().getFolderProvider() == null || getParameter().getFolderProvider().isNull()) {
        FolderProvider defaultFolder = new FolderProvider();
        defaultFolder.setFolderResource(getStoredFolder());
        getParameter().setFolderProvider(defaultFolder);
    }
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout gdLayout = new GridLayout(2, false);
    container.setLayout(gdLayout);
    GridData data;
    // Name
    Label nameLab = new Label(container, SWT.NONE);
    // $NON-NLS-1$
    nameLab.setText(DefaultMessagesImpl.getString("MetadataWizardPage.name"));
    nameText = new Text(container, SWT.BORDER);
    nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // set the max number of characters to be entered in the text field
    // ADDED sgandon 16/03/2010 bug 11760
    nameText.setTextLimit(EmfHelper.getStringMaxSize(CorePackage.Literals.MODEL_ELEMENT__NAME, TEXT_FIELD_DEFAULT_MAX_CHAR_LIMIT));
    // Purpose
    Label purposeLab = new Label(container, SWT.NONE);
    // $NON-NLS-1$
    purposeLab.setText(DefaultMessagesImpl.getString("MetadataWizardPage.purpose"));
    purposeText = new Text(container, SWT.BORDER);
    purposeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // set the max number of characters to be entered in the text field
    // ADDED sgandon 16/03/2010 bug 11760
    purposeText.setTextLimit(TaggedValueHelper.getStringMaxSize(TaggedValueHelper.PURPOSE, TEXT_FIELD_DEFAULT_MAX_CHAR_LIMIT));
    // Description
    Label descriptionLab = new Label(container, SWT.NONE);
    // $NON-NLS-1$
    descriptionLab.setText(DefaultMessagesImpl.getString("MetadataWizardPage.description"));
    descriptionLab.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    descriptionText = new Text(container, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = 60;
    descriptionText.setLayoutData(data);
    // set the max number of characters to be entered in the text field
    descriptionText.setTextLimit(TaggedValueHelper.getStringMaxSize(TaggedValueHelper.DESCRIPTION, TEXT_FIELD_DEFAULT_MAX_CHAR_LIMIT));
    // Author
    Label authorLab = new Label(container, SWT.NONE);
    // $NON-NLS-1$
    authorLab.setText(DefaultMessagesImpl.getString("MetadataWizardPage.author"));
    authorText = new Text(container, SWT.BORDER);
    authorText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    authorText.setTextLimit(TaggedValueHelper.getStringMaxSize(TaggedValueHelper.AUTHOR, TEXT_FIELD_DEFAULT_MAX_CHAR_LIMIT));
    String author = ReponsitoryContextBridge.getAuthor();
    authorText.setText(author);
    getParameter().setAuthor(author);
    // MOD 2016-10-19 xqliu TDQ-12692 change the author field to read-only always
    // both TDQ and TOS for DQ, the author field should be read-only
    authorText.setEnabled(false);
    // Version
    // Label versionLab = new Label(container, SWT.NONE);
    // versionLab.setText("Version");
    // 
    // Composite versionContainer = new Composite(container, SWT.NONE);
    // versionContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // GridLayout versionLayout = new GridLayout(3, false);
    // versionLayout.marginHeight = 0;
    // versionLayout.marginWidth = 0;
    // versionLayout.horizontalSpacing = 0;
    // versionContainer.setLayout(versionLayout);
    // 
    // versionText = new Text(versionContainer, SWT.BORDER);
    // versionText.setEnabled(false);
    // versionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // versionText.setText(getParameter().getVersion());
    // 
    // versionMajorBtn = new Button(versionContainer, SWT.PUSH);
    // versionMajorBtn.setText("M");
    // 
    // versionMinorBtn = new Button(versionContainer, SWT.PUSH);
    // versionMinorBtn.setText("m"); //$NON-NLS-1$
    // Status
    Label statusLab = new Label(container, SWT.NONE);
    // $NON-NLS-1$
    statusLab.setText("Status");
    statusText = new CCombo(container, SWT.BORDER);
    // statusText.setText(DevelopmentStatus.DRAFT.getLiteral());
    statusText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    statusText.setEditable(false);
    // MOD mzhao feature 7479 2009-10-12
    List<org.talend.core.model.properties.Status> statusList = MetadataHelper.getTechnicalStatus();
    if (statusList != null && statusList.size() > 0) {
        String[] tempString = new String[statusList.size()];
        statusText.setItems(MetadataHelper.toArray(statusList).toArray(tempString));
    } else {
        for (DevelopmentStatus status : DevelopmentStatus.values()) {
            statusText.add(status.getLiteral());
        }
    }
    statusText.select(0);
    getParameter().setStatus(statusText.getText());
    // Path:
    Label pathLab = new Label(container, SWT.NONE);
    // $NON-NLS-1$
    pathLab.setText("Path");
    Composite pathContainer = new Composite(container, SWT.NONE);
    pathContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout pathLayout = new GridLayout(2, false);
    pathLayout.marginHeight = 0;
    pathLayout.marginWidth = 0;
    pathLayout.horizontalSpacing = 0;
    pathContainer.setLayout(pathLayout);
    pathText = new Text(pathContainer, SWT.BORDER);
    pathText.setEnabled(false);
    pathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    button = new Button(pathContainer, SWT.PUSH);
    // $NON-NLS-1$
    button.setText(DefaultMessagesImpl.getString("MetadataWizardPage.select"));
    createExtendedControl(container);
    addListeners();
    setControl(container);
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) DevelopmentStatus(org.talend.cwm.constants.DevelopmentStatus) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) FolderProvider(org.talend.cwm.management.api.FolderProvider) GridLayout(org.eclipse.swt.layout.GridLayout) CCombo(org.eclipse.swt.custom.CCombo) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) DevelopmentStatus(org.talend.cwm.constants.DevelopmentStatus)

Example 10 with FolderProvider

use of org.talend.cwm.management.api.FolderProvider in project tdq-studio-se by Talend.

the class NewWizardSelectionPage method initCurrentFolderProvider.

/**
 * DOC xqliu Comment method "initCurrentFolderProvider".
 *
 * @param path
 */
private void initCurrentFolderProvider(IPath path) {
    if (path != null) {
        this.currentFolderProvider = new FolderProvider();
        this.currentFolderProvider.setFolderResource(ResourceManager.getRootProject().getFolder(path));
    }
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider)

Aggregations

FolderProvider (org.talend.cwm.management.api.FolderProvider)10 WizardDialog (org.eclipse.jface.wizard.WizardDialog)6 IContext (org.eclipse.help.IContext)3 OpeningHelpWizardDialog (org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog)3 IHelpResource (org.eclipse.help.IHelpResource)2 NewMatchRuleWizard (org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard)2 DQMatchRuleParameter (org.talend.dq.analysis.parameters.DQMatchRuleParameter)2 IStatus (org.eclipse.core.runtime.IStatus)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 CCombo (org.eclipse.swt.custom.CCombo)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1