@Test public void testViewInitialization() { GroupFunction groupFunction = new GroupFunction("column1", "column1", null); presenter.init(metadata, groupFunction, null, "Title", false, false); verify(view).setDeleteOptionEnabled(false); verify(view, never()).setDeleteOptionEnabled(true); verify(view).setColumnSelectorTitle("Title"); verify(view).clearColumnSelector(); verify(view, times(3)).addColumnItem(anyString()); verify(view).setSelectedColumnIndex(0); verify(view).setFunctionSelectorEnabled(false); verify(view, never()).setFunctionSelectorEnabled(true); }
public void init(DataSetMetadata metadata, GroupFunction groupFunction, ColumnType targetType, String columnTitle, boolean functionsEnabled, boolean canDelete) { this.groupFunction = groupFunction; this.targetType = targetType; this.metadata = metadata; this.functionsEnabled = functionsEnabled; columnDetailsEditor.init(metadata, this.groupFunction); view.setColumnSelectorTitle(columnTitle); view.setDeleteOptionEnabled(canDelete); initColumnListBox(); if (functionsEnabled && (targetType == null || isColumnNumeric())) { view.setFunctionSelectorEnabled(true); initFunctionListBox(); } else { view.setFunctionSelectorEnabled(false); } }
ColumnFunctionEditor implements IsWidget { public void init(DataSetMetadata metadata, GroupFunction groupFunction, ColumnType targetType, String columnTitle, boolean functionsEnabled, boolean canDelete) { this.groupFunction = groupFunction; this.targetType = targetType; this.metadata = metadata; this.functionsEnabled = functionsEnabled; columnDetailsEditor.init(metadata, this.groupFunction); view.setColumnSelectorTitle(columnTitle); view.setDeleteOptionEnabled(canDelete); initColumnListBox(); if (functionsEnabled && (targetType == null || isColumnNumeric())) { view.setFunctionSelectorEnabled(true); initFunctionListBox(); } else { view.setFunctionSelectorEnabled(false); } } }
ColumnFunctionEditor implements IsWidget { public void init(DataSetMetadata metadata, GroupFunction groupFunction, ColumnType targetType, String columnTitle, boolean functionsEnabled, boolean canDelete) { this.groupFunction = groupFunction; this.targetType = targetType; this.metadata = metadata; this.functionsEnabled = functionsEnabled; columnDetailsEditor.init(metadata, this.groupFunction); view.setColumnSelectorTitle(columnTitle); view.setDeleteOptionEnabled(canDelete); initColumnListBox(); if (functionsEnabled && (targetType == null || isColumnNumeric())) { view.setFunctionSelectorEnabled(true); initFunctionListBox(); } else { view.setFunctionSelectorEnabled(false); } } @Inject  ColumnFunctionEditor(View view,
                                ColumnDetailsEditor columnDetailsEditor,
                                Event<GroupFunctionChangedEvent> changeEvent,
                                Event<GroupFunctionDeletedEvent> deleteEvent); }
ColumnFunctionEditor implements IsWidget { public void init(DataSetMetadata metadata, GroupFunction groupFunction, ColumnType targetType, String columnTitle, boolean functionsEnabled, boolean canDelete) { this.groupFunction = groupFunction; this.targetType = targetType; this.metadata = metadata; this.functionsEnabled = functionsEnabled; columnDetailsEditor.init(metadata, this.groupFunction); view.setColumnSelectorTitle(columnTitle); view.setDeleteOptionEnabled(canDelete); initColumnListBox(); if (functionsEnabled && (targetType == null || isColumnNumeric())) { view.setFunctionSelectorEnabled(true); initFunctionListBox(); } else { view.setFunctionSelectorEnabled(false); } } @Inject  ColumnFunctionEditor(View view,
                                ColumnDetailsEditor columnDetailsEditor,
                                Event<GroupFunctionChangedEvent> changeEvent,
                                Event<GroupFunctionDeletedEvent> deleteEvent); @Override Widget asWidget(); GroupFunction getGroupFunction(); ColumnType getTargetType(); ColumnDetailsEditor getColumnDetailsEditor(); void init(DataSetMetadata metadata,
                     GroupFunction groupFunction,
                     ColumnType targetType,
                     String columnTitle,
                     boolean functionsEnabled,
                     boolean canDelete); void delete(); List<AggregateFunctionType> getSupportedFunctionTypes(); List<AggregateFunctionType> getSupportedFunctionTypes(ColumnType columnType); }
ColumnFunctionEditor implements IsWidget { public void init(DataSetMetadata metadata, GroupFunction groupFunction, ColumnType targetType, String columnTitle, boolean functionsEnabled, boolean canDelete) { this.groupFunction = groupFunction; this.targetType = targetType; this.metadata = metadata; this.functionsEnabled = functionsEnabled; columnDetailsEditor.init(metadata, this.groupFunction); view.setColumnSelectorTitle(columnTitle); view.setDeleteOptionEnabled(canDelete); initColumnListBox(); if (functionsEnabled && (targetType == null || isColumnNumeric())) { view.setFunctionSelectorEnabled(true); initFunctionListBox(); } else { view.setFunctionSelectorEnabled(false); } } @Inject  ColumnFunctionEditor(View view,
                                ColumnDetailsEditor columnDetailsEditor,
                                Event<GroupFunctionChangedEvent> changeEvent,
                                Event<GroupFunctionDeletedEvent> deleteEvent); @Override Widget asWidget(); GroupFunction getGroupFunction(); ColumnType getTargetType(); ColumnDetailsEditor getColumnDetailsEditor(); void init(DataSetMetadata metadata,
                     GroupFunction groupFunction,
                     ColumnType targetType,
                     String columnTitle,
                     boolean functionsEnabled,
                     boolean canDelete); void delete(); List<AggregateFunctionType> getSupportedFunctionTypes(); List<AggregateFunctionType> getSupportedFunctionTypes(ColumnType columnType);  }