本文整理汇总了Java中com.extjs.gxt.ui.client.widget.BoxComponent类的典型用法代码示例。如果您正苦于以下问题:Java BoxComponent类的具体用法?Java BoxComponent怎么用?Java BoxComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BoxComponent类属于com.extjs.gxt.ui.client.widget包,在下文中一共展示了BoxComponent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleEvent
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
public void handleEvent(GridEvent<RuleModel> be) {
Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE,
new String[]{"DEBUG","Resizing " + be.getGrid().getColumnModel().getColumnId(be.getColIndex())});
for (int i = 0; i < be.getGrid().getStore().getCount(); i++) { // there should be only 1 row
// let's force a resize on all the columns
for (int col = 0; col < be.getGrid().getColumnModel().getColumnCount(); col++) {
// final Widget widget = be.getGrid().getView().getWidget(i, be.getColIndex());
final Widget widget = be.getGrid().getView().getWidget(i, col);
// Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE,
// new String[]{"DEBUG","Resizing " + widget.getClass().getName() + "--" + widget.getTitle()});
int colWidth = be.getGrid().getColumnModel().getColumn(col).getWidth();
if ((widget != null) && (widget instanceof BoxComponent)) {
// ((BoxComponent) widget).setWidth(be.getWidth() - offset);
((BoxComponent) widget).setWidth(colWidth - offset);
}
}
}
}
示例2: handleEvent
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
public void handleEvent(GridEvent<RuleModel> be) {
for (int i = 0; i < be.getGrid().getStore().getCount(); i++) {
final Widget wid = be.getGrid().getView().getWidget(i, be.getColIndex());
if ((wid != null) && (wid instanceof BoxComponent)) {
((BoxComponent) wid).setWidth(be.getWidth() - offset);
}
}
}
示例3: createStyleTextBox
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
/**
* Creates the style text box.
*
* @return the grid cell renderer
*/
private GridCellRenderer<LayerStyle> createStyleTextBox() {
GridCellRenderer<LayerStyle> textRendered = new GridCellRenderer<LayerStyle>() {
private boolean init;
public Object render(final LayerStyle model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<LayerStyle> store, Grid<LayerStyle> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize,
new Listener<GridEvent<LayerStyle>>() {
public void handleEvent(GridEvent<LayerStyle> be) {
for (int i = 0; i < be.getGrid().getStore()
.getCount(); i++) {
if ((be.getGrid().getView()
.getWidget(i, be.getColIndex()) != null)
&& (be.getGrid()
.getView()
.getWidget(
i,
be.getColIndex()) instanceof BoxComponent)) {
((BoxComponent) be
.getGrid()
.getView()
.getWidget(i,
be.getColIndex()))
.setWidth(be.getWidth() - 10);
}
}
}
});
}
LabelField styleName = new LabelField();
styleName.setWidth(150);
styleName.setReadOnly(true);
styleName.setValue(model.getStyle());
return styleName;
}
};
return textRendered;
}
示例4: createNameTextBox
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
/**
* Creates the name text box.
*
* @return the grid cell renderer
*/
private GridCellRenderer<LayerAttribUI> createNameTextBox()
{
GridCellRenderer<LayerAttribUI> textRendered = new GridCellRenderer<LayerAttribUI>()
{
private boolean init;
public Object render(final LayerAttribUI model, String property, ColumnData config,
int rowIndex, int colIndex, ListStore<LayerAttribUI> store, Grid<LayerAttribUI> grid)
{
if (!init)
{
init = true;
grid.addListener(Events.ColumnResize, new Listener<GridEvent<LayerAttribUI>>()
{
public void handleEvent(GridEvent<LayerAttribUI> be)
{
for (int i = 0; i < be.getGrid().getStore().getCount(); i++)
{
if ((be.getGrid().getView().getWidget(i, be.getColIndex()) != null) &&
(be.getGrid().getView().getWidget(i, be.getColIndex()) instanceof BoxComponent))
{
((BoxComponent) be.getGrid().getView().getWidget(i,
be.getColIndex())).setWidth(be.getWidth() - 10);
}
}
}
});
}
LabelField attrName = new LabelField();
attrName.setWidth(150);
attrName.setReadOnly(true);
attrName.setValue(model.getName());
return attrName;
}
};
return textRendered;
}
示例5: createTypeTextBox
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
/**
* Creates the type text box.
*
* @return the grid cell renderer
*/
private GridCellRenderer<LayerAttribUI> createTypeTextBox()
{
GridCellRenderer<LayerAttribUI> textRendered = new GridCellRenderer<LayerAttribUI>()
{
private boolean init;
public Object render(final LayerAttribUI model, String property, ColumnData config,
int rowIndex, int colIndex, ListStore<LayerAttribUI> store, Grid<LayerAttribUI> grid)
{
if (!init)
{
init = true;
grid.addListener(Events.ColumnResize, new Listener<GridEvent<LayerAttribUI>>()
{
public void handleEvent(GridEvent<LayerAttribUI> be)
{
for (int i = 0; i < be.getGrid().getStore().getCount(); i++)
{
if ((be.getGrid().getView().getWidget(i, be.getColIndex()) != null) &&
(be.getGrid().getView().getWidget(i, be.getColIndex()) instanceof BoxComponent))
{
((BoxComponent) be.getGrid().getView().getWidget(i,
be.getColIndex())).setWidth(be.getWidth() - 10);
}
}
}
});
}
LabelField attrType = new LabelField();
attrType.setWidth(150);
attrType.setReadOnly(true);
attrType.setValue(model.getDataType());
return attrType;
}
};
return textRendered;
}
示例6: createProfileTextBox
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
/**
* Creates the style text box.
*
* @return the grid cell renderer
*/
private GridCellRenderer<UserGroupModel> createProfileTextBox()
{
GridCellRenderer<UserGroupModel> textRendered = new GridCellRenderer<UserGroupModel>()
{
private boolean init;
public Object render(final UserGroupModel model, String property, ColumnData config,
int rowIndex, int colIndex, ListStore<UserGroupModel> store, Grid<UserGroupModel> grid)
{
if (!init)
{
init = true;
grid.addListener(Events.ColumnResize, new Listener<GridEvent<UserGroupModel>>()
{
public void handleEvent(GridEvent<UserGroupModel> be)
{
for (int i = 0; i < be.getGrid().getStore().getCount(); i++)
{
if ((be.getGrid().getView().getWidget(i, be.getColIndex()) != null) &&
(be.getGrid().getView().getWidget(i, be.getColIndex()) instanceof BoxComponent))
{
((BoxComponent) be.getGrid().getView().getWidget(i,
be.getColIndex())).setWidth(be.getWidth() - 10);
}
}
}
});
}
LabelField profileName = new LabelField();
profileName.setWidth(150);
profileName.setReadOnly(true);
profileName.setValue(model.getName());
return profileName;
}
};
return textRendered;
}
示例7: createGrantsCustomField
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
/**
* Creates the grants custom field.
*
* @return the grid cell renderer
*/
private GridCellRenderer<RuleModel> createGrantsCustomField() {
GridCellRenderer<RuleModel> comboRendered = new GridCellRenderer<RuleModel>() {
private boolean init;
public Object render(final RuleModel model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<RuleModel> store, Grid<RuleModel> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize,
new Listener<GridEvent<RuleModel>>() {
public void handleEvent(GridEvent<RuleModel> be) {
for (int i = 0; i < be.getGrid().getStore()
.getCount(); i++) {
if ((be.getGrid().getView()
.getWidget(i, be.getColIndex()) != null)
&& (be.getGrid()
.getView()
.getWidget(
i,
be.getColIndex()) instanceof BoxComponent)) {
((BoxComponent) be
.getGrid()
.getView()
.getWidget(i,
be.getColIndex()))
.setWidth(be.getWidth() - 10);
}
}
}
});
}
// TODO: generalize this!
LabelField field = new LabelField();
field.setId("grantsCombo");
field.setName("grantsCombo");
field.setFieldLabel(BeanKeyValue.GRANT.getValue());
field.setReadOnly(false);
field.setWidth(COLUMN_GRANT_WIDTH - 10);
if (model.getGrant() != null) {
field.setValue(model.getGrant());
} else {
field.setValue("ALLOW");
}
field.setEmptyText("(No grant available)");
return field;
}
};
return comboRendered;
}
示例8: editRuleButton
import com.extjs.gxt.ui.client.widget.BoxComponent; //导入依赖的package包/类
/**
* Edits the rule button.
*
* @return the grid cell renderer
*/
private GridCellRenderer<RuleModel> editRuleButton() {
buttonRendered = new GridCellRenderer<RuleModel>() {
private boolean init;
public Object render(final RuleModel model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<RuleModel> store, final Grid<RuleModel> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize,
new Listener<GridEvent<RuleModel>>() {
public void handleEvent(GridEvent<RuleModel> be) {
for (int i = 0; i < be.getGrid().getStore()
.getCount(); i++) {
if ((be.getGrid().getView()
.getWidget(i, be.getColIndex()) != null)
&& (be.getGrid()
.getView()
.getWidget(
i,
be.getColIndex()) instanceof BoxComponent)) {
((BoxComponent) be
.getGrid()
.getView()
.getWidget(i,
be.getColIndex()))
.setWidth(be.getWidth() - 10);
}
}
}
});
}
// TODO: generalize this!
Button ruleDetailsButton = new Button("Edit rule");
ruleDetailsButton.setIcon(Resources.ICONS.table());
// TODO: add correct tooltip text here!
ruleDetailsButton.setToolTip("Edit this rule");
ruleDetailsButton.setEnabled(true);
ruleDetailsButton.addListener(Events.OnClick,
new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent be) {
Dispatcher.forwardEvent(
GeofenceEvents.EDIT_RULE_UPDATE,
new GridStatus(grid, model));
}
});
return ruleDetailsButton;
}
};
return buttonRendered;
}