Search in sources :

Example 6 with TableRowElement

use of com.google.gwt.dom.client.TableRowElement in project drools-wb by kiegroup.

the class TemplateDataHeaderWidget method setCursorType.

// Set the cursor type for all cells on the table as
// we only use rowHeader[0] to check which column
// needs resizing however the mouse could be over any
// row
private void setCursorType(Cursor cursor) {
    for (int iRow = 0; iRow < widget.headerRows.length; iRow++) {
        TableRowElement tre = widget.headerRows[iRow].<TableRowElement>cast();
        for (int iCol = 0; iCol < tre.getCells().getLength(); iCol++) {
            TableCellElement tce = tre.getCells().getItem(iCol);
            tce.getStyle().setCursor(cursor);
        }
    }
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) TableCellElement(com.google.gwt.dom.client.TableCellElement)

Example 7 with TableRowElement

use of com.google.gwt.dom.client.TableRowElement in project gwt-test-utils by gwt-test-utils.

the class GridPatcher method createRow.

private static TableRowElement createRow(int columns, String cellContent) {
    TableRowElement tr = Document.get().createTRElement();
    for (int i = 0; i < columns; i++) {
        TableCellElement cell = Document.get().createTDElement();
        cell.setInnerHTML(cellContent);
        tr.appendChild(cell);
    }
    return tr;
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) TableCellElement(com.google.gwt.dom.client.TableCellElement)

Example 8 with TableRowElement

use of com.google.gwt.dom.client.TableRowElement in project gwt-test-utils by gwt-test-utils.

the class TableSectionElementPatcher method deleteRow.

@PatchMethod
static void deleteRow(TableSectionElement e, int index) {
    NodeList<TableRowElement> rows = e.getRows();
    if (rows.getLength() < 1) {
        return;
    }
    if (index == -1) {
        index = rows.getLength() - 1;
    }
    TableRowElement rowToDelete = rows.getItem(index);
    e.removeChild(rowToDelete);
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) PatchMethod(com.googlecode.gwt.test.patchers.PatchMethod)

Example 9 with TableRowElement

use of com.google.gwt.dom.client.TableRowElement in project rstudio by rstudio.

the class DirectoryContentsWidget method addDirectory.

public void addDirectory(FileSystemItem directory) {
    int rowNum = addItem(directory, null, null);
    TableElement table = (TableElement) table_.getElement().cast();
    TableRowElement row = table.getRows().getItem(rowNum);
    row.scrollIntoView();
    scrollPanel_.setHorizontalScrollPosition(0);
    setSelectedRow(rowNum);
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) Point(org.rstudio.core.client.Point) TableElement(com.google.gwt.dom.client.TableElement)

Example 10 with TableRowElement

use of com.google.gwt.dom.client.TableRowElement in project rstudio by rstudio.

the class ModifyKeyboardShortcutsWidget method updateData.

private void updateData(List<KeyboardShortcutEntry> bindings) {
    dataProvider_.setList(bindings);
    // Loop through and update styling on each row.
    for (int i = 0; i < bindings.size(); i++) {
        KeyboardShortcutEntry binding = bindings.get(i);
        if (binding.isCustomBinding() || binding.isModified()) {
            TableRowElement rowEl = table_.getRowElement(i);
            DomUtils.toggleClass(rowEl, RES.dataGridStyle().customBindingRow(), binding.isCustomBinding());
            DomUtils.toggleClass(rowEl, RES.dataGridStyle().modifiedRow(), binding.isModified());
        }
    }
    // something we could live with.
    for (int i = 0; i < bindings.size(); i++) {
        KeyboardShortcutEntry cb1 = bindings.get(i);
        if (cb1.getKeySequence() == null || cb1.getKeySequence().isEmpty())
            continue;
        for (int j = 0; j < originalBindings_.size(); j++) {
            KeyboardShortcutEntry cb2 = originalBindings_.get(j);
            if (cb1.equals(cb2))
                continue;
            int t1 = cb1.getCommandType();
            int t2 = cb2.getCommandType();
            // 'dynamic' commands as handled with AppCommands
            if (t1 == t2 && cb1.getContext() != cb2.getContext())
                continue;
            KeySequence ks1 = cb1.getKeySequence();
            KeySequence ks2 = cb2.getKeySequence();
            if (ks1 == null || ks2 == null || ks1.isEmpty() || ks2.isEmpty())
                continue;
            boolean hasConflict = ks1.equals(ks2) || ks1.startsWith(ks2, true) || ks2.startsWith(ks1, true);
            if (hasConflict) {
                // editor commands can be masked by AppCommands and addins
                if (t1 == KeyboardShortcutEntry.TYPE_EDITOR_COMMAND && t1 != t2)
                    addMaskedCommandStyles(i, j, cb2);
                else // addins can mask both AppCommands and editor commands
                if (t2 == KeyboardShortcutEntry.TYPE_ADDIN && t1 != t2)
                    addMaskedCommandStyles(i, j, cb2);
                else // two commands with the same binding in the same 'group' == conflict
                if (t1 == t2)
                    addConflictCommandStyles(i, j, cb2);
            }
        }
    }
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) KeySequence(org.rstudio.core.client.command.KeyboardShortcut.KeySequence)

Aggregations

TableRowElement (com.google.gwt.dom.client.TableRowElement)12 TableCellElement (com.google.gwt.dom.client.TableCellElement)6 Element (com.google.gwt.dom.client.Element)2 TableElement (com.google.gwt.dom.client.TableElement)2 Point (org.rstudio.core.client.Point)2 CommitInfo (com.google.gerrit.client.info.ChangeInfo.CommitInfo)1 EventTarget (com.google.gwt.dom.client.EventTarget)1 NativeEvent (com.google.gwt.dom.client.NativeEvent)1 TableSectionElement (com.google.gwt.dom.client.TableSectionElement)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 CopyableLabel (com.google.gwtexpui.clippy.client.CopyableLabel)1 PatchMethod (com.googlecode.gwt.test.patchers.PatchMethod)1 KeySequence (org.rstudio.core.client.command.KeyboardShortcut.KeySequence)1