-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/com/muedsa/intellij/textReader/state/TextReaderStateService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.muedsa.intellij.textReader.state; | ||
|
||
import com.intellij.openapi.components.PersistentStateComponent; | ||
import com.intellij.openapi.components.State; | ||
import com.intellij.openapi.components.Storage; | ||
import com.intellij.util.xmlb.XmlSerializerUtil; | ||
import com.muedsa.intellij.textReader.Chapter; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Vector; | ||
@State(name = "com.muedsa.intellij.textReader.chapter", storages = {@Storage(value = "$APP_CONFIG$/muedsa_tr.xml")}) | ||
public class TextReaderStateService implements PersistentStateComponent<TextReaderStateService> { | ||
|
||
private Vector<Chapter> chapters = new Vector<>(); | ||
|
||
private String filePath; | ||
|
||
public Vector<Chapter> getChapters() { | ||
return chapters; | ||
} | ||
|
||
public void setChapters(Vector<Chapter> chapters) { | ||
this.chapters = chapters; | ||
} | ||
|
||
public String getFilePath() { | ||
return filePath; | ||
} | ||
|
||
public void setFilePath(String filePath) { | ||
this.filePath = filePath; | ||
} | ||
|
||
@Override | ||
public TextReaderStateService getState() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public void loadState(@NotNull TextReaderStateService state) { | ||
XmlSerializerUtil.copyBean(state, this); | ||
} | ||
} |