@Test public void testIsTopLevelShiftOperationWhenDataTypeIsNotTopLevel() { final DataType dataType = mock(DataType.class); final DNDDataTypesHandlerShiftStrategy shiftStrategy = INSERT_TOP_LEVEL_DATA_TYPE_AT_THE_TOP; when(dataType.isTopLevel()).thenReturn(false); assertFalse(handler.isTopLevelShiftOperation(dataType, shiftStrategy)); }
boolean isTopLevelShiftOperation(final DataType dataType, final DNDDataTypesHandlerShiftStrategy shiftStrategy) { final boolean isCurrentTopLevel = dataType.isTopLevel(); final boolean isTopLevelShiftStrategy = shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE_AT_THE_TOP || shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE; return isCurrentTopLevel && isTopLevelShiftStrategy; }
DNDDataTypesHandler { boolean isTopLevelShiftOperation(final DataType dataType, final DNDDataTypesHandlerShiftStrategy shiftStrategy) { final boolean isCurrentTopLevel = dataType.isTopLevel(); final boolean isTopLevelShiftStrategy = shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE_AT_THE_TOP || shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE; return isCurrentTopLevel && isTopLevelShiftStrategy; } }
DNDDataTypesHandler { boolean isTopLevelShiftOperation(final DataType dataType, final DNDDataTypesHandlerShiftStrategy shiftStrategy) { final boolean isCurrentTopLevel = dataType.isTopLevel(); final boolean isTopLevelShiftStrategy = shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE_AT_THE_TOP || shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE; return isCurrentTopLevel && isTopLevelShiftStrategy; } @Inject  DNDDataTypesHandler(final DataTypeStore dataTypeStore,
                               final DataTypeManager dataTypeManager,
                               final ItemDefinitionStore itemDefinitionStore); }
DNDDataTypesHandler { boolean isTopLevelShiftOperation(final DataType dataType, final DNDDataTypesHandlerShiftStrategy shiftStrategy) { final boolean isCurrentTopLevel = dataType.isTopLevel(); final boolean isTopLevelShiftStrategy = shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE_AT_THE_TOP || shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE; return isCurrentTopLevel && isTopLevelShiftStrategy; } @Inject  DNDDataTypesHandler(final DataTypeStore dataTypeStore,
                               final DataTypeManager dataTypeManager,
                               final ItemDefinitionStore itemDefinitionStore); void init(final DataTypeList dataTypeList); void onDropDataType(final Element currentElement,
                               final Element hoverElement); void deleteKeepingReferences(final DataType existing); }
DNDDataTypesHandler { boolean isTopLevelShiftOperation(final DataType dataType, final DNDDataTypesHandlerShiftStrategy shiftStrategy) { final boolean isCurrentTopLevel = dataType.isTopLevel(); final boolean isTopLevelShiftStrategy = shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE_AT_THE_TOP || shiftStrategy == INSERT_TOP_LEVEL_DATA_TYPE; return isCurrentTopLevel && isTopLevelShiftStrategy; } @Inject  DNDDataTypesHandler(final DataTypeStore dataTypeStore,
                               final DataTypeManager dataTypeManager,
                               final ItemDefinitionStore itemDefinitionStore); void init(final DataTypeList dataTypeList); void onDropDataType(final Element currentElement,
                               final Element hoverElement); void deleteKeepingReferences(final DataType existing);  }