@Override public void initTable(CommonApplicationConstants constants) { getTable().addColumn(new AuditLogSeverityColumn(), constants.empty(), "20px"); // $NON-NLS-1$ TextColumnWithTooltip<AuditLog> logTimeColumn = new FullDateTimeColumn<AuditLog>() { @Override protected Date getRawValue(AuditLog object) { return object.getlog_time(); } }; getTable().addColumn(logTimeColumn, constants.timeEvent(), "170px"); // $NON-NLS-1$ TextColumnWithTooltip<AuditLog> messageColumn = new TextColumnWithTooltip<AuditLog>() { @Override public String getValue(AuditLog object) { return object.getmessage(); } }; getTable().addColumn(messageColumn, constants.messageEvent()); TextColumnWithTooltip<AuditLog> correlationIdColumn = new TextColumnWithTooltip<AuditLog>() { @Override public String getValue(AuditLog object) { return object.getCorrelationId(); } }; getTable() .addColumn(correlationIdColumn, constants.correltaionIdEvent(), "100px"); // $NON-NLS-1$ }
protected void updateInputTitle(ArrayList<String> grayOutReasons, Element input) { StringBuilder title = new StringBuilder(constants.empty()); for (String reason : grayOutReasons) { title.append(reason).append(constants.space()); } ElementTooltipUtils.setTooltipOnElement( input, SafeHtmlUtils.fromString(title.toString()), Placement.LEFT); }
@Override public String getValue(Snapshot snapshot) { if (snapshot.getType() == SnapshotType.ACTIVE) { return constants.currentSnapshotLabel(); } return fullDateTimeRenderer.render(snapshot.getCreationDate()); }
@Override public String render(Date object) { if (object == null) { return CONSTANTS.notAvailableLabel(); } return format.format(object); }
@Override public final SafeHtml getValue(Snapshot snapshot) { // Get raw description string (ignore < and > characters). // Customize description style as needed. SafeHtml description = SafeHtmlUtils.fromString(snapshot.getDescription()); String descriptionStr = description.asString(); if (snapshot.getStatus() == SnapshotStatus.IN_PREVIEW) { List<String> previewedItems = new ArrayList<>(Arrays.asList(constants.vmConfiguration())); previewedItems.addAll(Linq.getDiskAliases(snapshot.getDiskImages())); descriptionStr = messages.snapshotPreviewing( descriptionStr, StringUtils.join(previewedItems, ", ")); // $NON-NLS-1$ description = templates.snapshotDescription("color:orange", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.STATELESS) { descriptionStr = descriptionStr + " (" + constants.readonlyLabel() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ description = templates.snapshotDescription("font-style:italic", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.PREVIEW) { descriptionStr = constants.snapshotDescriptionActiveVmBeforePreview(); description = templates.snapshotDescription("color:gray", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.ACTIVE) { descriptionStr = constants.snapshotDescriptionActiveVm(); description = templates.snapshotDescription("color:gray", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.REGULAR && !snapshot.getDiskImages().isEmpty()) { descriptionStr = messages.snapshotPreviewing( descriptionStr, StringUtils.join( Linq.getDiskAliases(snapshot.getDiskImages()), ", ")); // $NON-NLS-1$ description = templates.snapshotDescription("color:gold", descriptionStr); // $NON-NLS-1$ } return description; }
protected void updateSelectedLunWarning(LunModel lunModel) { LUNs lun = lunModel.getEntity(); String warning = constants.empty(); // Adding 'GrayedOutReasons' if (lun.getStorageDomainId() != null) { warning = messages.lunAlreadyPartOfStorageDomainWarning(lun.getStorageDomainName()); } else if (lun.getDiskId() != null) { warning = messages.lunUsedByDiskWarning(lun.getDiskAlias()); } model.setSelectedLunWarning(warning); }
void localize() { memoryEditor.setLabel(constants.virtualMachineSnapshotPreviewPopupMemoryLabel()); messageLabel.setText(constants.snapshotContainsMemory()); }
public TemplateGeneralModelForm( ModelProvider<TemplateGeneralModel> modelProvider, CommonApplicationConstants constants) { super(modelProvider, 3, 6); Driver.driver.initialize(this); // Build a form using the FormBuilder formBuilder.setColumnsWidth( "120px", "240px", "160px"); // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ formBuilder.addFormItem(new FormItem(constants.nameTemplateGeneral(), name, 0, 0)); formBuilder.addFormItem( new FormItem(constants.descriptionTemplateGeneral(), description, 1, 0)); formBuilder.addFormItem( new FormItem(constants.hostClusterTemplateGeneral(), hostCluster, 2, 0)); formBuilder.addFormItem(new FormItem(constants.osTemplateGeneral(), oS, 3, 0)); formBuilder.addFormItem( new FormItem(constants.defaultDisTypeTemplateGeneral(), defaultDisplayType, 4, 0)); formBuilder.addFormItem( new FormItem(constants.definedMemTemplateGeneral(), definedMemory, 0, 1)); formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresTemplateGeneral(), cpuInfo, 1, 1)); formBuilder.addFormItem( new FormItem(constants.numOfMonitorsTemplateGeneral(), monitorCount, 2, 1)); formBuilder.addFormItem( new FormItem(constants.highlyAvailTemplateGeneral(), isHighlyAvailable, 3, 1)); formBuilder.addFormItem(new FormItem(constants.priorityTemplateGeneral(), priority, 4, 1)); formBuilder.addFormItem( new FormItem(constants.usbPolicyTemplateGeneral(), usbPolicy, 5, 1) { @Override public boolean isVisible() { return getModel().getHasUsbPolicy(); } }); formBuilder.addFormItem(new FormItem(constants.originTemplateGeneral(), origin, 0, 2)); formBuilder.addFormItem( new FormItem(constants.isStatelessTemplateGeneral(), isStateless, 1, 2)); formBuilder.addFormItem( new FormItem(constants.domainTemplateGeneral(), domain, 2, 2) { @Override public boolean isVisible() { return getModel().getHasDomain(); } }); formBuilder.addFormItem( new FormItem(constants.tzTemplateGeneral(), timeZone, 3, 2) { @Override public boolean isVisible() { return getModel().getHasTimeZone(); } }); formBuilder.addFormItem( new FormItem(constants.quotaTemplateGeneral(), quotaName, 4, 2) { @Override public boolean isVisible() { return getModel().isQuotaAvailable(); } }); }