tlbrbtnChemisrty = new ToolbarButton("CHEMISRTY DIAGRAMS\r\n");
tlbrbtnChemisrty.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
chem=new Toolbar();
chem.setAutoWidth(false);
absolutePanel_1.add(chem, 15, 132);
chem.setSize("850px", "35px");
textBoxchem = new TextBox();
absolutePanel.add(textBoxchem, 74, 128);
periodic=new ToolbarButton();
periodic.setText("View Periodic Table");
periodic.setTooltip("Periodic Table");
periodic.setCls("a");
periodic.setToggleGroup("");
periodic.setIcon("");
chem.addButton(periodic);
periodic.setSize("34px", "35px");
periodic.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
funperiodic();
}
});
insertimage=new ToolbarButton();
insertimage.setText("Insert image");
insertimage.setTooltip("insert image");
insertimage.setToggleGroup("");
insertimage.setIcon("");
chem.addButton(insertimage);
insertimage.setCls("italic:hover");
insertimage.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
sschem=textBoxchem.getText();
System.out.println(sschem);
s1chem=richTextArea.getText();
fun(sschem);
flagchem=true;
}
});
getimage=new ToolbarButton();
getimage.setText("Get image");
getimage.setTooltip("Get image");
getimage.setToggleGroup("");
getimage.setIcon("");
chem.addButton(getimage);
getimage.setCls("under:hover");
getimage.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
if(flagchem==true)
{
richTextArea.getExtendedFormatter().insertImage("http://localhost:8082/image2.php?name="+sschem+"");
}
}
});
panel.add(absolutePanel,84,267);
}
});
toolbar.addButton(tlbrbtnChemisrty);
toolbar.addSeparator();
tlbrbtnChemisrty.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
chem=new Toolbar();
chem.setAutoWidth(false);
absolutePanel_1.add(chem, 15, 132);
chem.setSize("850px", "35px");
textBoxchem = new TextBox();
absolutePanel.add(textBoxchem, 74, 128);
periodic=new ToolbarButton();
periodic.setText("View Periodic Table");
periodic.setTooltip("Periodic Table");
periodic.setCls("a");
periodic.setToggleGroup("");
periodic.setIcon("");
chem.addButton(periodic);
periodic.setSize("34px", "35px");
periodic.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
funperiodic();
}
});
insertimage=new ToolbarButton();
insertimage.setText("Insert image");
insertimage.setTooltip("insert image");
insertimage.setToggleGroup("");
insertimage.setIcon("");
chem.addButton(insertimage);
insertimage.setCls("italic:hover");
insertimage.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
sschem=textBoxchem.getText();
System.out.println(sschem);
s1chem=richTextArea.getText();
fun(sschem);
flagchem=true;
}
});
getimage=new ToolbarButton();
getimage.setText("Get image");
getimage.setTooltip("Get image");
getimage.setToggleGroup("");
getimage.setIcon("");
chem.addButton(getimage);
getimage.setCls("under:hover");
getimage.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
if(flagchem==true)
{
richTextArea.getExtendedFormatter().insertImage("http://localhost:8082/image2.php?name="+sschem+"");
}
}
});
panel.add(absolutePanel,84,267);
}
});
toolbar.addButton(tlbrbtnChemisrty);
toolbar.addSeparator();