This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import binary project from right-click Maven menu
... works for selection in Maven Dependencies classpath container. As a good side effect, the import wizard now generally honours current selection. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
- Loading branch information
1 parent
ea9fb32
commit 6cc536f
Showing
3 changed files
with
143 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...roject.ui/src/com/ifedorenko/m2e/binaryproject/ui/internal/BinaryProjectImportAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012 Igor Fedorenko | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Igor Fedorenko - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ifedorenko.m2e.binaryproject.ui.internal; | ||
|
||
import org.eclipse.jface.action.IAction; | ||
import org.eclipse.jface.viewers.ISelection; | ||
import org.eclipse.jface.viewers.IStructuredSelection; | ||
import org.eclipse.jface.wizard.WizardDialog; | ||
import org.eclipse.ui.IObjectActionDelegate; | ||
import org.eclipse.ui.IWorkbench; | ||
import org.eclipse.ui.IWorkbenchPart; | ||
import org.eclipse.ui.IWorkbenchPartSite; | ||
|
||
public class BinaryProjectImportAction | ||
implements IObjectActionDelegate | ||
{ | ||
|
||
private IStructuredSelection selection; | ||
|
||
private IWorkbench workbench; | ||
|
||
private IWorkbenchPartSite site; | ||
|
||
@Override | ||
public void run( IAction action ) | ||
{ | ||
BinaryProjectImportWizard wizard = new BinaryProjectImportWizard(); | ||
wizard.init( workbench, selection ); | ||
if ( !wizard.getInitialDependencies().isEmpty() ) | ||
{ | ||
WizardDialog dialog = new WizardDialog( site.getShell(), wizard ); | ||
dialog.open(); | ||
} | ||
else | ||
{ | ||
wizard.dispose(); | ||
} | ||
} | ||
|
||
@Override | ||
public void selectionChanged( IAction action, ISelection selection ) | ||
{ | ||
if ( selection instanceof IStructuredSelection ) | ||
{ | ||
this.selection = (IStructuredSelection) selection; | ||
} | ||
else | ||
{ | ||
selection = null; | ||
} | ||
} | ||
|
||
@Override | ||
public void setActivePart( IAction action, IWorkbenchPart targetPart ) | ||
{ | ||
site = targetPart.getSite(); | ||
workbench = site.getWorkbenchWindow().getWorkbench(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters