Codota Logo
RouteModel
Code IndexAdd Codota to your IDE (free)

How to use
RouteModel
in
slash.navigation.routes.impl

Best Java code snippets using slash.navigation.routes.impl.RouteModel (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: cpesch/RouteConverter

public DeleteRoutes(UndoCatalogModel catalogModel, List<RouteModel> routes) {
  this.catalogModel = catalogModel;
  this.routes = routes;
  for (RouteModel route : routes) {
    categories.add(route.getCategory());
    descriptions.add(route.getDescription() != null ? route.getDescription() : route.getName());
    try {
      files.add(route.getRoute().getUrl());
    } catch (IOException e) {
      files.add(null);
    }
    urls.add(route.getRoute().getHref());
  }
}
origin: cpesch/RouteConverter

  public static String formatUrl(RouteModel route) {
    String url = route.getUrl();
    url = url.replaceAll("file:/", "");
    try {
      url = decodeUri(url);
    }
    catch (IllegalArgumentException e) {
      // intentionally left empty
    }
    return url;
  }
}
origin: cpesch/RouteConverter

  public int hashCode() {
    return Objects.hash(getCategory(), getRoute());
  }
}
origin: cpesch/RouteConverter

public String getDescription() {
  try {
    return getRoute().getDescription();
  } catch (Exception e) {
    log.severe("Cannot get description: " + e);
    return "?";
  }
}
origin: cpesch/RouteConverter

public static List<CategoryTreeNode> asParentsFromRoutes(List<RouteModel> routes) {
  List<CategoryTreeNode> parents = new ArrayList<>(routes.size());
  for (RouteModel routeModel : routes) {
    parents.add(routeModel.getCategory());
  }
  return parents;
}
origin: cpesch/RouteConverter

public void addRoute(final CategoryTreeNode category, final String description, final File file, final String url, final AddRouteCallback callback) {
  operator.executeOperation(new RouteServiceOperator.Operation() {
    public String getName() {
      return "AddRoute";
    }
    public void run() throws IOException {
      Route route = file != null ? category.getCategory().createRoute(description, file) : category.getCategory().createRoute(description, url);
      final RouteModel routeModel = new RouteModel(category, route);
      callback.setRoute(routeModel);
      invokeLater(new Runnable() {
        public void run() {
          routesTableModel.addRoute(routeModel);
        }
      });
    }
  });
}
origin: cpesch/RouteConverter

public static String formatName(RouteModel route) {
  String name = route.getName();
  if (name == null)
    name = RouteConverter.getBundle().getString("no-name");
  return name;
}
origin: cpesch/RouteConverter

  public void run() {
    List<RouteModel> routes = getSelectedRouteModels(table);
    if (routes.size() == 0)
      return;

    for (final RouteModel route : routes) {
      String name = (String) showInputDialog(WindowHelper.getFrame(),
          format(getBundle().getString("rename-route-label"), formatName(route)),
          WindowHelper.getFrame().getTitle(), QUESTION_MESSAGE, null, null, route.getDescription());
      if (trim(name) == null)
        return;

      catalogModel.renameRoute(route, name, new Runnable() {
        public void run() {
          final int row = ((RoutesTableModel) table.getModel()).getIndex(route);
          scrollToPosition(table, row);
          selectRoute(table, route);
        }
      });
    }
  }
}
origin: cpesch/RouteConverter

public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  RouteModel that = (RouteModel) o;
  return Objects.equals(getCategory(), that.getCategory()) &&
      Objects.equals(getRoute(), that.getRoute());
}
origin: cpesch/RouteConverter

public String getName() {
  try {
    return getRoute().getName();
  } catch (Exception e) {
    log.severe("Cannot get name: " + e);
    return "?";
  }
}
origin: cpesch/RouteConverter

public void setCurrentCategory(CategoryTreeNode category) {
  List<Route> routes = category.getRoutes();
  List<RouteModel> routeModels = new ArrayList<>();
  if (routes != null) {
    Route[] routesArray = routes.toArray(new Route[0]);
    sort(routesArray, routeComparator);
    for (Route route : routesArray)
      routeModels.add(new RouteModel(category, route));
  }
  getRoutesTableModel().setRoutes(routeModels);
}
origin: cpesch/RouteConverter

void renameRoute(RouteModel route, String newName, Runnable invokeLaterRunnable, boolean trackUndo) {
  String oldName = route.getName();
  delegate.renameRoute(route, newName, invokeLaterRunnable);
  if (trackUndo)
    undoManager.addEdit(new RenameRoute(this, route, oldName, newName));
}
origin: cpesch/RouteConverter

  public void run() throws IOException {
    for (int i = 0; i < routes.size(); i++) {
      RouteModel route = routes.get(i);
      CategoryTreeNode parent = parents.get(i);
      CategoryTreeNode category = route.getCategory();
      if (category.isLocal() && parent.isRemote())
        throw new IOException("cannot move local route " + route.getName() + " to remote parent " + parent.getName());
      if (category.isRemote() && parent.isLocal())
        throw new IOException("cannot move remote route " + route.getName() + " to local parent " + parent.getName());
      route.getRoute().update(parent.getCategory(), route.getDescription() != null ? route.getDescription() : route.getName());
    }
    invokeLater(new Runnable() {
      public void run() {
        for (CategoryTreeNode parent : parents) {
          setCurrentCategory(parent);
        }
        if (invokeLaterRunnable != null)
          invokeLaterRunnable.run();
      }
    });
  }
});
origin: cpesch/RouteConverter

  public void run() throws IOException {
    route.getRoute().update(route.getCategory().getCategory(), name);
    invokeLater(new Runnable() {
      public void run() {
        routesTableModel.updateRoute(route);
        if (invokeLaterRunnable != null)
          invokeLaterRunnable.run();
      }
    });
  }
});
origin: cpesch/RouteConverter

  public void run() throws IOException {
    for (final RouteModel route : routes) {
      route.getRoute().delete();
      invokeLater(new Runnable() {
        public void run() {
          routesTableModel.deleteRoute(route);
        }
      });
    }
  }
});
origin: cpesch/RouteConverter

  public void run() throws IOException {
    Route route = file != null ? category.getCategory().createRoute(description, file) : category.getCategory().createRoute(description, url);
    final RouteModel routeModel = new RouteModel(category, route);
    callback.setRoute(routeModel);
    invokeLater(new Runnable() {
      public void run() {
        routesTableModel.addRoute(routeModel);
      }
    });
  }
});
origin: cpesch/RouteConverter

public String getUrl() {
  try {
    return getRoute().getUrl();
  } catch (Exception e) {
    log.severe("Cannot get URL: " + e);
    return "?";
  }
}
origin: cpesch/RouteConverter

public static void selectRoute(JTable table, RouteModel route) {
  // search for RouteModel with same Route (Category might be different due to move)
  RoutesTableModel model = (RoutesTableModel) table.getModel();
  for(int i = 0; i < model.getRowCount(); i++) {
    if(model.getRoute(i).getRoute().equals(route.getRoute())) {
      scrollToPosition(table, i);
      table.getSelectionModel().addSelectionInterval(i, i);
      break;
    }
  }
}
origin: cpesch/RouteConverter

public static String formatCreator(RouteModel route) {
  String creator;
  try {
    creator = route.getRoute().getCreator();
    if (creator == null)
      creator = RouteConverter.getBundle().getString("no-creator");
  } catch (Exception e) {
    creator = RouteConverter.getBundle().getString("loading");
  }
  return creator;
}
origin: cpesch/RouteConverter

public static String formatDescription(RouteModel route) {
  String description = "";
  try {
    description = route.getRoute().getDescription();
    if(description == null)
      formatName(route);
  } catch (Exception e) {
    // intentionally left empty
  }
  return description;
}
slash.navigation.routes.implRouteModel

Javadoc

A model that encapsulates a Route.

Most used methods

  • getCategory
  • getRoute
  • <init>
  • getDescription
  • getName
  • getUrl

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now