Search in sources :

Example 1 with URLDialog

use of bndtools.shared.URLDialog in project bndtools by bndtools.

the class ReposPreferencePage method doAddRepo.

private void doAddRepo() {
    URLDialog dialog = new URLDialog(getShell(), "Add repository URL", false);
    if (dialog.open() == Window.OK) {
        URI location = dialog.getLocation();
        String locationStr = location.toString();
        templateRepos.add(locationStr);
        vwrRepos.add(locationStr);
    }
}
Also used : URLDialog(bndtools.shared.URLDialog) URI(java.net.URI)

Example 2 with URLDialog

use of bndtools.shared.URLDialog in project bndtools by bndtools.

the class RepositorySelectionPart method doAddStandaloneLink.

private void doAddStandaloneLink() {
    try {
        URLDialog dialog = new URLDialog(editor.getSite().getShell(), "Add repository URL");
        if (dialog.open() == Window.OK) {
            URI location = dialog.getLocation();
            Attrs attrs = new Attrs();
            if (dialog.getName() != null)
                attrs.put("name", dialog.getName());
            HeaderClause clause = new HeaderClause(location.toString(), attrs);
            repositories.add(clause);
            refreshFromModel();
            markDirty();
        }
    } catch (Exception e) {
        throw Exceptions.duck(e);
    }
}
Also used : URLDialog(bndtools.shared.URLDialog) Attrs(aQute.bnd.header.Attrs) URI(java.net.URI) HeaderClause(aQute.bnd.build.model.clauses.HeaderClause) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

URLDialog (bndtools.shared.URLDialog)2 URI (java.net.URI)2 HeaderClause (aQute.bnd.build.model.clauses.HeaderClause)1 Attrs (aQute.bnd.header.Attrs)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1