Skip to content
Snippets Groups Projects
Commit 16b9603b authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

#12

parent 0e1cd6e5
No related branches found
No related tags found
No related merge requests found
...@@ -29,13 +29,13 @@ public class OperationCellValueFactory implements Callback<CellDataFeatures<?, S ...@@ -29,13 +29,13 @@ public class OperationCellValueFactory implements Callback<CellDataFeatures<?, S
public ObservableValue<String> call(final CellDataFeatures<?, String> call) { public ObservableValue<String> call(final CellDataFeatures<?, String> call) {
try { try {
final Method getter = call.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]); final Method getter = call.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
String componentName = (String) getter.invoke(call.getValue(), new Object[0]); String operationName = (String) getter.invoke(call.getValue(), new Object[0]);
if (PropertiesModel.getInstance().getOperationNames() == OperationNames.SHORT) { if (PropertiesModel.getInstance().getOperationNames() == OperationNames.SHORT) {
componentName = NameConverter.toShortComponentName(componentName); operationName = NameConverter.toShortOperationName(operationName);
} }
return new ReadOnlyObjectWrapper<String>(componentName); return new ReadOnlyObjectWrapper<String>(operationName);
} catch (final NullPointerException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { } catch (final NullPointerException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
LOGGER.warn(ex); LOGGER.warn(ex);
return null; return null;
......
...@@ -31,13 +31,13 @@ public class OperationTreeCellValueFactory implements Callback<CellDataFeatures< ...@@ -31,13 +31,13 @@ public class OperationTreeCellValueFactory implements Callback<CellDataFeatures<
try { try {
final TreeItem<?> item = (call.getValue()); final TreeItem<?> item = (call.getValue());
final Method getter = item.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]); final Method getter = item.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
String componentName = (String) getter.invoke(item.getValue(), new Object[0]); String operationName = (String) getter.invoke(item.getValue(), new Object[0]);
if (PropertiesModel.getInstance().getOperationNames() == OperationNames.SHORT) { if (PropertiesModel.getInstance().getOperationNames() == OperationNames.SHORT) {
componentName = NameConverter.toShortComponentName(componentName); operationName = NameConverter.toShortOperationName(operationName);
} }
return new ReadOnlyObjectWrapper<String>(componentName); return new ReadOnlyObjectWrapper<String>(operationName);
} catch (final NullPointerException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { } catch (final NullPointerException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
LOGGER.warn(ex); LOGGER.warn(ex);
return null; return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment