/* * Smart GWT (GWT for SmartClient) * Copyright 2008 and beyond, Isomorphic Software, Inc. * * Smart GWT is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 * as published by the Free Software Foundation. Smart GWT is also * available under typical commercial license terms - see * http://smartclient.com/license * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import com.smartgwt.client.types.SelectionType; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.toolbar.ToolStrip; import com.smartgwt.client.widgets.toolbar.ToolStripButton; import com.google.gwt.core.client.EntryPoint; public class ToolStripVerticalSample implements EntryPoint { public void onModuleLoad() { ToolStrip toolStrip = new ToolStrip(); toolStrip.setVertical(true); toolStrip.setHeight(160); toolStrip.setWidth(30); ToolStripButton iconButton = new ToolStripButton(); iconButton.setIcon("silk/printer.png"); iconButton.setPrompt("Print"); toolStrip.addButton(iconButton); toolStrip.addResizer(); ToolStripButton boldButton = new ToolStripButton(); boldButton.setIcon("[SKIN]/RichTextEditor/text_bold.png"); boldButton.setActionType(SelectionType.CHECKBOX); toolStrip.addButton(boldButton); ToolStripButton italicsButton = new ToolStripButton(); italicsButton.setIcon("[SKIN]/RichTextEditor/text_italic.png"); italicsButton.setActionType(SelectionType.CHECKBOX); toolStrip.addButton(italicsButton); ToolStripButton underlineButton = new ToolStripButton(); underlineButton.setIcon("[SKIN]/RichTextEditor/text_underline.png"); underlineButton.setActionType(SelectionType.CHECKBOX); toolStrip.addButton(underlineButton); toolStrip.addSeparator(); ToolStripButton alignLeftButton = new ToolStripButton(); alignLeftButton.setIcon("[SKIN]/RichTextEditor/text_align_left.png"); alignLeftButton.setActionType(SelectionType.RADIO); alignLeftButton.setRadioGroup("textAlign"); toolStrip.addButton(alignLeftButton); ToolStripButton alignRightButton = new ToolStripButton(); alignRightButton.setIcon("[SKIN]/RichTextEditor/text_align_right.png"); alignRightButton.setActionType(SelectionType.RADIO); alignRightButton.setRadioGroup("textAlign"); toolStrip.addButton(alignRightButton); ToolStripButton alignCenterButton = new ToolStripButton(); alignCenterButton.setIcon("[SKIN]/RichTextEditor/text_align_center.png"); alignCenterButton.setActionType(SelectionType.RADIO); alignCenterButton.setRadioGroup("textAlign"); toolStrip.addButton(alignCenterButton); //push all buttons to the top toolStrip.addFill(); toolStrip.draw(); } }