initOpenBlocks();
}
private void initOpenBlocks()
{
final Context context = Context.getContext();
/*
WorkspaceController workspaceController = context.getWorkspaceController();
JComponent workspaceComponent = workspaceController.getWorkspacePanel();
*/
final Workspace workspace = context.getWorkspace();
// WTF I can't add worksapcelistener by workspace contrller
workspace.addWorkspaceListener(new ArdublockWorkspaceListener(this));
JPanel buttons = new JPanel();
buttons.setLayout(new FlowLayout());
JButton newButton = new JButton(uiMessageBundle.getString("ardublock.ui.new"));
newButton.addActionListener(new NewButtonListener(this));
JButton saveButton = new JButton(uiMessageBundle.getString("ardublock.ui.save"));
saveButton.addActionListener(new SaveButtonListener(this));
JButton saveAsButton = new JButton(uiMessageBundle.getString("ardublock.ui.saveAs"));
saveAsButton.addActionListener(new SaveAsButtonListener(this));
JButton openButton = new JButton(uiMessageBundle.getString("ardublock.ui.load"));
openButton.addActionListener(new OpenButtonListener(this));
JButton generateButton = new JButton(uiMessageBundle.getString("ardublock.ui.upload"));
generateButton.addActionListener(new GenerateCodeButtonListener(this, context));
JButton serialMonitorButton = new JButton(uiMessageBundle.getString("ardublock.ui.serialMonitor"));
serialMonitorButton.addActionListener(new ActionListener () {
public void actionPerformed(ActionEvent e) {
context.getEditor().handleSerial();
}
});
JButton saveImageButton = new JButton(uiMessageBundle.getString("ardublock.ui.saveImage"));
saveImageButton.addActionListener(new ActionListener () {
public void actionPerformed(ActionEvent e) {