Tuesday, 3 May 2011

Toolbar in gwt-ext

toolbar = new Toolbar();

tlbrbtnToolBar = new ToolbarButton("TOOL BAR");

tlbrbtnToolBar.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {


formatter=richTextArea.getExtendedFormatter();

tt=new Toolbar();

tt.setAutoWidth(false);
absolutePanel_1.add(tt, 15, 132);

tt.setSize("850px", "35px");


bold=new ToolbarButton();

bold.setText("");
bold.setTooltip("Bold");
bold.setCls("a");
bold.setToggleGroup("");
bold.setIcon("images/bold.gif");
tt.addButton(bold);
bold.setSize("34px", "35px");



italic=new ToolbarButton();
italic.setText("");
italic.setTooltip("Italic");
italic.setToggleGroup("");
italic.setIcon("images/italic.gif");

tt.addButton(italic);
italic.setCls("italic:hover");


underline=new ToolbarButton();
underline.setText("");
underline.setTooltip("Underline");
underline.setToggleGroup("");
underline.setIcon("images/underline.gif");
tt.addButton(underline);
underline.setCls("under:hover");



ToolbarSpacer toolbarSpacer = new ToolbarSpacer();
tt.addItem(toolbarSpacer);
tt.addSeparator();

growtext = new ToolbarButton("");
growtext.setTooltip("GrowText");
growtext.setIcon("images/grow-font.png");
tt.addButton(growtext);

shrinktext = new ToolbarButton("");
shrinktext.setTooltip("shrinkText");
shrinktext.setIcon("images/shrink-font.png");

tt.addButton(shrinktext);
tt.addSeparator();

forecolor = new ToolbarButton("");
forecolor .setTooltip("ForeColor ");
forecolor.setIcon("images/foreColors.gif");
forecolor.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
colorPalette.setVisible(true);

}
});
tt.addButton(forecolor);

backcolor = new ToolbarButton("");
backcolor.setTooltip("BackColor");
backcolor.setIcon("images/backColors.gif");
backcolor.addListener(new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
colorPalette1.setVisible(true);
}
});
tt.addButton(backcolor);
tt.addSeparator();

leftjustification=new ToolbarButton();
leftjustification.setToggleGroup("");
leftjustification.setTooltip("left");
leftjustification.setText("");
leftjustification.setIcon("images/justifyLeft.gif");

tt.addButton(leftjustification);


centerjustification=new ToolbarButton();
centerjustification.setTooltip("Center");
centerjustification.setIcon("images/justifyCenter.gif");
centerjustification.setTooltip("Center");

tt.addButton(centerjustification);

rightjustification=new ToolbarButton();
rightjustification.setIcon("images/justifyRight.gif");
rightjustification.setTooltip("Right");

tt.addButton(rightjustification);
tt.addSeparator();

link = new ToolbarButton("");
link.setIcon("images/LinkIcon.gif");
tt.addButton(link);

uploadfile = new ToolbarButton("");
uploadfile.setTooltip("Upload");
uploadfile.setIcon("images/upload.jpg");
tt.addButton(uploadfile);

tt.addSeparator();

superscript = new ToolbarButton("");
superscript.setTooltip("SuperScript");
superscript.setIcon("images/superscript.gif");

tt.addButton(superscript);

subscript = new ToolbarButton("");
subscript.setTooltip("SubScript");
subscript.setIcon("images/subscript.gif");

tt.addButton(subscript);
}
);

No comments:

Post a Comment