Skip to content

Commit

Permalink
14.0.0 Native Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 18, 2024
1 parent 505b47f commit dc3d193
Show file tree
Hide file tree
Showing 39 changed files with 188 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import java.util.Random;


import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
Expand All @@ -41,4 +40,8 @@ public static CustomerStatus random() {
Random random = new Random();
return values()[random.nextInt(values().length)];
}

public String getStatusName() {
return name();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
package org.primefaces.showcase.domain;

import java.util.Locale;

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
Expand All @@ -40,4 +42,8 @@ public enum InventoryStatus {
public String getText() {
return text;
}

public String getStatusName() {
return name().toLowerCase(Locale.ROOT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
*/
package org.primefaces.showcase.view.csv;

import io.quarkus.runtime.annotations.RegisterForReflection;
import org.primefaces.validate.bean.AbstractClientValidationConstraint;

/**
* ClientValidationConstraint for @Email annotation
*/
@RegisterForReflection
public class EmailClientValidationConstraint extends AbstractClientValidationConstraint {

public static final String MESSAGE_METADATA = "data-p-email-msg";
Expand All @@ -41,4 +43,4 @@ public String getValidatorId() {
return Email.class.getSimpleName();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
*/
package org.primefaces.showcase.view.data.dataexporter;

import jakarta.faces.FacesException;
import jakarta.faces.context.FacesContext;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Collections;


import jakarta.faces.FacesException;
import jakarta.faces.context.FacesContext;

import io.quarkus.runtime.annotations.RegisterForReflection;
import org.primefaces.component.api.UIColumn;
import org.primefaces.component.datatable.DataTable;
import org.primefaces.component.datatable.export.DataTableExporter;
import org.primefaces.component.export.ColumnValue;
import org.primefaces.component.export.ExporterOptions;
import org.primefaces.util.EscapeUtils;

@RegisterForReflection
public class TextExporter extends DataTableExporter<PrintWriter, ExporterOptions> {

public TextExporter() {
Expand All @@ -51,8 +51,7 @@ protected PrintWriter createDocument(FacesContext context) throws IOException {
try {
OutputStreamWriter osw = new OutputStreamWriter(os(), exportConfiguration.getEncodingType());
return new PrintWriter(osw);
}
catch (UnsupportedEncodingException e) {
} catch (UnsupportedEncodingException e) {
throw new FacesException(e);
}
}
Expand Down Expand Up @@ -90,4 +89,4 @@ public String getContentType() {
public String getFileExtension() {
return ".txt";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@
*/
package org.primefaces.showcase.view.data.timeline;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;


import jakarta.annotation.PostConstruct;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.context.FacesContext;
import jakarta.faces.view.ViewScoped;
import jakarta.inject.Named;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;

import io.quarkus.runtime.annotations.RegisterForReflection;
import org.primefaces.component.timeline.TimelineUpdater;
import org.primefaces.event.timeline.TimelineSelectEvent;
import org.primefaces.model.timeline.TimelineEvent;
Expand Down Expand Up @@ -119,8 +118,7 @@ public void onSelect(TimelineSelectEvent<?> e) {
if (aSelected) {
// select project B visually (index in the event's list is 1)
timelineUpdater.select("projectB");
}
else {
} else {
// select project A visually (index in the event's list is 0)
timelineUpdater.select("projectA");
}
Expand Down Expand Up @@ -156,6 +154,7 @@ public void setEnd(LocalDateTime end) {
this.end = end;
}

@RegisterForReflection
public class Task implements Serializable {

private final String title;
Expand All @@ -181,4 +180,4 @@ public boolean isPeriod() {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
*/
package org.primefaces.showcase.view.multimedia;

import java.io.Serializable;
import java.util.List;


import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.RequestScoped;
import jakarta.faces.context.FacesContext;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import java.io.Serializable;
import java.util.List;

import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
Expand All @@ -42,10 +40,9 @@
@RequestScoped
public class DynamicGalleriaView implements Serializable {

private List<Photo> photos;

@Inject
private PhotoService service;
PhotoService service;
private List<Photo> photos;

@PostConstruct
public void init() {
Expand Down Expand Up @@ -73,4 +70,4 @@ public List<Photo> getPhotos() {
public void setService(PhotoService service) {
this.service = service;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
*/
package org.primefaces.showcase.view.multimedia;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;


import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named;
import javax.imageio.ImageIO;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
Expand All @@ -51,17 +50,15 @@ public StreamedContent getGraphicText() {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bufferedImg, "png", os);
return new ByteArrayInputStream(os.toByteArray());
}
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
return null;
}
})
.build();
}
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
}
Loading

0 comments on commit dc3d193

Please sign in to comment.