public void createPartControl(Composite parent) {
display = parent.getDisplay();
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
Action syncAction = new Action() {
public void run() {
if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),
"Fix dependencies",
"Alter dependencies?\n\nAnything marked in green will be synchronized.")) {
Job job = new SyncIvyFilesJob(dependencies);
job.addJobChangeListener(new JobChangeAdapter() {
public void done(IJobChangeEvent arg0) {
refresh(true);
}
});
job.schedule();
}
}
};
syncAction.setToolTipText("Synchronize ivy dependencies");
syncAction.setImageDescriptor(IvyPlugin.getImageDescriptor("icons/synced.gif"));
Action refreshAction = new Action() {
public void run() {
refresh(true);
}
};
refreshAction.setToolTipText("Refresh");
refreshAction.setImageDescriptor(IvyPlugin.getImageDescriptor("icons/refresh.gif"));
Action refreshAllAction = new Action() {
public void run() {
ReverseDependencyExplorerView.setSelectedProjects(null);
refresh(true);
}
};
refreshAllAction.setToolTipText("Show all projects in workspace");
refreshAllAction.setImageDescriptor(sharedImages
.getImageDescriptor(ISharedImages.IMG_TOOL_UP));
IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
toolbar.add(syncAction);
toolbar.add(refreshAction);