private void controls() {
ToolbarButton save = new ToolbarButton();
save.setText( constants.SaveChanges() );
save.setTooltip( getTip( constants.CommitAnyChangesForThisAsset() ) );
save.addListener( new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button,
EventObject e) {
verifyAndDoCheckinConfirm( button,
false );
}
} );
toolbar.addButton( save );
ToolbarButton saveAndClose = new ToolbarButton();
saveAndClose.setText( constants.SaveAndClose() );
saveAndClose.setTooltip( getTip( constants.CommitAnyChangesForThisAsset() ) );
saveAndClose.addListener( new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button,
EventObject e) {
verifyAndDoCheckinConfirm( button,
true );
}
} );
toolbar.addButton( saveAndClose );
savedOK = new SmallLabel( "<font color='green'>" + constants.SavedOK() + "</font>" );
savedOK.setVisible( false );
toolbar.addElement( savedOK.getElement() );
toolbar.addFill();
toolbar.addSeparator();
Menu moreMenu = new Menu();
moreMenu.addItem( new Item( constants.Copy(),
new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem baseItem,
EventObject eventObject) {
copyCommand.execute();
}
} ) );
moreMenu.addItem( new Item( constants.PromoteToGlobal(),
new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem baseItem,
EventObject eventObject) {
promptCommand.execute();
}
} ) );
moreMenu.addItem( new Item( constants.Archive(),
new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem baseItem,
EventObject eventObject) {
if ( Window.confirm( constants.AreYouSureYouWantToArchiveThisItem() + "\n" + constants.ArchiveThisAssetThisWillNotPermanentlyDeleteIt() ) ) {
archiveAction.execute();
}
}
} ) );
final Item deleteItem = new Item( constants.Delete(),
new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem baseItem,
EventObject eventObject) {
if ( Window.confirm( constants.DeleteAreYouSure() ) ) {
deleteAction.execute();
}
}
} );
moreMenu.addItem( deleteItem );
deleteItem.setTitle( constants.DeleteAssetTooltip() );
this.afterCheckinEvent = new Command() {
public void execute() {
deleteItem.setDisabled( true );
}
};
if ( !notCheckedInYet() ) {
deleteItem.setDisabled( true );
}
moreMenu.addItem( new Item( constants.ChangeStatus(),
new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem baseItem,
EventObject eventObject) {
showStatusChanger();
}
} ) );
ToolbarMenuButton more = new ToolbarMenuButton( constants.Actions(),
moreMenu );
if ( isValidatorTypeAsset() ) {
if ( editor instanceof RuleModelEditor ) {
ToolbarButton workingSets = new ToolbarButton();
workingSets.setText( constants.SelectWorkingSets() );
workingSets.addListener( new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button,
EventObject e) {
showWorkingSetsSelection( ((RuleModelEditor) editor).getRuleModeller() );
}
} );
toolbar.addButton( workingSets );
}
ToolbarButton validate = new ToolbarButton();
validate.setText( constants.Validate() );
validate.addListener( new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button,
EventObject e) {
doValidate();
}
} );
toolbar.addButton( validate );
if ( isVerificationTypeAsset() ) {
ToolbarButton verify = new ToolbarButton();
verify.setText( constants.Verify() );
verify.addListener( new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button,
EventObject e) {
doVerify();
}
} );
toolbar.addButton( verify );
}
if ( shouldShowViewSource() ) {
ToolbarButton viewSource = new ToolbarButton();
viewSource.setText( constants.ViewSource() );
viewSource.addListener( new ButtonListenerAdapter() {
public void onClick(com.gwtext.client.widgets.Button button,
EventObject e) {
doViewsource();
}
} );