Example usage for com.google.gwt.user.client Timer Timer

List of usage examples for com.google.gwt.user.client Timer Timer

Introduction

In this page you can find the example usage for com.google.gwt.user.client Timer Timer.

Prototype

Timer

Source Link

Usage

From source file:com.ephesoft.gxt.core.client.ui.widget.ComboBox.java

License:Open Source License

@Override
public void focus() {
    Timer timer = new Timer() {

        @Override/*  www  .  j av  a  2s.  co m*/
        public void run() {
            scheduleFocus();
        }
    };
    timer.schedule(50);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.ExternalDialogApp.java

License:Open Source License

/**
 * Instantiates a new external dialog app.
 *
 * @param urlToOpen the url to open//  w w w. ja  va 2 s . c o m
 */
public ExternalDialogApp(String urlToOpen) {
    externalAppFrame = new Frame();
    this.setClosable(true);
    if (!StringUtil.isNullOrEmpty(urlToOpen)) {
        this.setWidget(externalAppFrame);
        externalAppFrame.setUrl(urlToOpen);
        WidgetUtil.setID(this, urlToOpen);
        this.setSize("550", "500");
        Timer timer = new Timer() {

            @Override
            public void run() {
                ExternalDialogApp.this.center();
            }
        };
        timer.schedule(10);
    }
    this.setPredefinedButtons(PredefinedButton.CLOSE);
    externalAppFrame.addStyleName("externalAppFrame");
}

From source file:com.ephesoft.gxt.core.client.ui.widget.Grid.java

License:Open Source License

private void validateDirtyCell(final int row, final int column) {
    // Issue with Sencha's library firing complete edit 2 times on Selection.
    Timer timer = new Timer() {

        @Override// w w w  .j  av a  2 s .c  o  m
        public void run() {
            com.sencha.gxt.widget.core.client.grid.Grid.GridCell activeCell = editingGrid.getActiveCell();
            if (!editingGrid.isEditing()
                    || !(activeCell != null && activeCell.getRow() == row && activeCell.getCol() == column)) {
                if (row >= 0 && column >= 0) {
                    T model = store.get(row);
                    ValueProvider valueProvider = cm.getValueProvider(column);
                    Set<T> invalidModelsSet = forcefullyInValidModels.get(valueProvider);
                    if (null != invalidModelsSet) {
                        Element cellElement = gridView.getCell(row, column);
                        if (null != cellElement) {
                            cellElement.addClassName("styleName");
                        }
                        invalidModelsSet.add(model);
                    }
                }
            }
        }
    };
    timer.schedule(5);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.Grid.java

License:Open Source License

@Override
protected void onAttach() {
    super.onAttach();
    Timer timer = new Timer() {

        @Override/* w  w w  .  j av a 2s . co  m*/
        public void run() {
            setGridDimension(resizablePanel, 0.9999f, 0.9999f);
        }
    };
    timer.schedule(80);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.Grid.java

License:Open Source License

private void addFilterHeader() {
    Timer timer = new Timer() {

        @Override/*  w ww  . ja  v a 2s  . c om*/
        public void run() {
            if (!CollectionUtil.isEmpty(filtersList)) {
                for (final Filter<T, ?> gridFilter : filtersList) {
                    if (null != gridFilter) {
                        ValueProvider<? super T, ?> valueProvider = gridFilter.getValueProvider();
                        if (null != valueProvider) {
                            int columnIndex = getColumnIndex(valueProvider);
                            if (columnIndex != -1) {
                                ColumnHeader<T> header = view.getHeader();
                                if (null != header) {
                                    header.getHead(columnIndex).addStyleName(COLUMN_HEADER);
                                }
                            }
                        }
                    }
                }
            }
        }
    };
    timer.schedule(100);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.Grid.java

License:Open Source License

public void startEditing(final GridCell cell) {
    if (editingGrid != null && cell != null) {

        Timer timer = new Timer() {

            @Override//from  w w w. j  a v  a  2  s  .  co  m
            public void run() {
                editingGrid.startEditing(cell);
            }
        };
        timer.schedule(300);
    }
}

From source file:com.ephesoft.gxt.core.client.ui.widget.Grid.java

License:Open Source License

public void startEditing(final int rowIndex) {
    Timer timer = new Timer() {

        @Override/*from  w ww .  j  av  a2  s  .c  om*/
        public void run() {
            if (null != editingGrid) {
                int totalColumn = cm.getColumnCount();
                for (int index = 0; index < totalColumn; index++) {
                    ColumnConfig<T, ?> columnConfig = cm.getColumn(index);
                    if (null != columnConfig && editingGrid.getEditor(columnConfig) != null) {
                        GridCell cell = new GridCell(rowIndex, index);
                        editingGrid.startEditing(cell);
                        break;
                    }
                }
            }
        }
    };
    timer.schedule(EDITING_DELAY);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.MultiFileUploader.java

License:Open Source License

@Override
protected void onLoad() {
    super.onLoad();
    initializeDimensions(200);// w  ww .  j  ava2  s.  c  om

    Timer timer = new Timer() {

        @Override
        public void run() {
            layoutTimer.scheduleRepeating(800);
        }
    };
    timer.schedule(5000);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.MultiFileUploader.java

License:Open Source License

private void initializeDimensions(final int timeInMillis) {
    final Widget parent = this.getParent();
    layoutTimer = new Timer() {

        @Override/*from w w w  .  j  a  v a2 s.  c om*/
        public void run() {
            setDimension(parent);
        }
    };
    setDimension(parent);
    layoutTimer.schedule(timeInMillis);
}

From source file:com.ephesoft.gxt.core.client.ui.widget.MultiFileUploader.java

License:Open Source License

private void initializeTimer() {
    timer = new Timer() {

        @Override//  ww  w  . j  a  v a  2 s  .c om
        public void run() {
            double filesCompletionPercentage = 0;
            if (totalFilesQueued > 0) {
                filesCompletionPercentage = (totalFilesCompleted * 1.0 + currentFileUploadRatio)
                        / totalFilesQueued;
            }
            uploadProgress.updateProgress(filesCompletionPercentage, "{0}% Completed");
        }
    };
}