Java Code Examples for com.google.gwt.core.client.Scheduler#ScheduledCommand

The following examples show how to use com.google.gwt.core.client.Scheduler#ScheduledCommand . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void requestRebuildList() {
  if (rebuild != null) {
    return;
  }

  rebuild = new Scheduler.ScheduledCommand() {
    @Override
    public void execute() {
      arrayString.setLength(0);
      for (String s : translationMap.keySet()) {
        arrayString.push(s);
      }
      sort();
      // Refresh the list by repeating the search
      doSearch(true);
      rebuild = null;
    }
  };
  Scheduler.get().scheduleDeferred(rebuild);
}
 
Example 2
private void prepareSecurityContext(Scheduler.ScheduledCommand andThen) {
    // creates an empty (always true) security context for the bootstrap steps
    /*securityFramework.createSecurityContext(null, Collections.<String>emptySet(), false,
            new AsyncCallback<SecurityContext>() {
                @Override
                public void onFailure(Throwable caught) {
                    andThen.execute();
                }

                @Override
                public void onSuccess(SecurityContext result) {
                    andThen.execute();
                }
            });*/
    andThen.execute();
}
 
Example 3
Source Project: cuba   File: CubaGridWidget.java    License: Apache License 2.0 5 votes vote down vote up
protected Scheduler.ScheduledCommand getSelectAllCommand() {
    return () -> {
        for (Column column : getColumns()) {
            if (column.isHidden()) {
                column.setHidden(false);
            }
        }
    };
}
 
Example 4
Source Project: cuba   File: CubaGridWidget.java    License: Apache License 2.0 5 votes vote down vote up
protected Scheduler.ScheduledCommand getDeselectAllCommand() {
    return () -> {
        for (Column column : getColumns()) {
            if (column.isHidable() && !column.isHidden()) {
                column.setHidden(true);
            }
        }
    };
}
 
Example 5
Source Project: cuba   File: SuggestionsContainer.java    License: Apache License 2.0 5 votes vote down vote up
protected void performItemCommand(final SuggestionItem item) {
    selectedItem = item;

    Scheduler.ScheduledCommand cmd = item.getScheduledCommand();
    if (cmd != null) {
        FocusImpl.getFocusImplForPanel().blur(getElement());

        Scheduler.get().scheduleFinally(cmd);
    }
}
 
Example 6
Source Project: cuba   File: CubaTreeGridWidget.java    License: Apache License 2.0 5 votes vote down vote up
protected Scheduler.ScheduledCommand getSelectAllCommand() {
    return () -> {
        for (Column column : getColumns()) {
            if (column.isHidden()) {
                column.setHidden(false);
            }
        }
    };
}
 
Example 7
Source Project: cuba   File: CubaTreeGridWidget.java    License: Apache License 2.0 5 votes vote down vote up
protected Scheduler.ScheduledCommand getDeselectAllCommand() {
    return () -> {
        for (Column column : getColumns()) {
            if (column.isHidable() && !column.isHidden()) {
                column.setHidden(true);
            }
        }
    };
}
 
Example 8
public void verifyConnection(final DataSource dataSource, boolean xa, boolean existing,
        Scheduler.ScheduledCommand onCreated) {
    VerifyConnectionOp vop = new VerifyConnectionOp(dataSourceStore, dispatcher, beanFactory,
            currentProfileSelection.getName());
    vop.execute(dataSource, xa, existing, new SimpleCallback<VerifyConnectionOp.VerifyResult>() {
        @Override
        public void onSuccess(final VerifyConnectionOp.VerifyResult result) {
            getView().showVerifyConncectionResult(dataSource.getName(), result);
            if (result.wasCreated() && onCreated != null) {
                Scheduler.get().scheduleDeferred(onCreated);
            }
        }
    });
}
 
Example 9
private void setAssociatedWidgetSize(double size) {
    double maxSize = getMaxSize();
    if (size > maxSize) {
        size = maxSize;
    }

    if (snapClosedSize > 0 && size < snapClosedSize) {
        size = 0;
    } else if (size < minSize) {
        size = minSize;
    }

    LayoutData layout = (LayoutData) target.getLayoutData();
    if (size == layout.size) {
        return;
    }

    // Adjust our view until the deferred layout gets scheduled.
    centerSize += layout.size - size;
    layout.size = size;

    // Defer actually updating the layout, so that if we receive many
    // mouse events before layout/paint occurs, we'll only update once.
    if (layoutCommand == null) {
        layoutCommand = new Scheduler.ScheduledCommand() {
            @Override
            public void execute() {
                layoutCommand = null;
                forceLayout();
            }
        };
        Scheduler.get().scheduleDeferred(layoutCommand);
    }
}
 
Example 10
private void setAssociatedWidgetSize(double size) {
    double maxSize = getMaxSize();
    if (size > maxSize) {
        size = maxSize;
    }

    if (snapClosedSize > 0 && size < snapClosedSize) {
        size = 0;
    } else if (size < minSize) {
        size = minSize;
    }

    LayoutData layout = (LayoutData) target.getLayoutData();
    if (size == layout.size) {
        return;
    }

    // Adjust our view until the deferred layout gets scheduled.
    centerSize += layout.size - size;
    layout.size = size;

    // Defer actually updating the layout, so that if we receive many
    // mouse events before layout/paint occurs, we'll only update once.
    if (layoutCommand == null) {
        layoutCommand = new Scheduler.ScheduledCommand() {
            @Override
            public void execute() {
                layoutCommand = null;
                forceLayout();
            }
        };
        Scheduler.get().scheduleDeferred(layoutCommand);
    }
}
 
Example 11
Source Project: cuba   File: SuggestionItem.java    License: Apache License 2.0 4 votes vote down vote up
public Scheduler.ScheduledCommand getScheduledCommand() {
    return cmd;
}
 
Example 12
Source Project: cuba   File: SuggestionItem.java    License: Apache License 2.0 4 votes vote down vote up
public void setScheduledCommand(Scheduler.ScheduledCommand cmd) {
    this.cmd = cmd;
}
 
Example 13
Source Project: consulo   File: GwtMenuImpl.java    License: Apache License 2.0 4 votes vote down vote up
public GwtMenuImpl() {
  myMenu = new MenuItem("", (Scheduler.ScheduledCommand)null);
}
 
Example 14
public BrowseByItem(final String title, final ExternalTextResource preview,
        final Scheduler.ScheduledCommand onSelect) {
    this.title = title;
    this.preview = preview;
    this.onSelect = onSelect;
}
 
Example 15
public Scheduler.ScheduledCommand onSelect() {
    return onSelect;
}
 
Example 16
void verifyConnection(Scheduler.ScheduledCommand onCreated) {
    presenter.verifyConnection(context.dataSource(), context.xa, context.dataSourceCreatedByTest, onCreated);
}
 
Example 17
public BrowseByItem(final String title, final ExternalTextResource preview,
        final Scheduler.ScheduledCommand onSelect) {
    this.title = title;
    this.preview = preview;
    this.onSelect = onSelect;
}
 
Example 18
public Scheduler.ScheduledCommand onSelect() {
    return onSelect;
}