java togglebutton_Java ToggleButton.setId方法代码示例
import javafx.scene.control.ToggleButton; //导入方法依赖的package包/类
private Node createToolBarControls() {
ToggleButton agendaOnlyButton = new ToggleButton();
ToggleButton dayOnlyButton = new ToggleButton();
ToggleButton standardButton = new ToggleButton();
Text listIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.LIST);
listIcon.getStyleClass().addAll("button-icon");
agendaOnlyButton.setGraphic(listIcon);
agendaOnlyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
Text calendarIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.CALENDAR);
calendarIcon.getStyleClass().addAll("button-icon");
dayOnlyButton.setGraphic(calendarIcon);
dayOnlyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
Text standardIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.COLUMNS);
standardIcon.getStyleClass().addAll("button-icon");
standardButton.setGraphic(standardIcon);
standardButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
agendaOnlyButton.setOnAction(evt -> setDayPageLayout(DayPageLayout.AGENDA_ONLY));
dayOnlyButton.setOnAction(evt -> setDayPageLayout(DayPageLayout.DAY_ONLY));
standardButton.setOnAction(evt -> setDayPageLayout(DayPageLayout.STANDARD));
SegmentedButton segmentedButton = new SegmentedButton(agendaOnlyButton, standardButton, dayOnlyButton);
segmentedButton.getStyleClass().add("layout-button"); //$NON-NLS-1$
segmentedButton.visibleProperty().bind(showDayPageLayoutControlsProperty());
switch (getDayPageLayout()) {
case AGENDA_ONLY:
agendaOnlyButton.setSelected(true);
break;
case DAY_ONLY:
dayOnlyButton.setSelected(true);
break;
case STANDARD:
standardButton.setSelected(true);
break;
default:
break;
}
agendaOnlyButton.setTooltip(new Tooltip(Messages.getString("DayPage.TOOLTIP_MAXIMIZE_AGENDA_LIST"))); //$NON-NLS-1$
dayOnlyButton.setTooltip(new Tooltip(Messages.getString("DayPage.TOOLTIP_MAXIMIZE_DAY_VIEW"))); //$NON-NLS-1$
standardButton.setTooltip(new Tooltip(Messages.getString("DayPage.TOOLTIP_STANDARD_LAYOUT"))); //$NON-NLS-1$
ToggleButton layoutButton = new ToggleButton();
layoutButton.setTooltip(new Tooltip(Messages.getString("DayPage.TOOLTIP_LAYOUT"))); //$NON-NLS-1$
layoutButton.setId("layout-button");
Text layoutIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.TABLE);
layoutIcon.getStyleClass().addAll("button-icon", "layout-button-icon"); //$NON-NLS-1$ //$NON-NLS-2$
layoutButton.setGraphic(layoutIcon);
layoutButton.setSelected(getLayout().equals(Layout.SWIMLANE));
layoutButton.setOnAction(evt -> {
if (layoutButton.isSelected()) {
setLayout(Layout.SWIMLANE);
} else {
setLayout(Layout.STANDARD);
}
});
toolbarControls = new HBox();
toolbarControls.setSpacing(10);
updateToolBarControls(segmentedButton, layoutButton);
showLayoutButtonProperty().addListener(it -> updateToolBarControls(segmentedButton, layoutButton));
return toolbarControls;
}
java togglebutton_Java ToggleButton.setId方法代码示例相关推荐
- java kryo_Kryo框架使用方法代码示例
Kryo框架的source已移至https://github.com/EsotericSoftware/kryo ,进入此页面,然后点击右边的Download Zip按钮,就能下载到最新版本的Kryo ...
- java readtimeout_Java HttpURLConnection.getReadTimeout方法代码示例
import java.net.HttpURLConnection; //导入方法依赖的package包/类 /** * 得到响应对象 * * @param urlConnection * @retu ...
- java invalidate_Java Component.invalidate方法代码示例
import java.awt.Component; //导入方法依赖的package包/类 /** Installs the component we will embed to display t ...
- java hasmoreelements_Java IOException.hasMoreElements方法代码示例
import java.io.IOException; //导入方法依赖的package包/类 /** * fileName���� ���� package �������� ������ ���� ...
- java methode_Java Method.getTypeParameters方法代码示例
import java.lang.reflect.Method; //导入方法依赖的package包/类 private void validateRuleMethod(MethodRuleDefin ...
- java facets_Java UIComponent.getFacets方法代码示例
import javax.faces.component.UIComponent; //导入方法依赖的package包/类 @SuppressWarnings("unchecked" ...
- java setmethod_Java Operation.setJavaMethod方法代码示例
import com.sun.tools.internal.ws.processor.model.Operation; //导入方法依赖的package包/类 private void createJ ...
- java cancel_Java RunnableFuture.cancel方法代码示例
import java.util.concurrent.RunnableFuture; //导入方法依赖的package包/类 @Test public void testSnapshotAsyncC ...
- java getevent_Java ActionEvent.getWhen方法代码示例
import java.awt.event.ActionEvent; //导入方法依赖的package包/类 @Override final public void actionPerformed(A ...
最新文章
- laytpl语法_layui语法基础
- 2018年各大互联网前端面试题四(美团)
- 【python】解决[SSL: CERTIFICATE_VERIFY_FAILED]
- linux pipe 文件,Linux系统常用指令、管道(pipe)、文件查找(find)
- mysql应用层透明扩展_MySQL高扩展和高可用
- 【BZOJ 2301】[HAOI2011]Problem b
- netsuite和java_Netsuite - 如何根据项目和位置搜索填充子列表
- 怎样调整服务器C盘空间
- 杭电ACM2046题
- 多线程相关知识点详解
- android百度地图多路线规划,android百度地图开发之步行路线规划
- MATLAB变声器程序
- TIA protal与SCL从入门到精通(4)——软件单元使用
- Java导出多个excel并且打包成zip压缩文件
- K8S部署机器学习平台
- quill光标位置插入html,quill编辑器+word文档上传,插入指定位置
- 如何修改tomcat默认的8080端口号
- RFID智能档案管理系统 设计方案
- 二维码背后的隐忧:扫码点单之后,谁从餐桌上拿走了你的信息?
- 防火墙添加ip白名单_如何增加网址白名单、IP白名单、策略白名单、协同防御白名单?...