Java Code Examples for com.google.gwt.user.client.Window.addResizeHandler()

The following are Jave code examples for showing how to use addResizeHandler() of the com.google.gwt.user.client.Window class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: optashift-employee-rostering   File: TemplateEditor.java   View Source Code Vote up 6 votes
@PostConstruct
protected void initWidget() {
    templateFetchable = new TenantTemplateFetchable(() -> getTenantId());
    calendar = new Calendar.Builder<SpotId, ShiftData, ShiftDrawable>(container, tenantId, CONSTANTS)
            .fetchingDataFrom(templateFetchable)
            .fetchingGroupsFrom(new SpotNameFetchable(() -> getTenantId()))
            .displayWeekAs(DateDisplay.WEEKS_FROM_EPOCH)
            .withBeanManager(beanManager)
            .creatingDataInstancesWith((c, name, start, end) -> {
                Shift newShift = new Shift(tenantId,
                        name.getSpot(),
                        new TimeSlot(tenantId,
                                start,
                                end));
                newShift.setId(templateFetchable.getFreshId());
                c
                        .addShift(new ShiftData(new SpotData(newShift)));
            })
            .asTwoDayView((v, d, i) -> new ShiftDrawable(v, d, i));
    calendar.setHardStartDateBound(LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC));
    Window.addResizeHandler((e) -> calendar.setViewSize(e.getWidth() - container.getAbsoluteLeft(),
            e.getHeight() - container.getAbsoluteTop() - saveButton.getOffsetHeight()));
}
 
Example 2
Project: unitimes   File: FilterBox.java   View Source Code Vote up 5 votes
@Override
protected void onAttach() {
	super.onAttach();
	resizeFilterIfNeeded();
	iResizeHandler = Window.addResizeHandler(new ResizeHandler() {
		@Override
		public void onResize(ResizeEvent event) {
			resizeFilterIfNeeded();
		}
	});
}
 
Example 3
Project: optashift-employee-rostering   File: EmployeeRosterViewPanel.java   View Source Code Vote up 5 votes
private void initTable() {
    calendar = new Calendar.Builder<EmployeeId, EmployeeData, EmployeeDrawable<EmployeeData>>(container, tenantId,
            CONSTANTS)
                    .fetchingGroupsFrom(new EmployeeNameFetchable(() -> getTenantId()))
                    .withBeanManager(beanManager)
                    .asTwoDayView((v, d, i) -> new EmployeeDrawable<>(v, d, i));

    calendar.setDataProvider(new EmployeeDataFetchable(calendar, () -> getTenantId()));
    Window.addResizeHandler((e) -> calendar.setViewSize(e.getWidth() - container.getAbsoluteLeft(),
            e.getHeight() - container.getAbsoluteTop()));
}
 
Example 4
Project: optashift-employee-rostering   File: SpotRosterViewPanel.java   View Source Code Vote up 5 votes
private void initTable() {
    calendar = new Calendar.Builder<SpotId, SpotData, SpotDrawable<SpotData>>(container, tenantId, CONSTANTS)
            .fetchingGroupsFrom(new SpotNameFetchable(() -> getTenantId()))
            .withBeanManager(beanManager)
            .asTwoDayView((v, d, i) -> new SpotDrawable<>(v, d, i));
    calendar.setDataProvider(new SpotDataFetchable(calendar, () -> getTenantId()));
    Window.addResizeHandler((e) -> calendar.setViewSize(e.getWidth() - container.getAbsoluteLeft(),
            e.getHeight() - container.getAbsoluteTop()));
}
 
Example 5
Project: empiria.player   File: ConnectionModuleViewImpl.java   View Source Code Vote up 4 votes
private void addResizeHandler() {
    resizeHandler.setConnectionModuleViewImpl(connectionEventHandler);
    Window.addResizeHandler(resizeHandler);
}
 
Example 6
Project: empiria.player   File: MultiPageView.java   View Source Code Vote up 4 votes
public MultiPageView() {
    Window.addResizeHandler(this);
}
 
Example 7
Project: appinventor-extensions   File: YaBlocksEditor.java   View Source Code Vote up 4 votes
YaBlocksEditor(YaProjectEditor projectEditor, YoungAndroidBlocksNode blocksNode) {
  super(projectEditor, blocksNode);

  this.blocksNode = blocksNode;
  COMPONENT_DATABASE = SimpleComponentDatabase.getInstance(getProjectId());

  fullFormName = blocksNode.getProjectId() + "_" + blocksNode.getFormName();
  formToBlocksEditor.put(fullFormName, this);
  blocksArea = new BlocklyPanel(this, fullFormName); // [lyn, 2014/10/28] pass in editor so can extract form json from it
  blocksArea.setWidth("100%");
  // This code seems to be using a rather old layout, so we cannot simply pass 100% for height.
  // Instead, it needs to be calculated from the client's window, and a listener added to Window
  // We use VIEWER_WINDOW_OFFSET as an approximation of the size of the top navigation bar
  // New layouts don't need all this messing; see comments on selected answer at:
  // http://stackoverflow.com/questions/86901/creating-a-fluid-panel-in-gwt-to-fill-the-page
  blocksArea.setHeight(Window.getClientHeight() - VIEWER_WINDOW_OFFSET + "px");
  Window.addResizeHandler(new ResizeHandler() {
   public void onResize(ResizeEvent event) {
     int height = event.getHeight();
     blocksArea.setHeight(height - VIEWER_WINDOW_OFFSET + "px");
   }
  });
  initWidget(blocksArea);
  blocksArea.populateComponentTypes(COMPONENT_DATABASE.getComponentsJSONString());

  // Get references to the source structure explorer
  sourceStructureExplorer = BlockSelectorBox.getBlockSelectorBox().getSourceStructureExplorer();

  // Listen for selection events for built-in drawers
  BlockSelectorBox.getBlockSelectorBox().addBlockDrawerSelectionListener(this);

  // Create palettePanel, which will be used as the content of the PaletteBox.
  myFormEditor = projectEditor.getFormFileEditor(blocksNode.getFormName());
  if (myFormEditor != null) {
    palettePanel = new YoungAndroidPalettePanel(myFormEditor);
    palettePanel.loadComponents(new DropTargetProvider() {
      // TODO(sharon): make the tree in the BlockSelectorBox a drop target
      @Override
      public DropTarget[] getDropTargets() {
        return new DropTarget[0];
      }
    });
    palettePanel.setSize("100%", "100%");
  } else {
    palettePanel = null;
    OdeLog.wlog("Can't get form editor for blocks: " + getFileId());
  }
}