public void run(IAction action) {
IStructuredContentProvider structuredContentProvider = new IStructuredContentProvider() {
public Object[] getElements(Object inputElement) {
if (inputElement instanceof String) {
ProjectOrder projectOrder = ResourcesPlugin.getWorkspace().computeProjectOrder(ResourcesPlugin.getWorkspace().getRoot().getProjects());
return projectOrder.projects;
}
return null;
}
public void dispose() {
return;
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
return;
}
};
ILabelProvider labelProvider = new ILabelProvider() {
public Image getImage(Object element) {
return null;
}
public String getText(Object element) {
if (element instanceof String)
return (String) element;
if (element instanceof IProject)
return ((IProject) element).getName();
return null;
}
public void addListener(ILabelProviderListener listener) {
return;
}
public void dispose() {
return;
}
public boolean isLabelProperty(Object element, String property) {
return false;
}
public void removeListener(ILabelProviderListener listener) {
return;
}
};
iProjects = this.getIProjects();
ListSelectionDialog listSelectionDialog = new ListSelectionDialog(new Shell(), "WOLips", structuredContentProvider, labelProvider, "Select the projects to install.");
listSelectionDialog.setInitialSelections(iProjects);
listSelectionDialog.open();
if (listSelectionDialog.getReturnCode() == Window.CANCEL) {
return;
}
Object[] selectionResult = listSelectionDialog.getResult();
IProject[] projectsSelected = new IProject[selectionResult.length];
for (int i = 0; i < selectionResult.length; i++) {
projectsSelected[i] = (IProject) selectionResult[i];
}
ProjectOrder projectOrder = ResourcesPlugin.getWorkspace().computeProjectOrder(projectsSelected);
this.install(projectOrder.projects);
}