Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.TableCursor


       
        // Set redraw back to true so that the table
        // will paint appropriately
        table.setRedraw(true);
//
        tableCursor = new TableCursor(table, SWT.NONE);
        tableCursor.setBackground(Display.getCurrent()
                .getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));

        int index = Integer.parseInt(characterCode, 16);
        int row = index / COLUMNS - 4;
View Full Code Here


private void makeTableCells(Composite shell) {
  databaseCells = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
  databaseCells.setHeaderVisible(true);
  databaseCells.setLinesVisible(true);
 
  cursor = new TableCursor(databaseCells, SWT.NONE);
  cursor.addSelectionListener(new SelectionListener() {
    // see
    // http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/TableCursor.html
    public void widgetDefaultSelected(SelectionEvent e) {
    }
View Full Code Here

            TableItem item = new TableItem(table, SWT.NONE);
            item.setText(0, "");
            item.setText(1, "");
        }

        final TableCursor cursor = new TableCursor(table, SWT.NONE);

        final ControlEditor editor = new ControlEditor(cursor);
        editor.grabHorizontal = true;
        editor.grabVertical = true;

        cursor.addMouseListener(new MouseAdapter() {
            public void mouseDoubleClick(MouseEvent arg0) {
                if (cursor.getColumn() == 1) {
                    final Text text = new Text(cursor, SWT.NONE);
                    text.setFocus();

                    text.setText(cursor.getRow().getText(cursor.getColumn()));
                    text.setFocus();

                    text.addFocusListener(new FocusListener() {
                        public void focusLost(FocusEvent event) {
                            cursor.getRow().setText(cursor.getColumn(), text.getText());
                            text.dispose();
                        }

                        public void focusGained(FocusEvent arg0) {
                        }
                    });

                    text.addKeyListener(new KeyAdapter() {
                        public void keyPressed(KeyEvent event) {
                            switch (event.keyCode) {
                                case SWT.CR:
                                    cursor.getRow().setText(cursor.getColumn(), text.getText());
                                case SWT.ESC:
                                    text.dispose();
                                    break;
                            }
                        }
                    });

                    editor.setEditor(text);
                }
            }
        });

        cursor.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent event) {
                table.setSelection(new TableItem[] { cursor.getRow() });
            }

            public void widgetDefaultSelected(SelectionEvent event) {
                if (cursor.getColumn() == 1) {
                    final Text text = new Text(cursor, SWT.NONE);
                    text.setFocus();

                    text.setText(cursor.getRow().getText(cursor.getColumn()));
                    text.setFocus();

                    text.addKeyListener(new KeyAdapter() {
                        public void keyPressed(KeyEvent event) {
                            switch (event.keyCode) {
                                case SWT.CR:
                                    cursor.getRow().setText(cursor.getColumn(), text.getText());
                                case SWT.ESC:
                                    text.dispose();
                                    break;
                            }
                        }
                    });

                    text.addFocusListener(new FocusListener() {
                        public void focusLost(FocusEvent event) {
                            cursor.getRow().setText(cursor.getColumn(), text.getText());
                            text.dispose();
                        }

                        public void focusGained(FocusEvent arg0) {
                        }
View Full Code Here

    paymentTable = new Table(composite, SWT.BORDER | SWT.SINGLE);
    paymentTable.setLinesVisible(true);
    paymentTable.setHeaderVisible(true);

    final TableCursor cursor = new TableCursor(paymentTable, SWT.NONE);

    final ControlEditor editor = new ControlEditor(cursor);
    editor.grabHorizontal = true;
    editor.grabVertical = true;
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.TableCursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.