Skip to content

Instantly share code, notes, and snippets.

@incepttechnologies
incepttechnologies / sorting-initializeTable
Created October 9, 2013 18:27
method showing setup of TableView for Sorting.
private void initializeTable() {
personViewIdCol.setCellValueFactory(new PropertyValueFactory<Person, String>("Id"));
id.setGraphic(upImg);
personViewIdCol.setGraphic(id);
personViewIdCol.setSortable(false);
personViewNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("Name"));
personViewNameCol.sortTypeProperty().addListener(new ChangeListener<SortType>() {
@Override
public void changed(ObservableValue<? extends SortType> paramObservableValue, SortType paramT1, SortType paramT2) {
System.out.println("NAME Clicked -- sortType = " + paramT1 + ", SortType=" + paramT2);
@incepttechnologies
incepttechnologies / gist:6909893
Created October 9, 2013 22:51
TableView -initialize
public void initialize(URL url, ResourceBundle rb) {
System.out.println("initialize");
sort();
initializeTable();
pageCount = getPageCount(persons.size(), itemsPerPage);
System.out.println("pageCount=" + pageCount);
pagination.setPageCount(pageCount);
pagination.currentPageIndexProperty().addListener(new ChangeListener<Number>() {
@incepttechnologies
incepttechnologies / gist:6910468
Created October 9, 2013 23:38
TableView : sort
private void sort() {
//persons.sort((Person p1, Person p2) -> p1.id.compareTo(p2.id));
Collections.sort(persons, new Comparator<Person>() {
@Override
public int compare(Person t, Person t1) {
System.out.println(" comparator called");
return t.getId().compareTo(t1.getId());
}
});
}
@incepttechnologies
incepttechnologies / gist:6910660
Created October 9, 2013 23:55
TableView: fxml
<TableView fx:id="personView" layoutX="110.0" layoutY="71.0" prefHeight="136.0" prefWidth="334.0">
<columns>
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="116.0" resizable="true" fx:id="personViewIdCol" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="124.0" resizable="true" text="Name" fx:id="personViewNameCol" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="93.0" resizable="true" text="Age" fx:id="personViewAgeCol" />
</columns>
</TableView>
<HBox layoutX="131.0" layoutY="283.0" prefHeight="64.0" prefWidth="306.0" />
<Label layoutX="91.0" layoutY="229.0" text="ID" />
<TextField fx:id="idTxt" layoutX="110.0" layoutY="229.0" prefWidth="67.0" />
@incepttechnologies
incepttechnologies / gist:7046388
Created October 18, 2013 18:58
WebSocket Client Side using javascript
<script type="text/javascript">
var host = "ws://localhost:8080/JSFWebSockets/notification";
var wSocket = new WebSocket(host);
var browserSupport = ("WebSocket" in window) ? true : false;
// called body onLoad()
function initializeReception()
{
if (browserSupport)
{
@incepttechnologies
incepttechnologies / gist:7048509
Created October 18, 2013 21:26
server websocket end point
@ServerEndpoint(value = "/notification")
public class NotificationEndPoint implements Serializable {
/**
* Message receiver method
*
* @param message
* @return
*/
@incepttechnologies
incepttechnologies / login.xhtml
Created November 8, 2013 02:12
login page for secured application
<h:form id="formLogin" prependId="false"
onsubmit="document.getElementById('formLogin').action = 'j_security_check';">
<h:panelGrid columns="2">
<f:facet name="header">
Login
</f:facet>
<h:outputLabel for="j_username" value="Username: "/>
<h:inputText id="j_username" required="true" />
@incepttechnologies
incepttechnologies / CDI - Producer
Created December 14, 2013 22:59
CDI - Producer
@Produces
@Greeting
public String getMessage() {
@TrType
@Produces
@Transporter tr;
@incepttechnologies
incepttechnologies / krb5.conf
Last active May 9, 2019 03:27
kerberos configuration file "krb5.conf"
[libdefaults]
default_realm = INCEPT.LAB
default_tkt_enctypes = rc4-hmac
default_tgs_enctypes = rc4-hmac
ticket_lifetime = 600
# to support multiple enc types, provide a space separated list --
# default_tkt_enctypes = aes128-cts rc4-hmac
[realms]