/** * {@inheritDoc} */ @Override protected StyledString getStyledText(Object element, int index) { if (element instanceof IApplicationProvider) { ApplicationDefinition appDef = ((IApplicationProvider) element).getApplication(); switch (index) { case 0: return new StyledString(appDef.getApplicationName()); case 1: return new StyledString(String.valueOf(appDef.getBusinessTransactionDefinitions().size())); case 2: return new StyledString(TextFormatter.clearLineBreaks(StringUtils.defaultString(appDef.getDescription()))); default: return EMPTY; } } return EMPTY; }
/** * Sets the agent name. * * @param agentName * Agent name. * @param agentImg * Image to go next to the agent name. If <code>null</code> is passed no changed to * the current image will be done. */ public void setAgent(String agentName, Image agentImg) { agentLabel.setText(TextFormatter.clearLineBreaks(TextFormatter.crop(agentName, MAX_TEXT_LENGTH))); agentLabel.setToolTipText(agentName); if (null != agentImg) { agentLabel.setImage(agentImg); } }
/** * Sets the description. * * @param view * View description. * @param viewImg * Image to go next to the view description. If <code>null</code> is passed no * changed to the current image will be done. */ public void setView(String view, Image viewImg) { viewLabel.setText(TextFormatter.clearLineBreaks(view)); viewLabel.setToolTipText(view); if (null != viewImg) { viewLabel.setImage(viewImg); } layoutInternal(); }
stringBuilder.append(parameterContentData.getName()); stringBuilder.append("': "); stringBuilder.append(TextFormatter.clearLineBreaks(parameterContentData.getContent())); stringBuilder.append('\t'); lineAdded = true;
/** * Sets the title text and image. * * @param group * Group description. * @param groupdImg * Image to go next to the title. If <code>null</code> is passed no changed to the * current image will be done. */ public void setGroup(String group, Image groupdImg) { groupLabel.setText(TextFormatter.clearLineBreaks(TextFormatter.crop(group, MAX_TEXT_LENGTH))); groupLabel.setToolTipText(group); if (null != groupdImg) { groupLabel.setImage(groupdImg); } layoutInternal(); }
/** * {@inheritDoc} */ @Override protected StyledString getStyledText(Object element, int index) { if (element instanceof IEnvironmentProvider) { Environment environment = ((IEnvironmentProvider) element).getEnvironment(); switch (index) { case 0: return new StyledString(environment.getName()); case 1: if (null != environment.getUpdatedDate()) { return new StyledString(NumberFormatter.formatTime(environment.getUpdatedDate())); } else { return new StyledString(NumberFormatter.formatTime(environment.getCreatedDate())); } case 2: if (CollectionUtils.isEmpty(environment.getProfileIds())) { return new StyledString(String.valueOf(0)); } else { return new StyledString(String.valueOf(environment.getProfileIds().size())); } case 3: return TextFormatter.emptyStyledStringIfNull(TextFormatter.clearLineBreaks(environment.getDescription())); default: return EMPTY; } } return EMPTY; }
styledString = new StyledString(TextFormatter.crop(TextFormatter.clearLineBreaks(errorMessage), MAX_ERROR_MSG_SIZE)); } else {
String sql = TextFormatter.clearLineBreaks(data.getSqlWithParameterValues()); return new StyledString(sql); } else { String sql = TextFormatter.clearLineBreaks(data.getSql()); return new StyledString(sql);
/** * Sets {@link #repositoryDefinition}. * * @param repositoryDefinition * New value for {@link #repositoryDefinition} */ public void setRepositoryDefinition(RepositoryDefinition repositoryDefinition) { this.repositoryDefinition = repositoryDefinition; repositoryLabel.setText(TextFormatter.clearLineBreaks(TextFormatter.crop(repositoryDefinition.getName(), MAX_TEXT_LENGTH))); if (repositoryDefinition instanceof CmrRepositoryDefinition) { repositoryLabel.setImage(ImageFormatter.getCmrRepositoryImage((CmrRepositoryDefinition) repositoryDefinition, true)); InspectIT.getDefault().getCmrRepositoryManager().addCmrRepositoryChangeListener(this); } else if (repositoryDefinition instanceof StorageRepositoryDefinition) { repositoryLabel.setImage(ImageFormatter.getStorageRepositoryImage((StorageRepositoryDefinition) repositoryDefinition)); InspectIT.getDefault().getInspectITStorageManager().addStorageChangeListener(this); } }
/** * {@inheritDoc} */ @Override protected StyledString getStyledText(Object element, int index) { if (element instanceof IProfileProvider) { Profile profile = ((IProfileProvider) element).getProfile(); switch (index) { case 0: return new StyledString(profile.getName()); case 1: if (null != profile.getUpdatedDate()) { return new StyledString(NumberFormatter.formatTime(profile.getUpdatedDate())); } else { return new StyledString(NumberFormatter.formatTime(profile.getCreatedDate())); } case 5: return TextFormatter.emptyStyledStringIfNull(TextFormatter.clearLineBreaks(profile.getDescription())); default: return EMPTY; } } return EMPTY; }
styledString = new StyledString(); if (InvocationSequenceDataHelper.hasSQLData(data)) { styledString.append(TextFormatter.clearLineBreaks(data.getSqlStatementData().getSqlWithParameterValues())); styledString.append(parameterContentData.getName()); styledString.append("': "); styledString.append(TextFormatter.clearLineBreaks(parameterContentData.getContent()));