本文整理汇总了Java中com.haulmont.cuba.gui.components.Component.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Component.setHeight方法的具体用法?Java Component.setHeight怎么用?Java Component.setHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.components.Component
的用法示例。
在下文中一共展示了Component.setHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expand
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void expand(Component component, String height, String width) {
if (expandedComponent != null && expandedComponent instanceof DesktopComponent) {
((DesktopComponent) expandedComponent).setExpanded(false);
}
// only Y direction
if (StringUtils.isEmpty(height) || AUTO_SIZE.equals(height) || height.endsWith("%")) {
component.setHeight("100%");
}
JComponent expandingChild = DesktopComponentsHelper.getComposition(component);
Pair<JPanel, BoxLayoutAdapter> wrapperInfo = wrappers.get(component);
if (wrapperInfo != null) {
expandingChild = wrapperInfo.getFirst();
}
layoutAdapter.expand(expandingChild, height, width);
if (component instanceof DesktopComponent) {
((DesktopComponent) component).setExpanded(true);
}
expandedComponent = component;
}
示例2: expand
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void expand(Component component, String height, String width) {
if (expandedComponent != null
&& expandedComponent instanceof DesktopComponent) {
((DesktopComponent) expandedComponent).setExpanded(false);
}
if (layoutAdapter.getFlowDirection() == BoxLayoutAdapter.FlowDirection.Y) {
if (StringUtils.isEmpty(height) || AUTO_SIZE.equals(height) || height.endsWith("%")) {
component.setHeight("100%");
}
} else if (layoutAdapter.getFlowDirection() == BoxLayoutAdapter.FlowDirection.X) {
if (StringUtils.isEmpty(width) || AUTO_SIZE.equals(width) || width.endsWith("%")) {
component.setWidth("100%");
}
}
JComponent expandingChild = DesktopComponentsHelper.getComposition(component);
Pair<JPanel, BoxLayoutAdapter> wrapperInfo = wrappers.get(component);
if (wrapperInfo != null) {
expandingChild = wrapperInfo.getFirst();
}
layoutAdapter.expand(expandingChild, height, width);
if (component instanceof DesktopComponent) {
((DesktopComponent) component).setExpanded(true);
}
expandedComponent = component;
}
示例3: adjustTabSize
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
protected void adjustTabSize(Component tabComponent) {
if (getWidth() >= 0) {
tabComponent.setWidth("100%");
} else {
tabComponent.setWidth(Component.AUTO_SIZE);
}
if (getHeight() >= 0) {
tabComponent.setHeight("100%");
} else {
tabComponent.setHeight(Component.AUTO_SIZE);
}
}
示例4: loadComponent
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void loadComponent() {
assignFrame(resultComponent);
assignXmlDescriptor(resultComponent, element);
loadVisible(resultComponent, element);
loadStyleName(resultComponent, element);
loadAlign(resultComponent, element);
loadScrollBars(resultComponent, element);
loadSpacing(resultComponent, element);
loadMargin(resultComponent, element);
loadHeight(resultComponent, element);
loadWidth(resultComponent, element);
loadIcon(resultComponent, element);
loadCaption(resultComponent, element);
loadDescription(resultComponent, element);
loadSubComponents();
for (Component child : resultComponent.getOwnComponents()) {
if (resultComponent.getOrientation() == ScrollBoxLayout.Orientation.VERTICAL && ComponentsHelper.hasFullHeight(child)) {
child.setHeight("-1px");
log.warn("100% height of " + child.getClass().getSimpleName() + " id=" + child.getId()
+ " inside vertical scrollBox replaced with -1px height");
}
if (resultComponent.getOrientation() == ScrollBoxLayout.Orientation.HORIZONTAL && ComponentsHelper.hasFullWidth(child)) {
child.setWidth("-1px");
log.warn("100% width of " + child.getClass().getSimpleName() + " id=" + child.getId()
+ " inside horizontal scrollBox replaced with -1px width");
}
}
}