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();
}
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();
}
}
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;
}
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);
}
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));
}
}
Aggregations