本文整理了Java中org.eclipse.swt.widgets.Table.getData()
方法的一些代码示例,展示了Table.getData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getData()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getData
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private int getFixedColumns() {
Object fixedColumns = getData( RWT.FIXED_COLUMNS );
if( fixedColumns instanceof Integer ) {
if( !( getData( RWT.ROW_TEMPLATE ) instanceof Template ) ) {
return ( ( Integer )fixedColumns ).intValue();
}
}
return -1;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
static Boolean alwaysHideSelection( final Table table ) {
Boolean result = Boolean.FALSE;
Object data = table.getData( Table.ALWAYS_HIDE_SELECTION );
if( Boolean.TRUE.equals( data ) ) {
result = Boolean.TRUE;
}
return result;
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
static boolean hasAlwaysHideSelection( Table table ) {
Object data = table.getData( Table.ALWAYS_HIDE_SELECTION );
return Boolean.TRUE.equals( data );
}
代码示例来源:origin: org.xworker/xworker_swt
public static void goPreMonthButtonAction(ActionContext actionContext){
Table dateTable = (Table) actionContext.get("dateTable");
GregorianCalendar calendar = new GregorianCalendar();
Date date = (Date) dateTable.getData();
calendar.setTime(date);
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1);
((ActionContainer) actionContext.get("actions")).doAction("initDateTable", actionContext, UtilMap.toParams(new Object[]{"date", calendar.getTime()}));
}
代码示例来源:origin: org.xworker/xworker_swt
public static void goNextMonthButtonAction(ActionContext actionContext){
Table dateTable = (Table) actionContext.get("dateTable");
ActionContainer actions = (ActionContainer) actionContext.get("actions");
GregorianCalendar calendar = new GregorianCalendar();
Date date = (Date) dateTable.getData();
calendar.setTime(date);
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + 1);
actions.doAction("initDateTable", actionContext, UtilMap.toParams(new Object[]{"date", calendar.getTime()}));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
private File getTargetFile(DropTargetEvent event) {
// Determine the target File for the drop
TableItem item = table.getItem(table.toControl(new Point(event.x, event.y)));
File targetFile = null;
if (item == null) {
// We are over an unoccupied area of the table.
// If it is a COPY, we can use the table's root file.
if (event.detail == DND.DROP_COPY) {
targetFile = (File) table.getData(TABLEDATA_DIR);
}
} else {
// We are over a particular item in the table, use the item's file
targetFile = (File) item.getData(TABLEITEMDATA_FILE);
}
return targetFile;
}
});
代码示例来源:origin: org.xworker/xworker_swt
public static void yearMonthModify(ActionContext actionContext){
Spinner yearText = (Spinner) actionContext.get("yearText");
ActionContainer actions = (ActionContainer) actionContext.get("actions");
if(actionContext.get("init") != null && (Boolean) actionContext.get("init") == true || "".equals(yearText.getText())){
return;
}
Combo monthCombo = (Combo) actionContext.get("monthCombo");
int year = Integer.parseInt(yearText.getText());
int month = monthCombo.getSelectionIndex();
GregorianCalendar calendar = new GregorianCalendar();
Table dateTable = (Table) actionContext.get("dateTable");
Date date = (Date) dateTable.getData();
calendar.setTime(date);
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month);
actions.doAction("initDateTable", actionContext, UtilMap.toParams(new Object[]{"date", calendar.getTime(), "setTextData", false}));
}
代码示例来源:origin: org.xworker/xworker_swt
public static void tabelSelectionAction(ActionContext actionContext){
Event event = (Event) actionContext.get("event");
if(!(event.item instanceof TableItem)){
return;
}
TableItem item = (TableItem) event.item;
Table table = item.getParent();
Thing store = (Thing) table.getData("_store");
Object record = event.item.getData();
store.put("currentRecord", record);
}
}
代码示例来源:origin: org.xworker/xworker_swt
int[][] itemMonths = (int[][]) dateTable.getData("itemMonths");
int addMonth = itemMonths[rowIndex][column];
int day = Integer.parseInt(row.getText(column));
Date date = (Date) dateTable.getData();
calendar.setTime(date);
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + addMonth);
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Returns the model's TableRow to the given TableItem.
* @param uiTableItem
* @return TableRow for the given TableItem
* @since version_number
* @author S3460
*/
static TableRow row2Item(TableItem uiTableItem){
Table table = uiTableItem.getParent();
int swtIndex = table.indexOf(uiTableItem);
TableUIDelegateClient uiDelegate = (TableUIDelegateClient) table.getData();
int modelIndex = uiDelegate.swtIndex2ModelIndex(swtIndex);
return uiDelegate.wModel_.getRow(modelIndex);
}
代码示例来源:origin: org.xworker/xworker_swt
TableItem item = (TableItem) actionContext.get("item");
Map<String, Object> record = (Map<String, Object>) item.getData();
List<Thing> columns = (List<Thing>) item.getParent().getData("_columns");
代码示例来源:origin: BiglySoftware/BiglyBT
/**
* Bottom Index may be negative. Returns bottom index even if invisible.
* <p>
* Used by rssfeed
*/
public static int getTableBottomIndex(Table table, int iTopIndex) {
// Shortcut: if lastBottomIndex is present, assume it's accurate
Object lastBottomIndex = table.getData("lastBottomIndex");
if (lastBottomIndex instanceof Number) {
return ((Number)lastBottomIndex).intValue();
}
int columnCount = table.getColumnCount();
if (columnCount == 0) {
return -1;
}
int xPos = table.getColumn(0).getWidth() - 1;
if (columnCount > 1) {
xPos += table.getColumn(1).getWidth();
}
Rectangle clientArea = table.getClientArea();
TableItem bottomItem = table.getItem(new Point(xPos,
clientArea.y + clientArea.height - 2));
if (bottomItem != null) {
return table.indexOf(bottomItem);
}
return table.getItemCount() - 1;
}
代码示例来源:origin: org.xworker/xworker_swt
List<Thing> columns = (List<Thing>) item.getParent().getData("_columns");
Thing store = (Thing) item.getParent().getData("_store");
int column = (Integer) actionContext.get("column");
Thing columnAttr = columns.get(column);
代码示例来源:origin: org.xworker/xworker_swt
Control tableCursor = (Control) table.getData("tableCursor");
if(tableCursor != null){
tableCursor.dispose();
Listener tableCursorListener = (Listener) table.getData("tableCursorListener");
if(tableCursorListener != null){
table.removeListener(SWT.Selection, tableCursorListener);
代码示例来源:origin: org.xworker/xworker_swt
public static void tableEditAction(ActionContext actionContext){
Event event = (Event) actionContext.get("event");
World world = World.getInstance();
//表格中的行
TableItem item = (TableItem) event.item;
Table table = item.getParent();
//创建编辑窗体
ActionContext ac = new ActionContext();
Thing store = (Thing) table.getData("_store");
ac.put("store", store);
ac.put("parent", table.getShell());
Thing editorThing = world.getThing("xworker.app.view.swt.widgets.table.DataObjectGridRowEditor/@shell");
editorThing.doAction("create", ac);
((Thing) ac.get("form")).doAction("setDataObject", ac, UtilMap.toMap("dataObject", item.getData()));
Shell shell = (Shell) ac.get("shell");
shell.pack();
SwtUtils.centerShell(shell);
shell.open();
}
内容来源于网络,如有侵权,请联系作者删除!