Exemplo n.º 1
0
  public void setImports(final Path path, final Imports resourceImports) {
    checkNotNull("path", path);
    checkNotNull("imports", resourceImports);
    checkNotNull("imports", resourceImports.getImports());

    this.path = path;
    this.resourceImports = resourceImports;

    for (Import item : resourceImports.getImports()) {
      view.addImport(item.getType());
    }
  }
Exemplo n.º 2
0
  @Override
  public void onRemoveImport() {
    String selected = view.getSelected();
    if (selected == null) {
      view.showPleaseSelectAnImport();
    } else {
      final Import item = new Import(selected);
      view.removeImport(selected);
      resourceImports.removeImport(item);

      importRemovedEvent.fire(new ImportRemovedEvent(path, item));
    }
  }