package org.simantics.scl.ui.modulebrowser;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.simantics.scl.osgi.SCLOsgi;
+import org.simantics.scl.ui.Activator;
import org.simantics.scl.ui.editor2.OpenSCLModule;
public class SCLModuleBrowser extends ViewPart {
OpenSCLModule.openModule(entry.fullName);
}
});
+
+ IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
+ toolBarManager.add(new Action("Refresh modules",
+ Activator.imageDescriptorFromPlugin("org.simantics.scl.ui", "icons/arrow_refresh.png")) {
+ @Override
+ public void run() {
+ SCLOsgi.MODULE_REPOSITORY.getSourceRepository().checkUpdates();
+ content.recalculateInput();
+ }
+ });
}
@Override
setLabelProvider(labelProvider);
setContentProvider(contentProvider);
setAutoExpandLevel(1);
- setInput(repository.getSourceRepository().getModuleNames());
+ recalculateInput();
}
private static ModuleNameTreeEntry createModuleTreeEntry(Collection<String> names) {
return root;
}
+ public void recalculateInput() {
+ setInput(repository.getSourceRepository().getModuleNames());
+ }
+
}