All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.adoptopenjdk.jitwatch.ui.main.CompilationTableBuilder Maven / Gradle / Ivy

/*
 * Copyright (c) 2017 Chris Newland.
 * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
 * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki
 */
package org.adoptopenjdk.jitwatch.ui.main;

import org.adoptopenjdk.jitwatch.ui.main.CompilationTableRow;

import javafx.collections.ObservableList;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;

public final class CompilationTableBuilder
{
	private CompilationTableBuilder()
	{
	}

	public static TableView buildTableMemberAttributes(ObservableList rows)
	{
		TableView tv = new TableView<>();

		TableColumn columnQueued = new TableColumn("Queued");
		columnQueued.setCellValueFactory(new PropertyValueFactory("queuedStamp"));
		columnQueued.prefWidthProperty().bind(tv.widthProperty().multiply(0.2));

		TableColumn columnCompiled = new TableColumn("Compiled");
		columnCompiled.setCellValueFactory(new PropertyValueFactory("compiledStamp"));
		columnCompiled.prefWidthProperty().bind(tv.widthProperty().multiply(0.2));

		TableColumn columnSize = new TableColumn("Native Size");
		columnSize.setCellValueFactory(new PropertyValueFactory("native"));
		columnSize.prefWidthProperty().bind(tv.widthProperty().multiply(0.2));

		TableColumn columnCompiler = new TableColumn("Compiler");
		columnCompiler.setCellValueFactory(new PropertyValueFactory("compiler"));
		columnCompiler.prefWidthProperty().bind(tv.widthProperty().multiply(0.2));

		TableColumn columnLevel = new TableColumn("Level");
		columnLevel.setCellValueFactory(new PropertyValueFactory("level"));
		columnLevel.prefWidthProperty().bind(tv.widthProperty().multiply(0.2));
		
		tv.getColumns().add(columnQueued);
		tv.getColumns().add(columnCompiled);
		tv.getColumns().add(columnSize);
		tv.getColumns().add(columnCompiler);
		tv.getColumns().add(columnLevel);

		tv.setItems(rows);

		return tv;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy