Label addLabel = new Label(optionsArea, SWT.NONE);
Image addImage = UIIcons.NEW_REPOSITORY.createImage();
UIUtils.hookDisposal(addLabel, addImage);
addLabel.setImage(addImage);
Hyperlink addLink = toolkit.createHyperlink(optionsArea,
UIText.RepositoriesView_linkAdd, SWT.WRAP);
addLink.setForeground(linkColor);
addLink.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
IHandlerService service = CommonUtils.getService(getViewSite(), IHandlerService.class);
UIUtils.executeCommand(service,
"org.eclipse.egit.ui.RepositoriesViewAddRepository"); //$NON-NLS-1$
}
});
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL)
.grab(true, false).applyTo(addLink);
Label cloneLabel = new Label(optionsArea, SWT.NONE);
Image cloneImage = UIIcons.CLONEGIT.createImage();
UIUtils.hookDisposal(cloneLabel, cloneImage);
cloneLabel.setImage(cloneImage);
Hyperlink cloneLink = toolkit.createHyperlink(optionsArea,
UIText.RepositoriesView_linkClone, SWT.WRAP);
cloneLink.setForeground(linkColor);
cloneLink.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
IHandlerService service = CommonUtils.getService(getViewSite(), IHandlerService.class);
UIUtils.executeCommand(service,
"org.eclipse.egit.ui.RepositoriesViewClone"); //$NON-NLS-1$
}
});
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL)
.grab(true, false).applyTo(cloneLink);
Label createLabel = new Label(optionsArea, SWT.NONE);
Image createImage = UIIcons.CREATE_REPOSITORY.createImage();
UIUtils.hookDisposal(createLabel, createImage);
createLabel.setImage(createImage);
Hyperlink createLink = toolkit.createHyperlink(optionsArea,
UIText.RepositoriesView_linkCreate, SWT.WRAP);
createLink.setForeground(linkColor);
createLink.setText(UIText.RepositoriesView_linkCreate);
createLink.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
IHandlerService service = CommonUtils.getService(getViewSite(), IHandlerService.class);
UIUtils.executeCommand(service,
"org.eclipse.egit.ui.RepositoriesViewCreateRepository"); //$NON-NLS-1$
}