Skip to content

Commit

Permalink
Problems with fields disappearing intermittently should now be solved.
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnmag committed Mar 11, 2014
1 parent 7a94783 commit 888ed1f
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,25 +266,6 @@ public void actionPerformed(ActionEvent e) {
}
});

//PLACEHOLDER:
// JMenuItem saveAsGoogledoc = new JMenuItem("Save As Googledoc template");
// saveAsGoogledoc.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// try {
// saveCurrentField(true, true);
// createOutput(OutputOptions.GDOC);
// } catch (DataNotCompleteException dce) {
// showMessagePane(dce.getMessage(), JOptionPane.ERROR_MESSAGE);
// } catch (IOException e1) {
// showMessagePane("IO error occurred when saving file!", JOptionPane.ERROR_MESSAGE);
// } catch (Exception e1) {
// showMessagePane(e1.getMessage(), JOptionPane.ERROR_MESSAGE);
// }
// }
// });



JMenuItem closeSession = new JMenuItem("Close session without saving");
closeSession.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Expand Down Expand Up @@ -344,11 +325,6 @@ public void run() {
public void actionPerformed(ActionEvent e) {
try {
new SettingsUI();

// } catch (DataNotCompleteException dce) {
// showMessagePane(dce.getMessage(), JOptionPane.ERROR_MESSAGE);
// } catch (IOException e1) {
// showMessagePane("IO error occurred when saving file!", JOptionPane.ERROR_MESSAGE);
} catch (Exception e1) {
showMessagePane(e1.getMessage(), JOptionPane.ERROR_MESSAGE);
}
Expand All @@ -358,7 +334,6 @@ public void actionPerformed(ActionEvent e) {
settings.add(proxySettings);



JMenu helpMenu = new JMenu("Help");
JMenuItem about = new JMenuItem("About", aboutIcon);
about.addActionListener(new ActionListener() {
Expand Down Expand Up @@ -489,13 +464,9 @@ public void run() {
try {
if (outputOption == OutputOptions.CONFIGURATION_XML) {
showMessagePane(Utils.createTableConfigurationXML(saveIn, tableFields), JOptionPane.INFORMATION_MESSAGE);
}
else if(outputOption == OutputOptions.EXCEL) {
} else if (outputOption == OutputOptions.EXCEL) {
showMessagePane(Utils.createTableConfigurationEXL(saveIn, tableFields), JOptionPane.INFORMATION_MESSAGE);
}
// else if(outputOption == OutputOptions.GDOC) {
// showMessagePane(Utils.createTableConfigurationGDOC(saveIn, tableFields), JOptionPane.INFORMATION_MESSAGE);
// }
sourceFile = new File(saveIn);
} catch (DataNotCompleteException e) {
showMessagePane(e.getMessage(), JOptionPane.ERROR_MESSAGE);
Expand Down Expand Up @@ -536,7 +507,7 @@ private void save() {
}


private void saveAsExcel() {
private void saveAsExcel() {
try {
updateFieldOrder();
showMessagePane(Utils.createTableConfigurationEXL(sourceFile.getAbsolutePath(), tableFields), JOptionPane.INFORMATION_MESSAGE);
Expand All @@ -549,20 +520,6 @@ private void saveAsExcel() {
}
}


// private void saveAsGoogledoc() {
// try {
// updateFieldOrder();
// showMessagePane(Utils.createTableConfigurationGDOC(sourceFile.getAbsolutePath(), tableFields), JOptionPane.INFORMATION_MESSAGE);
// } catch (DataNotCompleteException e) {
// showMessagePane(e.getMessage(), JOptionPane.ERROR_MESSAGE);
// } catch (InvalidFieldOrderException ifoe) {
// showMessagePane(ifoe.getMessage(), JOptionPane.ERROR_MESSAGE);
// } catch (IOException ioe) {
// showMessagePane(ioe.getMessage(), JOptionPane.ERROR_MESSAGE);
// }
// }

private void createMainSector() {

JPanel topContainer = new JPanel();
Expand Down Expand Up @@ -1249,7 +1206,7 @@ public boolean addTable(String tableType, String measurementType, String measure
addedSections.add(field.getSection());
}
}
if(field.getDescription().isEmpty()) field.setDescription(field.getFieldName());
if (field.getDescription().isEmpty()) field.setDescription(field.getFieldName());
tableFields.get(mo).add(new FieldElement(field));
}
}
Expand Down Expand Up @@ -1359,6 +1316,7 @@ private void reformFieldList(MappingObject selectedTable) {
elementList.setSelectedIndex(0);
}


} else {
elementModel.clear();
}
Expand Down Expand Up @@ -1408,17 +1366,22 @@ private boolean checkConflictingTables(String tableType, String tableName, Strin
*
* @param newPage - JLayeredPane to change to
*/
public void setCurrentPage(JLayeredPane newPage) {
if (currentPage == null) {
currentPage = newPage;
} else {
remove(currentPage);
currentPage = newPage;
}
public void setCurrentPage(final JLayeredPane newPage) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if (currentPage == null) {
currentPage = newPage;
} else {
remove(currentPage);
currentPage = newPage;
}

add(currentPage, BorderLayout.CENTER);
repaint();
validate();
}
});

add(currentPage, BorderLayout.CENTER);
repaint();
validate();
}

public ISAcreatorConfigurator getApplicationContainer() {
Expand Down
Loading

0 comments on commit 888ed1f

Please sign in to comment.