/** * Default constructor. * * @param cmrRepositoryDefinition {@link CmrRepositoryDefinition} */ public SelectCmrAction(CmrRepositoryDefinition cmrRepositoryDefinition) { this.cmrRepositoryDefinition = cmrRepositoryDefinition; setText(cmrRepositoryDefinition.getName()); setImageDescriptor( ImageDescriptor.createFromImage( ImageFormatter.getCmrRepositoryImage(cmrRepositoryDefinition, true))); }
/** Updates the form title. Sub-classes can extend if needed. */ protected void updateFormTitle() { if (null != displayedCmrRepositoryDefinition) { mainForm.setImage( ImageFormatter.getCmrRepositoryImage(displayedCmrRepositoryDefinition, true)); mainForm.setText(displayedCmrRepositoryDefinition.getName()); mainForm.setToolTipText( TextFormatter.getCmrRepositoryDescription(displayedCmrRepositoryDefinition)); mainForm.setMessage(null); } else { mainForm.setImage(null); mainForm.setText("No repository exists"); mainForm.setMessage( "Repositories can be added from the Repository Manager", IMessageProvider.WARNING); mainForm.setToolTipText(null); } }