Skip to content

Commit

Permalink
save and restore selected calendar view. close #1732
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Dec 8, 2023
1 parent c34ed21 commit 64c6d56
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="jTabbedPane1StateChanged"/>
</Events>

<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,13 @@ public class ArchiveFileReviewsOverviewPanel extends javax.swing.JPanel implemen

private String detailsEditorClass;
private Image backgroundImage=null;
private boolean initializing=false;

/**
* Creates new form ArchiveFileReviewsOverviewPanel
*/
public ArchiveFileReviewsOverviewPanel() {
this.initializing=true;
initComponents();
if (UserSettings.getInstance().isCurrentUserInRole(UserSettings.ROLE_WRITECASE)) {
this.detailsEditorClass = EditArchiveFileDetailsPanel.class.getName();
Expand All @@ -704,6 +706,15 @@ public ArchiveFileReviewsOverviewPanel() {

this.cmdRefreshActionPerformed(null);

String lastTab=UserSettings.getInstance().getSetting(UserSettings.CONF_CALENDAR_DEFAULTTAB, jTabbedPane1.getTitleAt(0));
for(int i=0;i<this.jTabbedPane1.getTabCount();i++) {
if(this.jTabbedPane1.getTitleAt(i).equals(lastTab)) {
this.jTabbedPane1.setSelectedIndex(i);
break;
}
}
this.initializing=false;

}

public void setBackgroundImage(Image image) {
Expand Down Expand Up @@ -795,6 +806,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addContainerGap())
);

jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
jTabbedPane1StateChanged(evt);
}
});

tblResults.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
Expand Down Expand Up @@ -833,7 +850,7 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
.add(jLabel18)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lblPanelTitle, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 879, Short.MAX_VALUE))
.add(jTabbedPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 879, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
Expand Down Expand Up @@ -933,6 +950,11 @@ private void cmdExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR
private void tblResultsMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblResultsMousePressed
TableUtils.handleRowClick(tblResults, evt);
}//GEN-LAST:event_tblResultsMousePressed

private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
if(!this.initializing)
UserSettings.getInstance().setSetting(UserSettings.CONF_CALENDAR_DEFAULTTAB, jTabbedPane1.getTitleAt(jTabbedPane1.getSelectedIndex()));
}//GEN-LAST:event_jTabbedPane1StateChanged


// Variables declaration - do not modify//GEN-BEGIN:variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,8 @@ public class UserSettings {
public static final String CONF_DREBIS_LASTTAG = "user.drebis.lasttag";
public static final String CONF_DREBIS_LASTDOCUMENTTAG = "user.drebis.lastdocumenttag";

public static final String CONF_CALENDAR_DEFAULTTAB = "user.calendar.defaulttab";

public static final String CONF_SCAN_DIVIDERKEYWORD = "user.scans.dividerkeyword";

public static final String CONF_MAIL_LASTUSEDSETUP = "user.mail.lastusedsetup";
Expand Down

0 comments on commit 64c6d56

Please sign in to comment.