public static void previousPage(final Event e, final CraftView view) { final int newPage = view.getCurrentPage() - 1; if (newPage < 0) { return; } view.setCurrentPage(newPage); }
public static void nextPage(final Event e, final CraftView view) { final int newPage = view.getCurrentPage() + 1; if (newPage >= view.getCurrentMaxPages()) { return; } view.setCurrentPage(newPage); }
public static void validNameFilter(final Event event, final TextEditor textEditor) { final CraftView craftView = (CraftView) PropertiesProvider.getInstance() .getObjectProperty("craft", event.getTarget().getElementMap().getId()); final String text = textEditor.getText(); if (!text.equals(craftView.getNameFilter())) { craftView.setNameFilter(text); } }
public static void onCraftTypeChanged(final SelectionChangedEvent e, final CraftView view) { final byte id = (byte) (e.isSelected() ? 0 : 1); view.setCurrentType(CraftType.getFromId(id)); PropertiesProvider.getInstance().setPropertyValue("craftDisplayType", id); }