Search in sources :

Example 11 with Wizard

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;
}
Also used : Ref(org.eclipse.jgit.lib.Ref) SelectResetTypePage(org.eclipse.egit.ui.internal.repository.SelectResetTypePage) ResetActionHandler(org.eclipse.egit.ui.internal.actions.ResetActionHandler) ResetType(org.eclipse.jgit.api.ResetCommand.ResetType) IOException(java.io.IOException) ExecutionException(org.eclipse.core.commands.ExecutionException) Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 12 with Wizard

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);
    }
}
Also used : Path(org.eclipse.core.runtime.Path) ImportFromExchangeWizard(org.talend.dataprofiler.core.ui.imex.ImportFromExchangeWizard) IFile(org.eclipse.core.resources.IFile) File(java.io.File) ImportFromExchangeWizard(org.talend.dataprofiler.core.ui.imex.ImportFromExchangeWizard) Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 13 with Wizard

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();
}
Also used : Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 14 with Wizard

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();
}
Also used : Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 15 with Wizard

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();
}
Also used : Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

Wizard (org.eclipse.jface.wizard.Wizard)40 WizardDialog (org.eclipse.jface.wizard.WizardDialog)34 InvocationTargetException (java.lang.reflect.InvocationTargetException)9 CoreException (org.eclipse.core.runtime.CoreException)7 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)7 IOException (java.io.IOException)6 IFile (org.eclipse.core.resources.IFile)6 Path (org.eclipse.core.runtime.Path)6 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)5 Shell (org.eclipse.swt.widgets.Shell)5 InvalidAlgorithmParameterException (de.flexiprovider.api.exceptions.InvalidAlgorithmParameterException)4 NoSuchAlgorithmException (de.flexiprovider.api.exceptions.NoSuchAlgorithmException)4 AlgorithmParameterSpec (de.flexiprovider.api.parameters.AlgorithmParameterSpec)4 ByteArrayInputStream (java.io.ByteArrayInputStream)4 IContainer (org.eclipse.core.resources.IContainer)4 IResource (org.eclipse.core.resources.IResource)4 ResourcesPlugin (org.eclipse.core.resources.ResourcesPlugin)4 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)4 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)4 INewWizard (org.eclipse.ui.INewWizard)4