Package edu.hawaii.ics.csdl.jupiter.file.preference

Examples of edu.hawaii.ics.csdl.jupiter.file.preference.Phase


   * @param reader The reader to read data from.
   * @param preference The preference object that the data is to be added to.
   * @throws XMLStreamException Thrown if there is an error reading from the reader.
   */
  private static void parsePhase(XMLStreamReader reader, View view) throws XMLStreamException {
    Phase phase = new Phase();
    phase.setName(reader.getAttributeValue(null, ATTRIBUTE_NAME));

    boolean endFound = false;
    while (!endFound) {
      if (reader.hasNext()) {
        int eventType = reader.next();

        if (eventType == XMLStreamConstants.START_ELEMENT) {
          QName elementQName = reader.getName();
          String elementName = elementQName.toString();
          if (ELEMENT_COLUMN_ENTRY.equals(elementName)) {
            ColumnEntry colEntry = new ColumnEntry();
            colEntry.setName(reader.getAttributeValue(null, ATTRIBUTE_NAME));
            String width = reader.getAttributeValue(null, ATTRIBUTE_WIDTH);
           
            try {
              colEntry.setWidth(Integer.valueOf(width));
            }
            catch (NumberFormatException e) {
              // just don't set the width
            }
           
            colEntry.setResizable(Boolean.valueOf(reader.getAttributeValue(null,
                ATTRIBUTE_RESIZABLE)));
            colEntry.setEnable(Boolean.valueOf(reader
                .getAttributeValue(null, ATTRIBUTE_ENABLE)));
           
            phase.getColumnEntry().add(colEntry);
          }
        }
        else if (eventType == XMLStreamConstants.END_ELEMENT) {
          if (ELEMENT_PHASE.equals(reader.getName().toString())) {
            // this is the end of the Phase element
View Full Code Here


   * @param columnDataModel the <code>ColumnDataManager</code> instance.
   */
  public void storeColumnDataModel(String reviewPhaseNameKey, ColumnDataModel columnDataModel) {
    ColumnData[] columnDataArray = columnDataModel.getAllColumnDataArray();
   
    Phase phase = getPhase(reviewPhaseNameKey);
    if (phase != null) {
      // clear out all column entries
      phase.getColumnEntry().clear();
     
      for (int i = 0; i < columnDataArray.length; i++) {
        int width = columnDataArray[i].getColumnPixelData().width;
        boolean resizable = columnDataArray[i].getColumnPixelData().resizable;
        String columnNameKey = columnDataArray[i].getColumnNameKey();
        boolean isEnabled = columnDataArray[i].isEnabled();

        // create column data entry from scratch
        ColumnEntry columnEntry = new ColumnEntry();
        columnEntry.setWidth(width);
        columnEntry.setResizable(resizable);
        columnEntry.setName(columnNameKey);
        columnEntry.setEnable(isEnabled);

        phase.getColumnEntry().add(columnEntry);
      }
      try {
        PrefXmlSerializer.serializePreference(preference);
      }
      catch (ReviewException e) {
View Full Code Here

   * @param phaseNameKey the phase name key.
   * @return the list of the ColumnData instances given the phase name key.
   */
  public List<ColumnData> getColumnDataList(String phaseNameKey) {
    List<ColumnData> columnDataList = new ArrayList<ColumnData>();
    Phase phase = getPhase(phaseNameKey);
    for (ColumnEntry entry : phase.getColumnEntry()) {
      String columnNameKey = entry.getName();
      boolean enable = entry.isEnable();
      int width = entry.getWidth();
      boolean resizeable = entry.isResizable();
      ColumnPixelData pixelData = new ColumnPixelData(width, resizeable);
View Full Code Here

TOP

Related Classes of edu.hawaii.ics.csdl.jupiter.file.preference.Phase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.