@Override
 void getLaneForChild(LaneInfo outInfo, View child, Direction direction) {
   super.getLaneForChild(outInfo, child, direction);
   if (outInfo.isUndefined()) {
     getLanes().findLane(outInfo, getLaneSpanForChild(child), direction);
   }
 }
Esempio n. 2
0
  /**
   * The constructor
   *
   * @param x the x coordinate of the dialog window's top left corner
   * @param y the y coordinate of the dialog window's top left corner
   * @title dialog's title
   */
  public FileDialog(int x, int y, int width, int height, String title) {
    super(x, y, width, height, true, title);

    _directories = new List();
    _directories.setSelectable(false);
    _directories.setTitle("Directories");
    _directories.addListener(this);
    _files = new List();
    _files.setSelectable(false);
    _files.setTitle("Files");
    _files.addListener(this);
    _fileLabel = new Label("File: ");
    _filterLabel = new Label("Filter: ");
    _fileField = new TextField();
    _fileField.setText(getCurrentFileContent());
    _filterField = new FilterTextField(this);
    _okButton = new Button("OK");
    _okButton.addListener(this);
    _cancelButton = new Button("Cancel");
    _cancelButton.addListener(this);

    Panel topPanel = new Panel();
    GridLayoutManager topManager = new GridLayoutManager(2, 1);
    topPanel.setLayoutManager(topManager);
    topManager.addWidget(_directories, 0, 0, 1, 1, ALIGNMENT_CENTER, ALIGNMENT_CENTER);
    topManager.addWidget(_files, 1, 0, 1, 1, ALIGNMENT_CENTER, ALIGNMENT_CENTER);

    Panel bottomPanel = new Panel();
    GridLayoutManager bottomManager = new GridLayoutManager(4, 4);
    bottomPanel.setLayoutManager(bottomManager);
    bottomManager.addWidget(_fileLabel, 0, 0, 1, 1, ALIGNMENT_CENTER, ALIGNMENT_RIGHT);
    bottomManager.addWidget(_filterLabel, 0, 2, 1, 1, ALIGNMENT_CENTER, ALIGNMENT_RIGHT);
    bottomManager.addWidget(_fileField, 1, 0, 2, 1, ALIGNMENT_CENTER, ALIGNMENT_CENTER);
    bottomManager.addWidget(_filterField, 1, 2, 2, 1, ALIGNMENT_CENTER, ALIGNMENT_CENTER);
    bottomManager.addWidget(_okButton, 3, 0, 1, 1, ALIGNMENT_CENTER, ALIGNMENT_CENTER);
    bottomManager.addWidget(_cancelButton, 3, 2, 1, 1, ALIGNMENT_CENTER, ALIGNMENT_CENTER);

    DefaultLayoutManager manager = (DefaultLayoutManager) getRootPanel().getLayoutManager();

    manager.addWidget(topPanel, 0, 0, width - 2, height - 6, ALIGNMENT_CENTER, ALIGNMENT_CENTER);
    manager.addWidget(bottomPanel, 0, height - 6, width - 2, 4, ALIGNMENT_CENTER, ALIGNMENT_CENTER);

    fillListWidgets(getCurrentDirectory());
  }
 int getChildLayoutCellCount(final GridLayoutManager childLayout) {
   return childLayout.getRowCount();
 }