private boolean showDialogIsEmpty() { if (heap.isEmpty()) { Dialog.showInformation("Chyba", "Binární halda je prázdná."); return true; } return false; }
private Dialog.Result showHeapType() { HeapType[] buttons = new HeapType[] {HeapType.MIN, HeapType.MAX}; Dialog.CustomButtonsDialog<HeapType> dlg = Dialog.createCustomButtonsDialog( "Reset", "Vyberte typ nové haldy:", Dialog.Icon.QUESTION, buttons, true); Dialog.Result result = dlg.showDialog(); if (result == Dialog.Result.OK) { heap = new BinaryHeap(eventBus, dlg.getResult()); clear(); controlsContainer.getStructureControls().enableButtons(); } return result; }