use of org.eclipse.jface.wizard.Wizard in project egit by eclipse.
the class ResetCommand method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final RepositoryTreeNode<?> node = getSelectedNodes(event).get(0);
final String currentBranch;
try {
currentBranch = node.getRepository().getFullBranch();
} catch (IOException e1) {
throw new ExecutionException(e1.getMessage(), e1);
}
if (!(node.getObject() instanceof Ref)) {
// allowing reset to any commit
return new ResetActionHandler().execute(event);
}
// If a ref is selected in the repository view, only reset to
// that ref will be possible.
final Ref targetBranch = (Ref) node.getObject();
final String repoName = Activator.getDefault().getRepositoryUtil().getRepositoryName(node.getRepository());
Wizard wiz = new Wizard() {
@Override
public void addPages() {
addPage(new SelectResetTypePage(repoName, node.getRepository(), currentBranch, targetBranch.getName()));
setWindowTitle(UIText.ResetCommand_WizardTitle);
}
@Override
public boolean performFinish() {
final ResetType resetType = ((SelectResetTypePage) getPages()[0]).getResetType();
ResetMenu.performReset(getShell(), node.getRepository(), targetBranch.getObjectId(), resetType);
return true;
}
};
WizardDialog dlg = new WizardDialog(getShell(event), wiz);
dlg.setHelpAvailable(false);
dlg.open();
return null;
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class ImportFactory method importFromExchange.
/**
* DOC xqliu Comment method "importFromExchange".
*
* @param componet
* @return
*/
public static void importFromExchange(IEcosComponent componet) throws Exception {
File file = new File(componet.getInstalledLocation());
File copiedFile = new File(// $NON-NLS-1$
System.getProperty("java.io.tmpdir") + File.separator + new Path(componet.getInstalledLocation()).lastSegment());
// copy the downloaded file out of the workspace
org.apache.commons.io.FileUtils.copyFile(file, copiedFile);
Wizard wizard = new ImportFromExchangeWizard(copiedFile.getAbsolutePath());
WizardDialog dialog = new WizardDialog(null, wizard);
if (WizardDialog.OK == dialog.open()) {
ResourceManager.getLibrariesFolder().refreshLocal(IResource.DEPTH_INFINITE, null);
}
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class MatchAnalysisAction method openMatchAnalysisDialog.
private int openMatchAnalysisDialog(PackagesAnalyisParameter packaFilterParameter) {
Wizard wizard = WizardFactory.createAnalysisWizard(AnalysisType.MATCH_ANALYSIS, packaFilterParameter);
wizard.setForcePreviousAndNextButtons(!this.needselection);
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.setPageSize(500, 340);
return dialog.open();
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class AnalyzeColumnSetAction method opencolumnSetAnalysisDialog.
private int opencolumnSetAnalysisDialog(PackagesAnalyisParameter packaFilterParameter) {
Wizard wizard = WizardFactory.createAnalysisWizard(AnalysisType.COLUMN_SET, packaFilterParameter);
wizard.setForcePreviousAndNextButtons(!this.needselection);
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.setPageSize(500, 340);
return dialog.open();
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class CreateConnectionAnalysisAction method openStandardAnalysisDialog.
private void openStandardAnalysisDialog(AnalysisType type) {
Wizard wizard = WizardFactory.createAnalysisWizard(type);
wizard.setForcePreviousAndNextButtons(true);
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.setPageSize(500, 340);
if (WizardDialog.OK == dialog.open())
ProxyRepositoryManager.getInstance().save();
}
Aggregations