use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class ImportDemoProjectItemsAction method run.
@Override
public void run() {
final List<DemoProjectBean> demoProjectList = ImportProjectsUtilities.getAllDemoProjects();
ImportDemoProjectItemsWizard demoProjectWizard = new ImportDemoProjectItemsWizard(demoProjectList);
WizardDialog dialog = new WizardDialog(shell, demoProjectWizard);
dialog.open();
}
use of org.eclipse.jface.wizard.WizardDialog in project tesb-studio-se by Talend.
the class CreateCamelBean method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
// RepositoryNode codeNode = getViewPart().getRoot().getChildren().get(4);
// RepositoryNode routineNode = codeNode.getChildren().get(0);
RepositoryNode beanNode = getCurrentRepositoryNode();
if (isToolbar()) {
if (beanNode != null && beanNode.getContentType() != CamelRepositoryNodeType.repositoryBeansType) {
beanNode = null;
}
if (beanNode == null) {
beanNode = getRepositoryNodeForDefault(CamelRepositoryNodeType.repositoryBeansType);
}
}
RepositoryNode node = null;
IPath path = null;
if (!isToolbar()) {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
node = (RepositoryNode) obj;
path = RepositoryNodeUtilities.getPath(node);
}
CamelNewBeanWizard beanWizard = new CamelNewBeanWizard(path);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), beanWizard);
if (dlg.open() == Window.OK) {
try {
openBeanEditor(beanWizard.getBean(), false);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
use of org.eclipse.jface.wizard.WizardDialog in project tesb-studio-se by Talend.
the class CreateCamelProcess method doRun.
@Override
protected void doRun() {
final CamelNewProcessWizard processWizard;
if (isToolbar()) {
processWizard = new CamelNewProcessWizard(null);
} else {
ISelection selection = getSelection();
if (selection == null) {
return;
}
Object obj = ((IStructuredSelection) selection).getFirstElement();
IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
IPath path = service.getRepositoryPath((IRepositoryNode) obj);
if (RepositoryConstants.isSystemFolder(path.toString())) {
// Not allowed to create in system folder.
return;
}
processWizard = new CamelNewProcessWizard(path);
}
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
if (dlg.open() == Window.OK) {
if (processWizard.getProcess() == null) {
return;
}
try {
openEditor(processWizard.getProcess());
} catch (PartInitException e) {
ExceptionHandler.process(e);
} catch (PersistenceException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class CreateRoutineAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
// RepositoryNode codeNode = getViewPart().getRoot().getChildren().get(4);
// RepositoryNode routineNode = codeNode.getChildren().get(0);
RepositoryNode routineNode = getCurrentRepositoryNode();
if (isToolbar()) {
if (routineNode != null && routineNode.getContentType() != ERepositoryObjectType.ROUTINES) {
routineNode = null;
}
if (routineNode == null) {
routineNode = getRepositoryNodeForDefault(ERepositoryObjectType.ROUTINES);
}
}
RepositoryNode node = null;
IPath path = null;
if (!isToolbar()) {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
node = (RepositoryNode) obj;
path = RepositoryNodeUtilities.getPath(node);
}
NewRoutineWizard routineWizard = new NewRoutineWizard(path);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), routineWizard);
if (dlg.open() == Window.OK) {
try {
openRoutineEditor(routineWizard.getRoutine(), false);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class CreateJSONAction method doRun.
@Override
protected void doRun() {
if (repositoryNode == null) {
repositoryNode = getCurrentRepositoryNode();
}
if (isToolbar()) {
if (repositoryNode != null && repositoryNode.getContentType() != JSONRepositoryNodeType.JSON) {
repositoryNode = null;
}
if (repositoryNode == null) {
repositoryNode = getRepositoryNodeForDefault(JSONRepositoryNodeType.JSON);
}
}
WizardDialog wizardDialog = null;
JSONWizard jsonWizard = null;
try {
if (isToolbar()) {
init(repositoryNode);
jsonWizard = new JSONWizard(PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames());
// hdfs.setToolBar(true);
wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), jsonWizard);
} else {
jsonWizard = new JSONWizard(PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames());
wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), jsonWizard);
}
wizardDialog.setPageSize(WIZARD_WIDTH, WIZARD_HEIGHT);
wizardDialog.create();
wizardDialog.open();
} finally {
if (jsonWizard != null) {
jsonWizard.deleteTemFile();
}
}
}
Aggregations