SuperSelection superSel = this.getSuperSelection(worksheet);
HTable hTable = factory.getHTable(factory.getHNode(hNodeId).getHTableId());
Selection currentSel = superSel.getSelection(hTable.getId());
Selection anotherSel = null;
if (!operation.equalsIgnoreCase(Operation.Invert.name())) {
anotherSel = new MiniSelection(workspace, worksheetId, hTable.getId(), factory.getNewId("SEL"), superSel.getName(), pythonCode, onError);
worksheet.getSelectionManager().addSelection(anotherSel);
}
if (currentSel == null && operation.equalsIgnoreCase(Operation.Invert.name()) ) {
return getErrorUpdate("No defined Selection");
}
if (currentSel == null) {
currentSel = new MiniSelection(workspace, worksheetId, hTable.getId(), factory.getNewId("SEL"), superSel.getName(), SelectionManager.defaultCode, onError);
worksheet.getSelectionManager().addSelection(currentSel);
}
try {
Operation operation = Operation.valueOf(Operation.class, this.operation);
Selection t = new LargeSelection(workspace, worksheetId, hTable.getId(), factory.getNewId("SEL"), superSel.getName(), currentSel, anotherSel, operation);