private T addMessageLocationImpl(boolean buttonAddedLocation, MessageLocation messageLocation) { for (T locationUI : getModel().getElements()) { if (locationUI.getLocation().overlaps(messageLocation)) { View.getSingleton() .showWarningDialog( Constant.messages.getString( "messagelocationspanel.add.location.warning.locations.overlap")); return null; } } MessageLocationHighlight highlight = null; MessageLocationHighlight highlightReference = null; MessageLocationHighlightsManager highlightsManager = selectMessageLocationsPanel.create(); if (highlightsManager != null) { highlight = highlightsManager.getHighlight(messageLocation); highlightReference = selectMessageLocationsPanel.highlight(messageLocation, highlight); } T entry = createMessageLocationTableEntry( buttonAddedLocation, messageLocation, highlight, highlightReference); if (entry == null) { if (highlightsManager != null) { selectMessageLocationsPanel.removeHighlight(messageLocation, highlightReference); } return null; } getModel().addElement(entry); int row = getTable().convertRowIndexToView(getModel().getRow(entry)); getTable().setRowSelectionInterval(row, row); return null; }
public void reset() { for (T entry : getMultipleOptionsModel().getElements()) { MessageLocationHighlight highlightReference = entry.getHighlightReference(); if (highlightReference != null) { selectMessageLocationsPanel.removeHighlight(entry.getLocation(), highlightReference); } } getMultipleOptionsModel().clear(); }
@Override public boolean showRemoveDialogue(T e) { if (!getRemoveWithoutConfirmationCheckBox().isSelected()) { if (!showRemoveDialogueImpl(e)) { return false; } } MessageLocationHighlight highlightReference = e.getHighlightReference(); if (highlightReference != null) { selectMessageLocationsPanel.removeHighlight(e.getLocation(), highlightReference); } return true; }
@Override public T showAddDialogue() { addButton.setEnabled(false); return addMessageLocationImpl(true, selectMessageLocationsPanel.getSelection()); }