本文整理汇总了Java中com.vaadin.ui.Table.TableDragMode类的典型用法代码示例。如果您正苦于以下问题:Java TableDragMode类的具体用法?Java TableDragMode怎么用?Java TableDragMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableDragMode类属于com.vaadin.ui.Table包,在下文中一共展示了TableDragMode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetComponents
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
protected void resetComponents() {
if (this.isReadOnly()) {
this.checkBoxAutoSave.setEnabled(false);
this.buttonSave.setEnabled(false);
this.tree.setDragMode(TableDragMode.NONE);
this.tree.removeAllActionHandlers();
this.tree.setReadOnly(true);
} else {
this.checkBoxAutoSave.setEnabled(true);
this.buttonSave.setEnabled(this.isModified);
this.tree.setReadOnly(false);
this.tree.setDragMode(TableDragMode.ROW);
this.installTreeActionHandler();
}
}
示例2: createArtifactDetailsMaxView
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
private void createArtifactDetailsMaxView() {
artifactDetailsTable.setValue(null);
artifactDetailsTable.setSelectable(false);
artifactDetailsTable.setMultiSelect(false);
artifactDetailsTable.setDragMode(TableDragMode.NONE);
artifactDetailsTable.setColumnCollapsingAllowed(true);
artifactUploadState.setArtifactDetailsMaximized(Boolean.TRUE);
eventBus.publish(this, ArtifactDetailsEvent.MAXIMIZED);
}
示例3: buildEntityTable
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
protected void buildEntityTable() {
entityTable.setContainerDataSource(entitySettingsContainer);
entityTable.setSelectable(true);
entityTable.setSortEnabled(false);
entityTable.setImmediate(true);
entityTable.setSizeFull();
entityTable.addGeneratedColumn("entityName", new ColumnGenerator() {
private static final long serialVersionUID = 1L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
EntitySettings setting = (EntitySettings) itemId;
Model model = component.getInputModel();
ModelEntity entity = model.getEntityById(setting.getEntityId());
return UiUtils.getName(entityFilterField.getValue(), entity.getName());
}
});
entityTable.setVisibleColumns(new Object[] { "entityName" });
entityTable.setColumnWidth("entityName", 250);
entityTable.setColumnHeaders(new String[] { "Entity Name" });
entityTable.setColumnExpandRatio("entityName", 1);
entityTable.setTableFieldFactory(new EditEntityFieldFactory());
entityTable.setEditable(true);
entityTable.setMultiSelect(true);
entityTable.setDragMode(TableDragMode.MULTIROW);
entityTable.setDropHandler(new TableDropHandler());
entityTable.setCellStyleGenerator(new TableCellStyleGenerator());
addComponent(entityTable);
setExpandRatio(entityTable, 1.0f);
}
示例4: buildEntityTable
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
protected void buildEntityTable() {
entityTable.setContainerDataSource(entitySettingsContainer);
entityTable.setSelectable(true);
entityTable.setSortEnabled(false);
entityTable.setImmediate(true);
entityTable.setSizeFull();
entityTable.addGeneratedColumn("entityName", new ColumnGenerator() {
private static final long serialVersionUID = 1L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
EntitySettings setting = (EntitySettings) itemId;
Model model = component.getInputModel();
ModelEntity entity = model.getEntityById(setting.getEntityId());
return UiUtils.getName(entityFilterField.getValue(), entity.getName());
}
});
entityTable.setVisibleColumns(new Object[] { "entityName", "addEnabled", "updateEnabled", "deleteEnabled" });
entityTable.setColumnWidth("entityName", 250);
entityTable.setColumnHeaders(new String[] { "Entity Name", "Add Enabled", "Chg Enabled", "Del Enabled" });
entityTable.setColumnExpandRatio("entityName", 1);
entityTable.setTableFieldFactory(new EditEntityFieldFactory());
entityTable.setEditable(true);
entityTable.setMultiSelect(true);
if (!readOnly) {
entityTable.setDragMode(TableDragMode.MULTIROW);
entityTable.setDropHandler(new TableDropHandler());
}
entityTable.setCellStyleGenerator(new TableCellStyleGenerator());
addComponent(entityTable);
setExpandRatio(entityTable, 1.0f);
}
示例5: buildMainLayout
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
private void buildMainLayout() {
availableModuleTable = new Table();
availableModuleTable.setWidth("450px");
availableModuleTable.setHeight("100%");
availableModuleTable.setDragMode(TableDragMode.ROW);
}
示例6: buildTable
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
private Table buildTable() {
final Table table = new Table() {
@Override
protected String formatPropertyValue(final Object rowId,
final Object colId, final Property<?> property) {
String result = super.formatPropertyValue(rowId, colId,
property);
if (colId.equals("time")) {
result = DATEFORMAT.format(((Date) property.getValue()));
} else if (colId.equals("price")) {
if (property != null && property.getValue() != null) {
return "$" + DECIMALFORMAT.format(property.getValue());
} else {
return "";
}
}
return result;
}
};
table.setSizeFull();
table.addStyleName(ValoTheme.TABLE_BORDERLESS);
table.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
table.addStyleName(ValoTheme.TABLE_COMPACT);
table.setSelectable(true);
table.setColumnCollapsingAllowed(true);
table.setColumnCollapsible("time", false);
table.setColumnCollapsible("price", false);
table.setColumnReorderingAllowed(true);
table.setContainerDataSource(new TempTransactionsContainer(DashboardUI
.getDataProvider().getRecentTransactions(200)));
table.setSortContainerPropertyId("time");
table.setSortAscending(false);
table.setColumnAlignment("seats", Align.RIGHT);
table.setColumnAlignment("price", Align.RIGHT);
table.setVisibleColumns("time", "country", "city", "theater", "room",
"title", "seats", "price");
table.setColumnHeaders("Time", "Country", "City", "Theater", "Room",
"Title", "Seats", "Price");
table.setFooterVisible(true);
table.setColumnFooter("time", "Total");
table.setColumnFooter(
"price",
"$"
+ DECIMALFORMAT.format(DashboardUI.getDataProvider()
.getTotalSum()));
// Allow dragging items to the reports menu
table.setDragMode(TableDragMode.MULTIROW);
table.setMultiSelect(true);
table.addActionHandler(new TransactionsActionHandler());
table.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(final ValueChangeEvent event) {
if (table.getValue() instanceof Set) {
Set<Object> val = (Set<Object>) table.getValue();
createReport.setEnabled(val.size() > 0);
}
}
});
table.setImmediate(true);
return table;
}
示例7: EditFlowSettingsDialog
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
public EditFlowSettingsDialog(ApplicationContext context, Flow flow, boolean readOnly) {
super("Flow Settings");
this.context = context;
this.flow = flow;
Button closeButton = new Button("Close");
closeButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
closeButton.addClickListener(new CloseClickListener());
addHeader("General Settings");
FormLayout formLayout = new FormLayout();
formLayout.setMargin(true);
formLayout.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
formLayout.setWidth(100, Unit.PERCENTAGE);
addComponent(formLayout);
ImmediateUpdateTextArea description = new ImmediateUpdateTextArea("Notes") {
protected void save(String text) {
flow.setNotes(text);
context.getConfigurationService().save(flow);
};
};
description.setValue(flow.getNotes());
formLayout.addComponent(description);
addHeader("Parameters");
if (!readOnly) {
ButtonBar buttonBar = new ButtonBar();
buttonBar.addButton("Add", FontAwesome.PLUS, new AddClickListener());
insertButton = buttonBar.addButton("Insert", FontAwesome.CHEVRON_RIGHT, new InsertClickListener());
insertButton.setEnabled(false);
removeButton = buttonBar.addButton("Remove", FontAwesome.TRASH_O, new RemoveClickListener());
removeButton.setEnabled(false);
addComponent(buttonBar);
}
VerticalLayout tableWrapperLayout = new VerticalLayout();
tableWrapperLayout.setMargin(true);
tableWrapperLayout.setSizeFull();
table = new Table();
table.setSizeFull();
container = new BeanItemContainer<FlowParameter>(FlowParameter.class);
table.setContainerDataSource(container);
table.setSelectable(true);
table.setSortEnabled(false);
if (!readOnly) {
table.setEditable(true);
table.setDragMode(TableDragMode.ROW);
table.setDropHandler(new TableDropHandler());
table.setTableFieldFactory(new EditFieldFactory());
table.addValueChangeListener(this);
}
table.setVisibleColumns("position", "name", "defaultValue");
table.setColumnHeaders("#", "Name", "Default Value");
table.setColumnExpandRatio("name", .3f);
table.setColumnExpandRatio("defaultValue", .6f);
tableWrapperLayout.addComponent(table);
addComponent(tableWrapperLayout, 1);
addComponent(buildButtonFooter(closeButton));
List<FlowParameter> params = flow.getFlowParameters();
Collections.sort(params, new Comparator<FlowParameter>() {
public int compare(FlowParameter o1, FlowParameter o2) {
return new Integer(o1.getPosition()).compareTo(new Integer(o2.getPosition()));
}
});
for (FlowParameter flowParameter : params) {
table.addItem(flowParameter);
}
}
示例8: buildUI
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
protected void buildUI() {
ButtonBar buttonBar = new ButtonBar();
if (!readOnly) {
addComponent(buttonBar);
Button moveUpButton = buttonBar.addButton("Move Up", FontAwesome.ARROW_UP);
moveUpButton.addClickListener(new MoveUpClickListener());
Button moveDownButton = buttonBar.addButton("Move Down", FontAwesome.ARROW_DOWN);
moveDownButton.addClickListener(new MoveDownClickListener());
Button moveTopButton = buttonBar.addButton("Move Top", FontAwesome.ANGLE_DOUBLE_UP);
moveTopButton.addClickListener(new MoveTopClickListener());
Button moveBottomButton = buttonBar.addButton("Move Bottom", FontAwesome.ANGLE_DOUBLE_DOWN);
moveBottomButton.addClickListener(new MoveBottomClickListener());
Button cutButton = buttonBar.addButton("Cut", FontAwesome.CUT);
cutButton.addClickListener(new CutClickListener());
Button pasteButton = buttonBar.addButton("Paste", FontAwesome.PASTE);
pasteButton.addClickListener(new PasteClickListener());
}
buttonBar.addButtonRight("Export", FontAwesome.DOWNLOAD, (e)->export());
table.setContainerDataSource(container);
table.setSelectable(true);
table.setSortEnabled(false);
table.setImmediate(true);
table.setSizeFull();
table.setVisibleColumns(new Object[] { "entityName", "attributeName", "ordinalSetting" });
table.setColumnHeaders(new String[] { "Entity Name", "Attribute Name", "Ordinal" });
table.setCellStyleGenerator(new TableCellStyleGenerator());
table.setEditable(false);
table.setMultiSelect(true);
if (!readOnly) {
table.setDragMode(TableDragMode.MULTIROW);
table.setDropHandler(new TableDropHandler());
}
addComponent(table);
setExpandRatio(table, 1.0f);
Model model = component.getInputModel();
if (model != null) {
model = context.getConfigurationService().findModel(model.getId());
List<RecordFormat> attributes = new ArrayList<RecordFormat>();
for (ModelEntity entity : model.getModelEntities()) {
for (ModelAttrib attr : entity.getModelAttributes()) {
attributes.add(new RecordFormat(entity, attr));
}
}
Collections.sort(attributes, new Comparator<RecordFormat>() {
public int compare(RecordFormat o1, RecordFormat o2) {
return new Integer(o1.getOrdinalSetting()).compareTo(new Integer(o2.getOrdinalSetting()));
}
});
for (RecordFormat recordFormat : attributes) {
table.addItem(recordFormat);
}
}
calculatePositions();
saveOrdinalSettings();
}
示例9: buildUI
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
protected void buildUI() {
ButtonBar buttonBar = new ButtonBar();
if (!readOnly) {
addComponent(buttonBar);
Button moveUpButton = buttonBar.addButton("Move Up", FontAwesome.ARROW_UP);
moveUpButton.addClickListener(new MoveUpClickListener());
Button moveDownButton = buttonBar.addButton("Move Down", FontAwesome.ARROW_DOWN);
moveDownButton.addClickListener(new MoveDownClickListener());
Button moveTopButton = buttonBar.addButton("Move Top", FontAwesome.ANGLE_DOUBLE_UP);
moveTopButton.addClickListener(new MoveTopClickListener());
Button moveBottomButton = buttonBar.addButton("Move Bottom", FontAwesome.ANGLE_DOUBLE_DOWN);
moveBottomButton.addClickListener(new MoveBottomClickListener());
Button cutButton = buttonBar.addButton("Cut", FontAwesome.CUT);
cutButton.addClickListener(new CutClickListener());
Button pasteButton = buttonBar.addButton("Paste", FontAwesome.PASTE);
pasteButton.addClickListener(new PasteClickListener());
}
buttonBar.addButtonRight("Export", FontAwesome.DOWNLOAD, (e)->export());
table.setContainerDataSource(container);
table.setSelectable(true);
table.setSortEnabled(false);
table.setImmediate(true);
table.setSizeFull();
if (component.getType().equals(FixedLengthFormatter.TYPE) || component.getType().equals(FixedLengthParser.TYPE)) {
table.setVisibleColumns(new Object[] { "entityName", "attributeName", "width", "startPos", "endPos", "transformText" });
table.setColumnHeaders(new String[] { "Entity Name", "Attribute Name", "Width", "Start Position", "End Position", "Transform" });
table.setColumnWidth("width", 75);
} else {
table.setVisibleColumns(new Object[] { "entityName", "attributeName", "ordinalSetting", "transformText" });
table.setColumnHeaders(new String[] { "Entity Name", "Attribute Name", "Ordinal", "Transform" });
}
table.setTableFieldFactory(new EditFieldFactory());
table.setCellStyleGenerator(new TableCellStyleGenerator());
table.setEditable(true);
table.setMultiSelect(true);
if (!readOnly) {
table.setDragMode(TableDragMode.MULTIROW);
table.setDropHandler(new TableDropHandler());
}
addComponent(table);
setExpandRatio(table, 1.0f);
Model model = component.getInputModel();
if (component.getType().equals(DelimitedParser.TYPE) || component.getType().equals(FixedLengthParser.TYPE)) {
model = component.getOutputModel();
}
if (model != null) {
model = context.getConfigurationService().findModel(model.getId());
List<RecordFormat> attributes = new ArrayList<RecordFormat>();
for (ModelEntity entity : model.getModelEntities()) {
for (ModelAttrib attr : entity.getModelAttributes()) {
attributes.add(new RecordFormat(entity, attr));
}
}
Collections.sort(attributes, new Comparator<RecordFormat>() {
public int compare(RecordFormat o1, RecordFormat o2) {
return new Integer(o1.getOrdinalSetting()).compareTo(new Integer(o2.getOrdinalSetting()));
}
});
for (RecordFormat recordFormat : attributes) {
table.addItem(recordFormat);
}
}
calculatePositions();
saveOrdinalSettings();
saveLengthSettings();
saveTransformSettings();
}
示例10: setDragMode
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
public void setDragMode(TableDragMode mode)
{
selectableTable.setDragMode(mode);
}
示例11: setDragMode
import com.vaadin.ui.Table.TableDragMode; //导入依赖的package包/类
public void setDragMode(TableDragMode row);