Java 类com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter 实例源码

项目:LAS    文件:OLTimeSeriesMap.java   
/**
 * 
 */
public OLTimeSeriesMap() {

    Point center = new Point(0.0, 0.0);
    mapWidget = new OLMapWidget( "350px", "520px");
    map = mapWidget.getMap();
    map.addLayer(pointsLayer);
    layout_grid.setWidget(0, 0, reset);
    layout_grid.setWidget(0, 1, select);
    FlexCellFormatter formatter = layout_grid.getFlexCellFormatter();
    formatter.addStyleName(0, 1, "right-small-banner");
    select.addStyleName("right-small-banner");
    layout_grid.setWidget(1, 0, mapWidget);
    formatter.setColSpan(1, 0, 2);
    reset.addClickListener(resetListener);
    initWidget(layout_grid);
}
项目:ontosoft    文件:CompareView.java   
private void addPieCharts() {
  int i=0;
  FlexCellFormatter cellFormatter = table.getFlexCellFormatter();    
  for(Software sw : softwares) {
    CategoryPieChart piechart = new CategoryPieChart(sw.getName(), 200);
    piechart.setVocabulary(vocabulary);
    piechart.setSoftware(sw);
    piechart.setEventEnabled(false);;
    cellFormatter.addStyleName(1, i, "chart-cell");
    cellFormatter.setWidth(1, i, 100/softwares.size()+"%");
    table.setWidget(1, i, piechart);
    if(!piechart.drawnCategories())
      piechart.drawCategories();
    piechart.fillCategories(false); 
    //piechart.setActiveCategoryId(null, false);
    i++;
  }
  cellFormatter.addStyleName(1, i-1, "no-border-cell");    
}
项目:gerrit    文件:DashboardsTable.java   
protected void populate(int row, DashboardInfo k) {
  if (k.isDefault()) {
    table.setWidget(row, 1, new Image(Gerrit.RESOURCES.greenCheck()));
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.getElement(row, 1).setTitle(Util.C.dashboardDefaultToolTip());
  }
  table.setWidget(
      row,
      2,
      new Anchor(
          k.path(),
          "#" + PageLinks.toProjectDashboard(new Project.NameKey(k.project()), k.id())));
  table.setText(row, 3, k.title() != null ? k.title() : k.path());
  table.setText(row, 4, k.description());
  if (k.definingProject() != null && !k.definingProject().equals(k.project())) {
    table.setWidget(
        row,
        5,
        new Anchor(
            k.definingProject(),
            "#" + PageLinks.toProjectDashboards(new Project.NameKey(k.definingProject()))));
  }
  setRowItem(row, k);
}
项目:gerrit    文件:ProjectBranchesScreen.java   
BranchesTable() {
  table.setWidth("");
  table.setText(0, 2, AdminConstants.I.columnBranchName());
  table.setText(0, 3, AdminConstants.I.columnBranchRevision());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());

  updateDeleteHandler =
      new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
          updateDeleteButton();
        }
      };
}
项目:gerrit    文件:ProjectTagsScreen.java   
TagsTable() {
  table.setWidth("");
  table.setText(0, 2, AdminConstants.I.columnTagName());
  table.setText(0, 3, AdminConstants.I.columnTagRevision());

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());

  updateDeleteHandler =
      new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
          updateDeleteButton();
        }
      };
}
项目:gerrit    文件:GroupTable.java   
public GroupTable(String pointerId) {
  super(AdminConstants.I.groupItemHelp());
  setSavePointerId(pointerId);

  table.setText(0, 1, AdminConstants.I.columnGroupName());
  table.setText(0, 2, AdminConstants.I.columnGroupDescription());
  table.setText(0, 3, AdminConstants.I.columnGroupVisibleToAll());
  table.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          final Cell cell = table.getCellForEvent(event);
          if (cell != null
              && cell.getCellIndex() != 1
              && getRowItem(cell.getRowIndex()) != null) {
            movePointerTo(cell.getRowIndex());
          }
        }
      });

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  for (int i = 1; i <= NUM_COLS; i++) {
    fmt.addStyleName(0, i, Gerrit.RESOURCES.css().dataHeader());
  }
}
项目:gerrit    文件:DocTable.java   
DocTable() {
  super(Util.C.docItemHelp());

  table.setText(0, C_TITLE, Util.C.docTableColumnTitle());

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, C_TITLE, Gerrit.RESOURCES.css().dataHeader());

  table.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          Cell cell = table.getCellForEvent(event);
          if (cell == null) {
            return;
          }
          if (getRowItem(cell.getRowIndex()) != null) {
            movePointerTo(cell.getRowIndex());
          }
        }
      });
}
项目:gerrit    文件:MyAgreementsScreen.java   
void addOne(AgreementInfo info) {
  int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  String url = info.url();
  if (url != null && url.length() > 0) {
    Anchor a = new Anchor(info.name(), url);
    a.setTarget("_blank");
    table.setWidget(row, 1, a);
  } else {
    table.setText(row, 1, info.name());
  }
  table.setText(row, 2, info.description());
  FlexCellFormatter fmt = table.getFlexCellFormatter();
  for (int c = 1; c < 3; c++) {
    fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
  }
}
项目:gerrit    文件:MyIdentitiesScreen.java   
IdTable() {
  table.setWidth("");
  table.setText(0, 2, Util.C.webIdStatus());
  table.setText(0, 3, Util.C.webIdEmail());
  table.setText(0, 4, Util.C.webIdIdentity());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());

  updateDeleteHandler =
      new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
          updateDeleteButton();
        }
      };
}
项目:gerrit    文件:SshPanel.java   
SshKeyTable() {
  table.setWidth("");
  table.setText(0, 2, Util.C.sshKeyStatus());
  table.setText(0, 3, Util.C.sshKeyAlgorithm());
  table.setText(0, 4, Util.C.sshKeyKey());
  table.setText(0, 5, Util.C.sshKeyComment());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 5, Gerrit.RESOURCES.css().dataHeader());

  updateDeleteHandler =
      new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
          updateDeleteButton();
        }
      };
}
项目:gerrit    文件:MyGpgKeysScreen.java   
GpgKeyTable() {
  table.setWidth("");
  table.setText(0, 1, Util.C.gpgKeyId());
  table.setText(0, 2, Util.C.gpgKeyFingerprint());
  table.setText(0, 3, Util.C.gpgKeyUserIds());

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());

  updateDeleteHandler =
      new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
          updateDeleteButton();
        }
      };
}
项目:gerrit    文件:MyGpgKeysScreen.java   
private void addOneKey(GpgKeyInfo k) {
  int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  CheckBox sel = new CheckBox();
  sel.addValueChangeHandler(updateDeleteHandler);
  table.setWidget(row, 0, sel);
  table.setWidget(row, 1, new CopyableLabel(k.id()));
  table.setText(row, 2, k.fingerprint());

  VerticalPanel userIds = new VerticalPanel();
  for (int i = 0; i < k.userIds().length(); i++) {
    userIds.add(new InlineLabel(k.userIds().get(i)));
  }
  table.setWidget(row, 3, userIds);

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, k);
}
项目:Peergos    文件:CwDecoratorPanel.java   
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a table to layout the form options
  FlexTable layout = new FlexTable();
  layout.setCellSpacing(6);
  FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

  // Add a title to the form
  layout.setHTML(0, 0, constants.cwDecoratorPanelFormTitle());
  cellFormatter.setColSpan(0, 0, 2);
  cellFormatter.setHorizontalAlignment(
      0, 0, HasHorizontalAlignment.ALIGN_CENTER);

  // Add some standard form options
  layout.setHTML(1, 0, constants.cwDecoratorPanelFormName());
  layout.setWidget(1, 1, new TextBox());
  layout.setHTML(2, 0, constants.cwDecoratorPanelFormDescription());
  layout.setWidget(2, 1, new TextBox());

  // Wrap the content in a DecoratorPanel
  DecoratorPanel decPanel = new DecoratorPanel();
  decPanel.setWidget(layout);
  return decPanel;
}
项目:swarm    文件:CwDecoratorPanel.java   
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a table to layout the form options
  FlexTable layout = new FlexTable();
  layout.setCellSpacing(6);
  FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

  // Add a title to the form
  layout.setHTML(0, 0, constants.cwDecoratorPanelFormTitle());
  cellFormatter.setColSpan(0, 0, 2);
  cellFormatter.setHorizontalAlignment(
      0, 0, HasHorizontalAlignment.ALIGN_CENTER);

  // Add some standard form options
  layout.setHTML(1, 0, constants.cwDecoratorPanelFormName());
  layout.setWidget(1, 1, new TextBox());
  layout.setHTML(2, 0, constants.cwDecoratorPanelFormDescription());
  layout.setWidget(2, 1, new TextBox());

  // Wrap the content in a DecoratorPanel
  DecoratorPanel decPanel = new DecoratorPanel();
  decPanel.setWidget(layout);
  return decPanel;
}
项目:WebConsole    文件:GridPanelComponent.java   
@Override
public void onRender(int width, int height, List<DataValuePairContainer> data) {
    FlexTable grid = (FlexTable)getWidget();
    int colWidth = (int)Math.round((double)width / cols);
    int rowHeight = (int)Math.round((double)height / rows);

    for (int i=0; i<rows; i++) {
        for (int j=0; j<cols; j++) {
            CellData cellData = cellDataArr[i][j];
            if (cellData != null) {
                if (!cellData.ignore) {
                    FlexCellFormatter formatter = grid.getFlexCellFormatter();
                    int cellWidth = cellData.colSpan * colWidth;
                    int cellHeight = cellData.rowSpan * rowHeight;
                    formatter.setRowSpan(i, j, cellData.rowSpan);
                    formatter.setColSpan(i, j, cellData.colSpan);
                    formatter.setHeight(i, j, cellHeight + "px");
                    formatter.setWidth(i, j, cellWidth + "px");
                    formatter.setHorizontalAlignment(i, j, HasHorizontalAlignment.ALIGN_CENTER);
                    formatter.setVerticalAlignment(i, j, HasVerticalAlignment.ALIGN_MIDDLE);

                    Widget widget = grid.getWidget(i, j);
                    if (widget != null) {
                        ConsoleComponent component = (ConsoleComponent)widget;
                        if (component != null) {
                            component.onAdd(cellWidth, cellHeight);
                        }
                    } else {
                        // Just add an empty cell
                        this.setComponent(i, j, null);
                    }
                }
            }
        }
    }
}
项目:ontosoft    文件:CompareView.java   
private void addHeading() {
  int i=0;
  FlexCellFormatter cellFormatter = table.getFlexCellFormatter();    
  for(Software sw : softwares) {
    cellFormatter.addStyleName(0, i, "header-cell wrap-long-words");
    cellFormatter.setWidth(0, i, 100/softwares.size()+"%");
    table.setWidget(0, i++, new Heading(HeadingSize.H4, sw.getLabel()));
  }
  cellFormatter.addStyleName(0, i-1, "no-border-cell");    
}
项目:gerrit    文件:DashboardsTable.java   
protected void initColumnHeaders() {
  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.setColSpan(0, 0, 2);
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());

  table.setText(0, 1, Util.C.dashboardName());
  table.setText(0, 2, Util.C.dashboardTitle());
  table.setText(0, 3, Util.C.dashboardDescription());
  table.setText(0, 4, Util.C.dashboardInherited());
}
项目:gerrit    文件:DashboardsTable.java   
protected void insertTitleRow(int row, String section) {
  table.insertRow(row);

  table.setText(row, 0, section);

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.setColSpan(row, 0, 6);
  fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().sectionHeader());
}
项目:gerrit    文件:DashboardsTable.java   
protected void insert(int row, DashboardInfo k) {
  table.insertRow(row);

  applyDataRowStyle(row);

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 5, Gerrit.RESOURCES.css().dataCell());

  populate(row, k);
}
项目:gerrit    文件:AccountGroupAuditLogScreen.java   
AuditEventTable() {
  table.setText(0, 1, AdminConstants.I.columnDate());
  table.setText(0, 2, AdminConstants.I.columnType());
  table.setText(0, 3, AdminConstants.I.columnMember());
  table.setText(0, 4, AdminConstants.I.columnByUser());

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
}
项目:gerrit    文件:ProjectTagsScreen.java   
void populate(int row, TagInfo k) {
  if (k.canDelete()) {
    CheckBox sel = new CheckBox();
    sel.addValueChangeHandler(updateDeleteHandler);
    table.setWidget(row, 1, sel);
    canDelete = true;
  } else {
    table.setText(row, 1, "");
  }

  table.setWidget(row, 2, new InlineHTML(highlight(k.getShortName(), match)));

  if (k.revision() != null) {
    table.setText(row, 3, k.revision());
  } else {
    table.setText(row, 3, "");
  }

  FlowPanel actionsPanel = new FlowPanel();
  if (k.webLinks() != null) {
    for (WebLinkInfo webLink : Natives.asList(k.webLinks())) {
      actionsPanel.add(webLink.toAnchor());
    }
  }
  table.setWidget(row, 4, actionsPanel);

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  String iconCellStyle = Gerrit.RESOURCES.css().iconCell();
  String dataCellStyle = Gerrit.RESOURCES.css().dataCell();
  fmt.addStyleName(row, 1, iconCellStyle);
  fmt.addStyleName(row, 2, dataCellStyle);
  fmt.addStyleName(row, 3, dataCellStyle);
  fmt.addStyleName(row, 4, dataCellStyle);

  setRowItem(row, k);
}
项目:gerrit    文件:GroupTable.java   
void populate(int row, GroupInfo k, String toHighlight) {
  if (k.url() != null) {
    if (isInteralGroup(k)) {
      table.setWidget(
          row,
          1,
          new HighlightingInlineHyperlink(
              k.name(), Dispatcher.toGroup(k.getGroupId()), toHighlight));
    } else {
      Anchor link = new Anchor();
      link.setHTML(Util.highlight(k.name(), toHighlight));
      link.setHref(k.url());
      table.setWidget(row, 1, link);
    }
  } else {
    table.setHTML(row, 1, Util.highlight(k.name(), toHighlight));
  }
  table.setText(row, 2, k.description());
  if (k.options().isVisibleToAll()) {
    table.setWidget(row, 3, new Image(Gerrit.RESOURCES.greenCheck()));
  }

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().groupName());
  for (int i = 1; i <= NUM_COLS; i++) {
    fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell());
  }

  setRowItem(row, k);
}
项目:gerrit    文件:PluginListScreen.java   
PluginTable() {
  table.setText(0, 1, AdminConstants.I.columnPluginName());
  table.setText(0, 2, AdminConstants.I.columnPluginSettings());
  table.setText(0, 3, AdminConstants.I.columnPluginVersion());
  table.setText(0, 4, AdminConstants.I.columnPluginStatus());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
}
项目:gerrit    文件:PluginListScreen.java   
void populate(int row, PluginInfo plugin) {
  if (plugin.disabled() || plugin.indexUrl() == null) {
    table.setText(row, 1, plugin.name());
  } else {
    table.setWidget(
        row, 1, new Anchor(plugin.name(), Gerrit.selfRedirect(plugin.indexUrl()), "_blank"));

    if (new ExtensionScreen(plugin.name() + "/settings").isFound()) {
      InlineHyperlink adminScreenLink = new InlineHyperlink();
      adminScreenLink.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.gear()));
      adminScreenLink.setTargetHistoryToken("/x/" + plugin.name() + "/settings");
      adminScreenLink.setTitle(AdminConstants.I.pluginSettingsToolTip());
      table.setWidget(row, 2, adminScreenLink);
    }
  }

  table.setText(row, 3, plugin.version());
  table.setText(
      row,
      4,
      plugin.disabled() ? AdminConstants.I.pluginDisabled() : AdminConstants.I.pluginEnabled());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, plugin);
}
项目:gerrit    文件:AccountGroupMembersScreen.java   
MemberTable() {
  table.setText(0, 2, AdminConstants.I.columnMember());
  table.setText(0, 3, AdminConstants.I.columnEmailAddress());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
}
项目:gerrit    文件:AccountGroupMembersScreen.java   
void populate(int row, AccountInfo i) {
  CheckBox checkBox = new CheckBox();
  table.setWidget(row, 1, checkBox);
  checkBox.setEnabled(enabled);
  table.setWidget(row, 2, AccountLinkPanel.create(i));
  table.setText(row, 3, i.email());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, i);
}
项目:gerrit    文件:AccountGroupMembersScreen.java   
IncludeTable() {
  table.setText(0, 2, AdminConstants.I.columnGroupName());
  table.setText(0, 3, AdminConstants.I.columnGroupDescription());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
}
项目:gerrit    文件:AccountGroupMembersScreen.java   
void populate(int row, GroupInfo i) {
  final FlexCellFormatter fmt = table.getFlexCellFormatter();

  AccountGroup.UUID uuid = i.getGroupUUID();
  CheckBox checkBox = new CheckBox();
  table.setWidget(row, 1, checkBox);
  checkBox.setEnabled(enabled);
  if (AccountGroup.isInternalGroup(uuid)) {
    table.setWidget(row, 2, new Hyperlink(i.name(), Dispatcher.toGroup(uuid)));
    fmt.getElement(row, 2).setTitle(null);
    table.setText(row, 3, i.description());
  } else if (i.url() != null) {
    Anchor a = new Anchor();
    a.setText(i.name());
    a.setHref(i.url());
    a.setTitle("UUID " + uuid.get());
    table.setWidget(row, 2, a);
    fmt.getElement(row, 2).setTitle(null);
  } else {
    table.setText(row, 2, i.name());
    fmt.getElement(row, 2).setTitle("UUID " + uuid.get());
  }

  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, i);
}
项目:gerrit    文件:MyWatchesTable.java   
public MyWatchesTable() {
  table.setWidth("");
  table.insertRow(1);
  table.setText(0, 2, Util.C.watchedProjectName());
  table.setText(0, 3, Util.C.watchedProjectColumnEmailNotifications());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.setRowSpan(0, 0, 2);
  fmt.setRowSpan(0, 1, 2);
  fmt.setRowSpan(0, 2, 2);
  fmt.getElement(0, 3).setPropertyString("align", "center");

  fmt.setColSpan(0, 3, 5);
  table.setText(1, 0, Util.C.watchedProjectColumnNewChanges());
  table.setText(1, 1, Util.C.watchedProjectColumnNewPatchSets());
  table.setText(1, 2, Util.C.watchedProjectColumnAllComments());
  table.setText(1, 3, Util.C.watchedProjectColumnSubmittedChanges());
  table.setText(1, 4, Util.C.watchedProjectColumnAbandonedChanges());
  fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(1, 1, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(1, 2, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(1, 3, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(1, 4, Gerrit.RESOURCES.css().dataHeader());
}
项目:gerrit    文件:MyAgreementsScreen.java   
AgreementTable() {
  table.setWidth("");
  table.setText(0, 1, Util.C.agreementName());
  table.setText(0, 2, Util.C.agreementDescription());

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  for (int c = 1; c < 3; c++) {
    fmt.addStyleName(0, c, Gerrit.RESOURCES.css().dataHeader());
  }
}
项目:gerrit    文件:MyIdentitiesScreen.java   
void addOneId(ExternalIdInfo k) {
  if (k.isUsername()) {
    // Don't display the username as an identity here.
    return;
  }

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  final int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  if (k.canDelete()) {
    final CheckBox sel = new CheckBox();
    sel.addValueChangeHandler(updateDeleteHandler);
    table.setWidget(row, 1, sel);
  } else {
    table.setText(row, 1, "");
  }
  if (k.isTrusted()) {
    table.setText(row, 2, "");
  } else {
    table.setText(row, 2, Util.C.untrustedProvider());
    fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().identityUntrustedExternalId());
  }
  if (k.emailAddress() != null && k.emailAddress().length() > 0) {
    table.setText(row, 3, k.emailAddress());
  } else {
    table.setText(row, 3, "");
  }
  table.setText(row, 4, k.describe());

  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, k);
}
项目:gerrit    文件:SshPanel.java   
void addOneKey(SshKeyInfo k) {
  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  final int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  final CheckBox sel = new CheckBox();
  sel.addValueChangeHandler(updateDeleteHandler);

  table.setWidget(row, 1, sel);
  if (k.isValid()) {
    table.setText(row, 2, "");
    fmt.removeStyleName(
        row,
        2, //
        Gerrit.RESOURCES.css().sshKeyPanelInvalid());
  } else {
    table.setText(row, 2, Util.C.sshKeyInvalid());
    fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().sshKeyPanelInvalid());
  }
  table.setText(row, 3, k.algorithm());

  CopyableLabel keyLabel = new CopyableLabel(k.sshPublicKey());
  keyLabel.setPreviewText(elide(k.encodedKey(), 40));
  table.setWidget(row, 4, keyLabel);

  table.setText(row, 5, k.comment());

  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().sshKeyPanelEncodedKey());
  for (int c = 2; c <= 5; c++) {
    fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
  }

  setRowItem(row, k);
}
项目:gerrit    文件:ProjectsTable.java   
protected void initColumnHeaders() {
  table.setText(0, C_STATE, Util.C.projectStateAbbrev());
  table.getCellFormatter().getElement(0, C_STATE).setTitle(Util.C.projectStateHelp());
  table.setText(0, C_NAME, Util.C.projectName());
  table.setText(0, C_DESCRIPTION, Util.C.projectDescription());

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(0, C_STATE, Gerrit.RESOURCES.css().iconHeader());
  fmt.addStyleName(0, C_NAME, Gerrit.RESOURCES.css().dataHeader());
  fmt.addStyleName(0, C_DESCRIPTION, Gerrit.RESOURCES.css().dataHeader());
}
项目:gerrit    文件:ProjectsTable.java   
protected void insert(int row, ProjectInfo k) {
  table.insertRow(row);

  applyDataRowStyle(row);

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, C_STATE, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, C_NAME, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, C_NAME, Gerrit.RESOURCES.css().projectNameColumn());
  fmt.addStyleName(row, C_DESCRIPTION, Gerrit.RESOURCES.css().dataCell());

  populate(row, k);
}
项目:gerrit    文件:ChangeTable.java   
private void insertNoneRow(int row) {
  insertRow(row);
  table.setText(row, 0, Util.C.changeTableNone());
  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.setColSpan(row, 0, columns);
  fmt.setStyleName(row, 0, Gerrit.RESOURCES.css().emptySection());
}
项目:ineform    文件:PropFWView.java   
private void createHeader() {
    int col = 0;
    rowTable.setWidget(0, col++, new Label(IneFormI18n.customKVO_key()));
    if (showType)
        rowTable.setWidget(0, col++, new Label(IneFormI18n.customKVO_type()));
    rowTable.setWidget(0, col++, new Label(IneFormI18n.customKVO_value()));
    ((FlexCellFormatter) rowTable.getCellFormatter()).setColSpan(0, col - 1, 2);

    rowTable.getCellFormatter().setStyleName(
        0,
        0,
        ResourceHelper.ineformRes().style().customKVOHeader());
    if (showType) {
        rowTable.getCellFormatter().setStyleName(
            0,
            1,
            ResourceHelper.ineformRes().style().customKVOHeaderType());
        rowTable.getCellFormatter().setStyleName(
            0,
            2,
            ResourceHelper.ineformRes().style().customKVOHeader());
    } else {
        rowTable.getCellFormatter().setStyleName(
            0,
            1,
            ResourceHelper.ineformRes().style().customKVOHeader());
    }

}
项目:drools-wb    文件:FreeFormLineWidget.java   
/**
 * Creates a new FactPatternWidget
 * @param mod
 * @param p
 * @param readOnly if the widget should be in RO mode. If this parameter is null,
 * the readOnly attribute is calculated.
 */
public FreeFormLineWidget( RuleModeller mod,
                           EventBus eventBus,
                           FreeFormLine p,
                           Boolean readOnly ) {
    super(mod,
            eventBus);
    this.action = p;

    if ( readOnly == null ) {
        this.readOnly = false;
    } else {
        this.readOnly = readOnly;
    }

    layout.setWidth("100%");
    textArea.setWidth( "100%" );

    layout.setWidget( 0,
                      0,
                      createTextBox() );
    FlexCellFormatter formatter = layout.getFlexCellFormatter();
    formatter.setAlignment( 0,
                            0,
                            HasHorizontalAlignment.ALIGN_LEFT,
                            HasVerticalAlignment.ALIGN_BOTTOM );

    formatter.setAlignment( 0,
                            1,
                            HasHorizontalAlignment.ALIGN_LEFT,
                            HasVerticalAlignment.ALIGN_TOP );

    if ( this.readOnly ) {
        this.layout.addStyleName( "editor-disabled-widget" );
    }

    initWidget( layout );
}
项目:LAS    文件:DateTimeWidget.java   
private void loadWidget() {
    dateTimeWidget.clear();
    if ( isMenu ) {
        dateTimeWidget.setWidget(0, 0, d_label);
        dateTimeWidget.setWidget(0, 1, lo_day);
        dateTimeWidget.setWidget(1, 0, d_label_hi_range);
        dateTimeWidget.setWidget(1, 1, hi_day);
    } else {

        dateTimeWidget.setWidget(0, 0, d_label);
        dateTimeWidget.setWidget(1, 0, d_label_hi_range);


        if ( render.toLowerCase(Locale.ENGLISH).contains("y") ) {
            dateTimeWidget.setWidget(0, 1, lo_year);
            dateTimeWidget.setWidget(1, 1, hi_year);
            hasYear = true;
        }

        if ( render.toLowerCase(Locale.ENGLISH).contains("m") ) {
            dateTimeWidget.setWidget(0, 2, lo_month);
            dateTimeWidget.setWidget(1, 2, hi_month);
            hasMonth = true;
        }

        if ( render.toLowerCase(Locale.ENGLISH).contains("d") ) {
            dateTimeWidget.setWidget(0, 3, lo_day);
            dateTimeWidget.setWidget(1, 3, hi_day);
            hasDay = true;
        }

        if ( render.toLowerCase(Locale.ENGLISH).contains("t") ) {
            dateTimeWidget.setWidget(0, 4, lo_hour);
            dateTimeWidget.setWidget(1, 4, hi_hour);
            hasHour = true;
        }
        if ( hasMinute && render.toLowerCase(Locale.ENGLISH).contains("t") ) {
            dateTimeWidget.setWidget(0, 5, lo_minute);
            dateTimeWidget.setWidget(1, 5, hi_minute);
            // hasMinute gets set above because of the units.

        }

    }
    FlexCellFormatter cellFormatter = dateTimeWidget.getFlexCellFormatter();
    if ( range ) {
        for ( int i = 0; i < 5; i++ ) {
            cellFormatter.setVisible(1, i, true);
        }
        dateTimeWidget.setWidget(0, 0, d_label_lo_range);
        cellFormatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
        cellFormatter.setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
    } else {
        for ( int i = 0; i < 5; i++ ) {
            cellFormatter.setVisible(1, i, false);
        }
           dateTimeWidget.setWidget(0, 0, d_label);
           cellFormatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    }
}
项目:x-cure-chat    文件:ChatMessagesPanelUI.java   
/**
 * Allows to add a chat message entry to the flex table
 * @param table the table to add the message to
 * @param avatars the array of registered avatar widgets to be appended
 *                with the newly added avatar or null if we do not want
 *                to keep trak of avatars.
 * @param numberOfRows the current number of rows in the flex table
 * @param avatarWidget the avatar widget
 * @param messageWidget the message widget
 * @param isLeftMessage true if this is a left message, false for the right one
 * @return the current number of wors in the table
 */
private static int addElementsToTable( final FlexTable table, List<Widget> avatars,
                                       final int numberOfRows, final Widget avatarWidget,
                                       final Widget messageWidget, final boolean isLeftMessage ) {
    //Insert a new row
    final int newRowIndex = numberOfRows;
    table.insertRow( newRowIndex );

    //Get the cell formatter
    FlexCellFormatter cellFormatter = table.getFlexCellFormatter();

    //Determine the avatar's row and column index and span 
    //the avatar's cell across the rows, if possible
    final int avatarRowIdx, avatarColIdx, emptyColIdx, messageColIdx;
    if( newRowIndex > 0 ) {
        avatarRowIdx = newRowIndex - 1;
        if( isLeftMessage ) {
            avatarColIdx  = FIRST_COLUMN_IDX;
            messageColIdx = FIRST_COLUMN_IDX;
            emptyColIdx   = SECOND_COLUM_IDX;
            cellFormatter.setRowSpan(avatarRowIdx,  avatarColIdx, 2);
            table.insertCell( newRowIndex, messageColIdx );
            table.insertCell( newRowIndex, emptyColIdx );
        } else {
            avatarColIdx  = ( newRowIndex == 1 ) ? THIRD_COLUMN_IDX : SECOND_COLUM_IDX;
            messageColIdx = SECOND_COLUM_IDX;
            emptyColIdx   = FIRST_COLUMN_IDX;
            table.insertCell( newRowIndex, emptyColIdx );
            table.insertCell( newRowIndex, messageColIdx );
            cellFormatter.setRowSpan(avatarRowIdx, avatarColIdx, 2);
        }
    } else {
        avatarRowIdx = newRowIndex;
        messageColIdx = SECOND_COLUM_IDX;
        if( isLeftMessage ) {
            avatarColIdx  = FIRST_COLUMN_IDX;
            emptyColIdx   = THIRD_COLUMN_IDX;
        } else {
            avatarColIdx  = THIRD_COLUMN_IDX;
            emptyColIdx   = FIRST_COLUMN_IDX;
        }
        table.insertCell( newRowIndex, FIRST_COLUMN_IDX );
        table.insertCell( newRowIndex, SECOND_COLUM_IDX );
        table.insertCell( newRowIndex, THIRD_COLUMN_IDX );
    }

    //Insert the avatar and the chat message itself with the proper styles
    final String messageStyle;
    final String avatarStyle;
    if( isLeftMessage ) {
        messageStyle = CommonResourcesContainer.CHAT_ENTRY_MESSAGE_LEFT_STYLE;
        avatarStyle  = CommonResourcesContainer.CHAT_ENTRY_AVATAR_LEFT_STYLE;
    } else {
        messageStyle = CommonResourcesContainer.CHAT_ENTRY_MESSAGE_RIGHT_STYLE;
        avatarStyle  = CommonResourcesContainer.CHAT_ENTRY_AVATAR_RIGHT_STYLE;
    }
    table.setWidget( newRowIndex, emptyColIdx, new HTML("&nbsp;") );
    cellFormatter.setStyleName( newRowIndex, messageColIdx, messageStyle );
    table.setWidget( newRowIndex, messageColIdx, messageWidget );
    cellFormatter.setStyleName( avatarRowIdx, avatarColIdx, avatarStyle );
    table.setWidget( avatarRowIdx, avatarColIdx, avatarWidget );

    //Add the new avatar to the avatars list, if it not null
    if( avatars != null ) {
        avatars.add( avatarWidget );
    }

    return numberOfRows + 1;
}
项目:gerrit    文件:ProjectBranchesScreen.java   
void populate(int row, BranchInfo k) {
  if (k.canDelete()) {
    CheckBox sel = new CheckBox();
    sel.addValueChangeHandler(updateDeleteHandler);
    table.setWidget(row, 1, sel);
    canDelete = true;
  } else {
    table.setText(row, 1, "");
  }

  table.setWidget(row, 2, new InlineHTML(highlight(k.getShortName(), match)));

  if (k.revision() != null) {
    if ("HEAD".equals(k.getShortName())) {
      setHeadRevision(row, 3, k.revision());
    } else {
      table.setText(row, 3, k.revision());
    }
  } else {
    table.setText(row, 3, "");
  }

  FlowPanel actionsPanel = new FlowPanel();
  if (k.webLinks() != null) {
    for (WebLinkInfo webLink : Natives.asList(k.webLinks())) {
      actionsPanel.add(webLink.toAnchor());
    }
  }
  if (k.actions() != null) {
    k.actions().copyKeysIntoChildren("id");
    for (ActionInfo a : Natives.asList(k.actions().values())) {
      actionsPanel.add(new ActionButton(getProjectKey(), k, a));
    }
  }
  table.setWidget(row, 4, actionsPanel);

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  String iconCellStyle = Gerrit.RESOURCES.css().iconCell();
  String dataCellStyle = Gerrit.RESOURCES.css().dataCell();
  if (RefNames.REFS_CONFIG.equals(k.getShortName()) || "HEAD".equals(k.getShortName())) {
    iconCellStyle = Gerrit.RESOURCES.css().specialBranchIconCell();
    dataCellStyle = Gerrit.RESOURCES.css().specialBranchDataCell();
    fmt.setStyleName(row, 0, iconCellStyle);
  }
  fmt.addStyleName(row, 1, iconCellStyle);
  fmt.addStyleName(row, 2, dataCellStyle);
  fmt.addStyleName(row, 3, dataCellStyle);
  fmt.addStyleName(row, 4, dataCellStyle);

  setRowItem(row, k);
}