org.eclipse.swt.widgets.Table.getData()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(343)

本文整理了Java中org.eclipse.swt.widgets.Table.getData()方法的一些代码示例,展示了Table.getData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getData()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getData

Table.getData介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

  1. private int getFixedColumns() {
  2. Object fixedColumns = getData( RWT.FIXED_COLUMNS );
  3. if( fixedColumns instanceof Integer ) {
  4. if( !( getData( RWT.ROW_TEMPLATE ) instanceof Template ) ) {
  5. return ( ( Integer )fixedColumns ).intValue();
  6. }
  7. }
  8. return -1;
  9. }

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

  1. static Boolean alwaysHideSelection( final Table table ) {
  2. Boolean result = Boolean.FALSE;
  3. Object data = table.getData( Table.ALWAYS_HIDE_SELECTION );
  4. if( Boolean.TRUE.equals( data ) ) {
  5. result = Boolean.TRUE;
  6. }
  7. return result;
  8. }
  9. }

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

  1. static boolean hasAlwaysHideSelection( Table table ) {
  2. Object data = table.getData( Table.ALWAYS_HIDE_SELECTION );
  3. return Boolean.TRUE.equals( data );
  4. }

代码示例来源:origin: org.xworker/xworker_swt

  1. public static void goPreMonthButtonAction(ActionContext actionContext){
  2. Table dateTable = (Table) actionContext.get("dateTable");
  3. GregorianCalendar calendar = new GregorianCalendar();
  4. Date date = (Date) dateTable.getData();
  5. calendar.setTime(date);
  6. calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1);
  7. ((ActionContainer) actionContext.get("actions")).doAction("initDateTable", actionContext, UtilMap.toParams(new Object[]{"date", calendar.getTime()}));
  8. }

代码示例来源:origin: org.xworker/xworker_swt

  1. public static void goNextMonthButtonAction(ActionContext actionContext){
  2. Table dateTable = (Table) actionContext.get("dateTable");
  3. ActionContainer actions = (ActionContainer) actionContext.get("actions");
  4. GregorianCalendar calendar = new GregorianCalendar();
  5. Date date = (Date) dateTable.getData();
  6. calendar.setTime(date);
  7. calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + 1);
  8. actions.doAction("initDateTable", actionContext, UtilMap.toParams(new Object[]{"date", calendar.getTime()}));
  9. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

  1. private File getTargetFile(DropTargetEvent event) {
  2. // Determine the target File for the drop
  3. TableItem item = table.getItem(table.toControl(new Point(event.x, event.y)));
  4. File targetFile = null;
  5. if (item == null) {
  6. // We are over an unoccupied area of the table.
  7. // If it is a COPY, we can use the table's root file.
  8. if (event.detail == DND.DROP_COPY) {
  9. targetFile = (File) table.getData(TABLEDATA_DIR);
  10. }
  11. } else {
  12. // We are over a particular item in the table, use the item's file
  13. targetFile = (File) item.getData(TABLEITEMDATA_FILE);
  14. }
  15. return targetFile;
  16. }
  17. });

代码示例来源:origin: org.xworker/xworker_swt

  1. public static void yearMonthModify(ActionContext actionContext){
  2. Spinner yearText = (Spinner) actionContext.get("yearText");
  3. ActionContainer actions = (ActionContainer) actionContext.get("actions");
  4. if(actionContext.get("init") != null && (Boolean) actionContext.get("init") == true || "".equals(yearText.getText())){
  5. return;
  6. }
  7. Combo monthCombo = (Combo) actionContext.get("monthCombo");
  8. int year = Integer.parseInt(yearText.getText());
  9. int month = monthCombo.getSelectionIndex();
  10. GregorianCalendar calendar = new GregorianCalendar();
  11. Table dateTable = (Table) actionContext.get("dateTable");
  12. Date date = (Date) dateTable.getData();
  13. calendar.setTime(date);
  14. calendar.set(Calendar.YEAR, year);
  15. calendar.set(Calendar.MONTH, month);
  16. actions.doAction("initDateTable", actionContext, UtilMap.toParams(new Object[]{"date", calendar.getTime(), "setTextData", false}));
  17. }

代码示例来源:origin: org.xworker/xworker_swt

  1. public static void tabelSelectionAction(ActionContext actionContext){
  2. Event event = (Event) actionContext.get("event");
  3. if(!(event.item instanceof TableItem)){
  4. return;
  5. }
  6. TableItem item = (TableItem) event.item;
  7. Table table = item.getParent();
  8. Thing store = (Thing) table.getData("_store");
  9. Object record = event.item.getData();
  10. store.put("currentRecord", record);
  11. }
  12. }

代码示例来源:origin: org.xworker/xworker_swt

  1. int[][] itemMonths = (int[][]) dateTable.getData("itemMonths");
  2. int addMonth = itemMonths[rowIndex][column];
  3. int day = Integer.parseInt(row.getText(column));
  4. Date date = (Date) dateTable.getData();
  5. calendar.setTime(date);
  6. calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + addMonth);

代码示例来源:origin: org.codehaus.openxma/xmartclient

  1. /**
  2. * Returns the model's TableRow to the given TableItem.
  3. * @param uiTableItem
  4. * @return TableRow for the given TableItem
  5. * @since version_number
  6. * @author S3460
  7. */
  8. static TableRow row2Item(TableItem uiTableItem){
  9. Table table = uiTableItem.getParent();
  10. int swtIndex = table.indexOf(uiTableItem);
  11. TableUIDelegateClient uiDelegate = (TableUIDelegateClient) table.getData();
  12. int modelIndex = uiDelegate.swtIndex2ModelIndex(swtIndex);
  13. return uiDelegate.wModel_.getRow(modelIndex);
  14. }

代码示例来源:origin: org.xworker/xworker_swt

  1. TableItem item = (TableItem) actionContext.get("item");
  2. Map<String, Object> record = (Map<String, Object>) item.getData();
  3. List<Thing> columns = (List<Thing>) item.getParent().getData("_columns");

代码示例来源:origin: BiglySoftware/BiglyBT

  1. /**
  2. * Bottom Index may be negative. Returns bottom index even if invisible.
  3. * <p>
  4. * Used by rssfeed
  5. */
  6. public static int getTableBottomIndex(Table table, int iTopIndex) {
  7. // Shortcut: if lastBottomIndex is present, assume it's accurate
  8. Object lastBottomIndex = table.getData("lastBottomIndex");
  9. if (lastBottomIndex instanceof Number) {
  10. return ((Number)lastBottomIndex).intValue();
  11. }
  12. int columnCount = table.getColumnCount();
  13. if (columnCount == 0) {
  14. return -1;
  15. }
  16. int xPos = table.getColumn(0).getWidth() - 1;
  17. if (columnCount > 1) {
  18. xPos += table.getColumn(1).getWidth();
  19. }
  20. Rectangle clientArea = table.getClientArea();
  21. TableItem bottomItem = table.getItem(new Point(xPos,
  22. clientArea.y + clientArea.height - 2));
  23. if (bottomItem != null) {
  24. return table.indexOf(bottomItem);
  25. }
  26. return table.getItemCount() - 1;
  27. }

代码示例来源:origin: org.xworker/xworker_swt

  1. List<Thing> columns = (List<Thing>) item.getParent().getData("_columns");
  2. Thing store = (Thing) item.getParent().getData("_store");
  3. int column = (Integer) actionContext.get("column");
  4. Thing columnAttr = columns.get(column);

代码示例来源:origin: org.xworker/xworker_swt

  1. Control tableCursor = (Control) table.getData("tableCursor");
  2. if(tableCursor != null){
  3. tableCursor.dispose();
  4. Listener tableCursorListener = (Listener) table.getData("tableCursorListener");
  5. if(tableCursorListener != null){
  6. table.removeListener(SWT.Selection, tableCursorListener);

代码示例来源:origin: org.xworker/xworker_swt

  1. public static void tableEditAction(ActionContext actionContext){
  2. Event event = (Event) actionContext.get("event");
  3. World world = World.getInstance();
  4. //表格中的行
  5. TableItem item = (TableItem) event.item;
  6. Table table = item.getParent();
  7. //创建编辑窗体
  8. ActionContext ac = new ActionContext();
  9. Thing store = (Thing) table.getData("_store");
  10. ac.put("store", store);
  11. ac.put("parent", table.getShell());
  12. Thing editorThing = world.getThing("xworker.app.view.swt.widgets.table.DataObjectGridRowEditor/@shell");
  13. editorThing.doAction("create", ac);
  14. ((Thing) ac.get("form")).doAction("setDataObject", ac, UtilMap.toMap("dataObject", item.getData()));
  15. Shell shell = (Shell) ac.get("shell");
  16. shell.pack();
  17. SwtUtils.centerShell(shell);
  18. shell.open();
  19. }

相关文章

Table类方法