/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ptc.tifworkbench.ui;
import com.ptc.tifworkbench.jaxbbinding.ImSolution;
import com.ptc.tifworkbench.model.XmlFormatter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.bind.JAXBException;
/**
*
* @author pbowden
*/
public class TifXmlView extends javax.swing.JPanel {
/**
* Creates new form TifXmlView
*/
public TifXmlView()
{
initComponents();
}
public void setModel(ImSolution sol)
{
XmlFormatter fmt = new XmlFormatter();
try
{
String str = fmt.marshalToString(sol);
this.xmlPane.setText(str);
} catch (JAXBException ex)
{
Logger.getLogger(TifXmlView.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
xmlScroll = new javax.swing.JScrollPane();
xmlPane = new javax.swing.JTextPane();
xmlScroll.setViewportView(xmlPane);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(xmlScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(xmlScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextPane xmlPane;
private javax.swing.JScrollPane xmlScroll;
// End of variables declaration//GEN-END:variables
}