private void createToolbar() { toolbar = new ToolBar(this, "toolbar"); ToolBarGroup grpDefault = toolbar.addGroup(); grpDefault.addAction(actionClose); grpDefault.addAction(actionSaveClose); grpDefault.addAction(actionSave); grpDefault.addAction(actionEdit); }
/** Setup the ActionBar. */ private void setupActionBar() { ToolBar abar = new ToolBar(this, "actionBar"); ToolBarGroup group = abar.addGroup(); Button btReturn = group.addButton(); btReturn.setIconEnabled(ImageLibrary.IMAGE_RETURN); btReturn.setTitle("Return"); btReturn.setConfirmMsg("Changes will get lost!"); btReturn.addSelectionListener( new SelectionListener() { public void objectSelected(SelectionEvent event) { close(); } }); btSave = group.addButton(); btSave.setIconEnabled(ImageLibrary.IMAGE_TABLE_SAVE); btSave.setTitle("Save & Close"); btSave.addSelectionListener( new SelectionListener() { public void objectSelected(SelectionEvent event) { onSaveAndClose(); } }); Button btAdd = group.addButton(); btAdd.setTitle("Create Element"); btAdd.setIconEnabled(ImageLibrary.IMAGE_ADD); btAdd.addSelectionListener( new SelectionListener() { public void objectSelected(SelectionEvent event) { mapEditor.createNewElement(); } }); Button btSortEx = group.addButton(); btSortEx.setTitle("Sort By Expression"); btSortEx.setIconEnabled(ImageLibrary.IMAGE_REFRESH); btSortEx.addSelectionListener( new SelectionListener() { public void objectSelected(SelectionEvent event) { onSortMappings(true); } }); Button btSortPath = group.addButton(); btSortPath.setTitle("Sort By Element"); btSortPath.setIconEnabled(ImageLibrary.IMAGE_REFRESH); btSortPath.addSelectionListener( new SelectionListener() { public void objectSelected(SelectionEvent event) { onSortMappings(false); } }); Button btDeleteAll = group.addButton(); btDeleteAll.setTitle("Delete All"); btDeleteAll.setConfirmMsg("Do you really want to delete ALL mapping entries?"); btDeleteAll.setIconEnabled(ImageLibrary.IMAGE_SCRIPT_DELETE); btDeleteAll.addSelectionListener( new SelectionListener() { public void objectSelected(SelectionEvent event) { onDeleteAll(); } }); }