@Override public String toString() { return "ChangeRequirementButton[jobBuilder=" + LabelUtils.getLabel(_componentBuilder) + "]"; } }
/** * Overrideable method for defining a cell's literal HTML value in the table * * @param context * @param row * @param col * @param value * @return */ protected String getCellValue(final HtmlRenderingContext context, final int row, final int col, final Object value) { final String stringValue = LabelUtils.getValueLabel(value); return context.escapeHtml(stringValue); } }
/** * This will check if components are in a different scope, and ask the user * for permission to change the scope of the target component * * @return true if permitted or irrelevant, false if user refused a * necessary scope change. */ private boolean scopeUpdatePermitted(final AnalysisJobBuilder sourceAnalysisJobBuilder, final ComponentBuilder componentBuilder) { if (sourceAnalysisJobBuilder != componentBuilder.getAnalysisJobBuilder()) { if (componentBuilder.getInput().length > 0 || componentBuilder.getComponentRequirement() != null) { final String scopeText; scopeText = LabelUtils.getScopeLabel(sourceAnalysisJobBuilder); final int response = JOptionPane.showConfirmDialog(_graphContext.getVisualizationViewer(), "This will move " + LabelUtils.getLabel(componentBuilder) + " into the " + scopeText + ", thereby losing its configured columns and/or requirements", "Change scope?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if (response == JOptionPane.CANCEL_OPTION) { _graphContext.getJobGraph().refresh(); return false; } } } return true; }
_radioButtons = new JRadioButton[1]; final JRadioButton radioButton = new JRadioButton( "<html><font color=\"gray\">- no <i>" + LabelUtils.getDataTypeLabel(_dataType) + "</i> columns available -</font></html>"); radioButton.setOpaque(false);
/** * Will find the {@link ComponentBuilder} that publishes records (via an * {@link OutputDataStream}) to a certain {@link AnalysisJobBuilder}. * * @param analysisJobBuilder * the {@link AnalysisJobBuilder} to find the publisher for. * @return */ public ComponentBuilder findComponentBuilder(final AnalysisJobBuilder analysisJobBuilder) { if (analysisJobBuilder == _rootJobBuilder) { return null; } for (final ComponentBuilder osComponenBuilder : getComponentBuildersWithOutputDataStreams(_rootJobBuilder)) { for (final OutputDataStream outputDataStream : osComponenBuilder.getOutputDataStreams()) { final AnalysisJobBuilder osJobBuilder = osComponenBuilder.getOutputDataStreamJobBuilder(outputDataStream); if (osJobBuilder == analysisJobBuilder) { return osComponenBuilder; } } } throw new IllegalArgumentException( "No component publishing to " + LabelUtils.getScopeLabel(analysisJobBuilder)); }
final String dataTypeString = LabelUtils.getDataTypeLabel(dataType); model.setValueAt(dataTypeString, i, 1);
/** * Gets the label of a component job * * @param job * @return */ public static String getLabel(final ComponentJob job) { return getLabel(job, false, true, true); }
@Override public void valueCell(final Object value, final ResultProducer drillToDetailResultProducer) { boolean leftAligned = this.leftAligned; String stringValue = (value == null ? null : value.toString()); stringValue = LabelUtils.getValueLabel(stringValue); if (value instanceof Number) { leftAligned = false; if (value instanceof Double || value instanceof Float) { stringValue = decimalFormat.format(value); } } final int trailingBlanks = horizontalDimensionWidth - stringValue.length(); if (leftAligned) { sb.append(stringValue); for (int i = 0; i < trailingBlanks; i++) { sb.append(' '); } } else { for (int i = 0; i < trailingBlanks; i++) { sb.append(' '); } sb.append(stringValue); } // separator sb.append(' '); }
} else { _notAvailableCheckBox = new DCCheckBox<>( "<html><font color=\"gray\">- no <i>" + LabelUtils.getDataTypeLabel(_dataType) + "</i> columns available -</font></html>", false);
@Override public String toString() { return "ComponentScopeMenuBuilder[componentBuilder=" + LabelUtils.getLabel(_componentBuilder) + "]"; }
public String toHtml(final Object value) { String valueLabel = LabelUtils.getValueLabel(value); valueLabel = htmlRenderingContext.escapeHtml(valueLabel); if (value instanceof Number) { // mark the decimal point final DecimalFormatSymbols decimalFormatSymbols = DecimalFormatSymbols.getInstance(); final char decimalSeparator = decimalFormatSymbols.getDecimalSeparator(); final int indexOfDecimalSeparator = valueLabel.lastIndexOf(decimalSeparator); if (indexOfDecimalSeparator != -1) { // add a <span class="decimal"></span> around the decimal part. valueLabel = valueLabel.substring(0, indexOfDecimalSeparator) + "<span class=\"decimal\">" + valueLabel .substring(indexOfDecimalSeparator) + "</span>"; } } return valueLabel; }
@Override public String getName() { return LabelUtils.getLabel(_value); }
sb.append(metricDescriptor.getName()); sb.append(": "); sb.append(LabelUtils.getValueLabel(value)); count++; sb.append(suggestion); sb.append("): "); sb.append(LabelUtils.getValueLabel(value));
private String getHeaderText() { return LabelUtils.getLabel(_componentJob, false, false, false); }
@Override public void valueCell(final Object value, final ResultProducer drillToDetailResultProducer) { if (drillToDetailResultProducer == null) { simpleValueCell(value); return; } final AnalyzerResult drillResult = drillToDetailResultProducer.getResult(); if (drillResult == null) { simpleValueCell(value); return; } if (drillResult instanceof AnnotatedRowsResult && ((AnnotatedRowsResult) drillResult).getAnnotatedRowCount() == 0) { simpleValueCell(value); return; } final String drillElementId = htmlRenderingContext.createElementId(); final DrillToDetailsBodyElement drillBodyElement = new DrillToDetailsBodyElement(drillElementId, rendererFactory, drillResult); htmlFragtment.addBodyElement(drillBodyElement); final String invocation = drillBodyElement.toJavaScriptInvocation(); sb.append("<td class=\"value\">"); sb.append("<a class=\"drillToDetailsLink\" href=\"#\" onclick=\"" + invocation + "\">"); sb.append(toHtml(LabelUtils.getValueLabel(value))); sb.append("</a>"); sb.append("</td>"); }
private String getSubHeaderText(final ComponentJob componentJob, final String headerText) { String subHeaderString = LabelUtils.getLabel(componentJob, true, true, true); final int indexOfHeader = subHeaderString.indexOf(headerText); if (indexOfHeader != -1) { // remove the redundant part of both headers subHeaderString = subHeaderString.substring(indexOfHeader + headerText.length()); } return subHeaderString; }
private void writeGenericError(final Writer writer, final ComponentJob componentJob, final AnalyzerResult analyzerResult, final Exception e) throws IOException { writer.write("<div class=\"error\">"); writer.write("<p>Component job: " + LabelUtils.getLabel(componentJob) + "</p>"); if (analyzerResult != null) { writer.write("<p>Analyzer result: " + analyzerResult + "</p>"); } writer.write("<pre>"); final PrintWriter printWriter = new PrintWriter(writer); e.printStackTrace(printWriter); writer.write("</pre>"); writer.write("</div>"); }
protected void writeHeader(final Writer writer, final ComponentJob componentJob, final HtmlRenderingContext context, final HtmlFragment htmlFragment) throws IOException { final String label = LabelUtils.getLabel(componentJob); writer.write("<div class=\"analyzerResultHeader\">"); writer.write("<h2>" + context.escapeHtml(label) + "</h2>"); writer.write("</div>"); }
private String getBannerTitle2(final boolean onlyIfDifferentThanTitle1) { final String title2 = LabelUtils.getLabel(_componentBuilder); if (onlyIfDifferentThanTitle1 && getBannerTitle().equals(title2)) { return null; } return title2; }
@Override public void componentBegin(final AnalysisJob job, final ComponentJob componentJob, final ComponentMetrics metrics) { _progressInformationPanel.addUserLog("Starting component '" + LabelUtils.getLabel(componentJob) + "'"); }