use of org.eclipse.jface.wizard.Wizard in project tdi-studio-se by Talend.
the class BusinessInitDiagramFileAction method run.
/**
* @generated NOT
*/
public void run(IAction action) {
TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
ResourceSet resourceSet = new ResourceSetImpl();
EObject diagramRoot = null;
try {
Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(mySelectedModelFile.getFullPath().toString()), true);
diagramRoot = (EObject) resource.getContents().get(0);
} catch (WrappedException ex) {
BusinessDiagramEditorPlugin.getInstance().logError(Messages.getString("BusinessInitDiagramFileAction.UnableToLoadResource") + mySelectedModelFile.getFullPath().toString(), //$NON-NLS-1$
ex);
}
if (diagramRoot == null) {
MessageDialog.openError(myPart.getSite().getShell(), Messages.getString("BusinessInitDiagramFileAction.Error"), //$NON-NLS-1$ //$NON-NLS-2$
Messages.getString("BusinessInitDiagramFileAction.LoadFaild"));
return;
}
Wizard wizard = new BusinessNewDiagramFileWizard(mySelectedModelFile, myPart.getSite().getPage(), mySelection, diagramRoot, editingDomain);
IDialogSettings pluginDialogSettings = BusinessDiagramEditorPlugin.getInstance().getDialogSettings();
//$NON-NLS-1$
IDialogSettings initDiagramFileSettings = pluginDialogSettings.getSection("InisDiagramFile");
if (initDiagramFileSettings == null) {
//$NON-NLS-1$
initDiagramFileSettings = pluginDialogSettings.addNewSection("InisDiagramFile");
}
wizard.setDialogSettings(initDiagramFileSettings);
wizard.setForcePreviousAndNextButtons(false);
wizard.setWindowTitle(//$NON-NLS-1$ //$NON-NLS-2$
Messages.getString("BusinessInitDiagramFileAction.IntialNew") + BusinessProcessEditPart.MODEL_ID + Messages.getString("BusinessInitDiagramFileAction.DiagramFile"));
WizardDialog dialog = new WizardDialog(myPart.getSite().getShell(), wizard);
dialog.create();
dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
dialog.open();
}
use of org.eclipse.jface.wizard.Wizard in project cubrid-manager by CUBRID.
the class TableEditorPart method createPartitionTabButtons.
/**
* Create Partition tab buttons
*
* @param parent Composite
*/
private void createPartitionTabButtons(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
{
GridLayout gl = new GridLayout();
gl.numColumns = 5;
composite.setLayout(gl);
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
}
addPartitionBtn = new Button(composite, SWT.PUSH);
{
GridData gd = new GridData(SWT.NONE);
gd.horizontalIndent = 10;
addPartitionBtn.setLayoutData(gd);
}
addPartitionBtn.setText(Messages.btnAddPartition);
addPartitionBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
String tableName = tableNameText.getText();
if (tableName.trim().length() == 0) {
CommonUITool.openErrorBox(getSite().getShell(), Messages.msgNoTableName);
return;
}
newSchemaInfo.setClassname(tableName);
Wizard wizard = new CreatePartitionWizard(database.getDatabaseInfo(), newSchemaInfo, partitionInfoList, isNewTableFlag, null);
CMWizardDialog dialog = new CMWizardDialog(getSite().getShell(), wizard);
dialog.setPageSize(600, 400);
if (dialog.open() != IDialogConstants.OK_ID) {
return;
}
partitionTableView.refresh();
changePartitionTabButtonStatus();
}
});
editPartitionBtn = new Button(composite, SWT.PUSH);
{
GridData gd = new GridData(SWT.NONE);
gd.horizontalIndent = 10;
editPartitionBtn.setLayoutData(gd);
}
editPartitionBtn.setText(Messages.btnEditPartition);
editPartitionBtn.setEnabled(false);
editPartitionBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
editPartition();
}
});
delPartitionBtn = new Button(composite, SWT.PUSH);
{
GridData gd = new GridData(SWT.NONE);
gd.horizontalIndent = 10;
delPartitionBtn.setLayoutData(gd);
}
delPartitionBtn.setText(Messages.btnDelPartition);
delPartitionBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
String confirmMsg = Messages.msgDelPartition;
if (getPartitonType() == PartitionType.HASH) {
confirmMsg = Messages.msgDelHashPartition;
}
boolean deleteConfirm = CommonUITool.openConfirmBox(getSite().getShell(), confirmMsg);
if (!deleteConfirm) {
return;
}
if (getPartitonType() == PartitionType.HASH) {
partitionInfoList.clear();
} else {
IStructuredSelection selection = (IStructuredSelection) partitionTableView.getSelection();
if (selection == null || selection.isEmpty()) {
return;
}
partitionInfoList.removeAll(selection.toList());
if (getPartitonType() == PartitionType.RANGE) {
CreatePartitionWizard.resetRangePartitionInfoList(partitionInfoList);
}
}
partitionTableView.refresh();
changePartitionTabButtonStatus();
}
});
final Table partitionTable = partitionTableView.getTable();
partitionTable.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
changePartitionTabButtonStatus();
}
});
changePartitionTabButtonStatus();
}
use of org.eclipse.jface.wizard.Wizard in project sling by apache.
the class AbstractJcrNodeImportExportContentHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection sel = HandlerUtil.getCurrentSelection(event);
JcrNode node = SelectionUtils.getFirst(sel, JcrNode.class);
if (node == null) {
return null;
}
IProject project = node.getProject();
if (!ProjectHelper.isContentProject(project)) {
return null;
}
IModule module = ServerUtil.getModule(project);
if (module == null) {
return null;
}
IResource resource = node.getResourceForImportExport();
if (resource == null) {
return null;
}
Wizard wiz = createWizard(resource);
WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wiz);
dialog.open();
return null;
}
use of org.eclipse.jface.wizard.Wizard in project linuxtools by eclipse.
the class StapNewWizard method performFinish.
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
* using wizard as execution context.
*/
@Override
public boolean performFinish() {
final String containerName = page.getContainerName();
final String fileName = page.getFileName();
IRunnableWithProgress op = monitor -> {
try {
doFinish(containerName, fileName, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
};
try {
getContainer().run(true, false, op);
} catch (InterruptedException e) {
// $NON-NLS-1$
MessageDialog.openError(getShell(), "Error", e.getLocalizedMessage());
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
// $NON-NLS-1$
MessageDialog.openError(getShell(), "Error", realException.getMessage());
return false;
}
return true;
}
use of org.eclipse.jface.wizard.Wizard in project linuxtools by eclipse.
the class SpecfileNewWizard method performFinish.
/**
* This method is called when 'Finish' button is pressed in the wizard. We
* will create an operation and run it using wizard as execution context.
*/
@Override
public boolean performFinish() {
final String containerName = page.getProjectName();
final String fileName = page.getFileName();
final InputStream contentInputStream = openContentStream();
IRunnableWithProgress op = monitor -> {
try {
doFinish(containerName, fileName, contentInputStream, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
};
try {
getContainer().run(true, false, op);
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
SpecfileLog.logError(e);
Throwable realException = e.getTargetException();
MessageDialog.openError(getShell(), Messages.SpecfileNewWizard_0, realException.getMessage());
return false;
}
return true;
}
Aggregations