本文整理汇总了Java中net.sf.memoranda.util.CurrentStorage类的典型用法代码示例。如果您正苦于以下问题:Java CurrentStorage类的具体用法?Java CurrentStorage怎么用?Java CurrentStorage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CurrentStorage类属于net.sf.memoranda.util包,在下文中一共展示了CurrentStorage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDocument
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public void setDocument(Note note) {
// Note note = CurrentProject.getNoteList().getActiveNote();
// try {
// this.editor.editor.setPage(CurrentStorage.get().getNoteURL(note));
editor.document = (HTMLDocument) CurrentStorage.get().openNote(note);
editor.initEditor();
if (note != null)
titleField.setText(note.getTitle());
else
titleField.setText("");
initialTitle = titleField.getText();
/*
* } catch (Exception ex) { new ExceptionDialog(ex); }
*/
/*
* Document doc = CurrentStorage.get().openNote(note); try {
* this.editor.editor.setText(doc.getText(0, doc.getLength())); } catch
* (Exception ex){ ex.printStackTrace(); }
*/
// .setDocument(CurrentStorage.get().openNote(note));
}
示例2: addResourceType
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
MimeType addResourceType(String fpath) {
ResourceTypeDialog dlg = new ResourceTypeDialog(App.getFrame(), Local.getString("Resource type"));
Dimension dlgSize = new Dimension(420, 300);
dlg.setSize(dlgSize);
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setVisible(true);
if (dlg.CANCELLED)
return null;
int ix = dlg.getTypesList().getSelectedIndex();
MimeType mt = (MimeType) MimeTypesList.getAllMimeTypes().toArray()[ix];
mt.addExtension(MimeTypesList.getExtension(fpath));
CurrentStorage.get().storeMimeTypesList();
return mt;
}
示例3: deleteB_actionPerformed
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
void deleteB_actionPerformed(ActionEvent e) {
MimeType mt = (MimeType) typesList.getSelectedValue();
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("Delete resource type")
+ "\n'"
+ mt.getLabel()
+ "'\n"
+ Local.getString("Are you sure?"),
Local.getString("Delete resource type"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
MimeTypesList.removeMimeType(mt.getMimeTypeId());
CurrentStorage.get().storeMimeTypesList();
this.initTypesList();
}
示例4: addResourceType
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
/**
* If the file type is indeterminable by the program, find the program
* and store the path to the Resources list.
* @param fpath
* @return
*/
MimeType addResourceType(String fpath) {
ResourceTypeDialog dlg = new ResourceTypeDialog(App.getFrame(), Local.getString("Resource type"));
Dimension dlgSize = new Dimension(420, 300);
dlg.setSize(dlgSize);
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.ext = MimeTypesList.getExtension(fpath);
dlg.setVisible(true);
if (dlg.CANCELLED)
return null;
int ix = dlg.getTypesList().getSelectedIndex();
MimeType mt = (MimeType) MimeTypesList.getAllMimeTypes().toArray()[ix];
mt.addExtension(MimeTypesList.getExtension(fpath));
CurrentStorage.get().storeMimeTypesList();
return mt;
}
示例5: deleteB_actionPerformed
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
/**
* Delete a resource type and update the list.
* @param e
*/
void deleteB_actionPerformed(ActionEvent e) {
MimeType mt = (MimeType) typesList.getSelectedValue();
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("Delete resource type")
+ "\n'"
+ mt.getLabel()
+ "'\n"
+ Local.getString("Are you sure?"),
Local.getString("Delete resource type"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
MimeTypesList.removeMimeType(mt.getMimeTypeId());
CurrentStorage.get().storeMimeTypesList();
this.initTypesList();
}
示例6: addResourceType
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
MimeType addResourceType(String fpath) {
ResourceTypeDialog dlg = new ResourceTypeDialog(App.getFrame(), Local.getString("Resource type"));
Dimension dlgSize = new Dimension(420, 300);
dlg.setSize(dlgSize);
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.ext = MimeTypesList.getExtension(fpath);
dlg.setVisible(true);
if (dlg.CANCELLED)
return null;
int ix = dlg.getTypesList().getSelectedIndex();
MimeType mt = (MimeType) MimeTypesList.getAllMimeTypes().toArray()[ix];
mt.addExtension(MimeTypesList.getExtension(fpath));
CurrentStorage.get().storeMimeTypesList();
return mt;
}
示例7: addResourceType
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
MimeType addResourceType(String fpath) {
ResourceTypeDialog dlg = new ResourceTypeDialog(App.getFrame(), Local.getString("Resource type"));
Dimension dlgSize = new Dimension(420, 300);
dlg.setSize(dlgSize);
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.ext = MimeTypesList.getExtension(fpath);
dlg.setVisible(true);
if (dlg.CANCELLED)
return null;
int ix = dlg.getTypesList().getSelectedIndex();
MimeType mt = (MimeType) MimeTypesList.getAllMimeTypes().toArray()[ix];
mt.addExtension(MimeTypesList.getExtension(fpath));
CurrentStorage.get().storeMimeTypesList();
return mt;
}
示例8: createProject
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public static Project createProject(String id, Project.Type type, String title, CalendarDate startDate, CalendarDate endDate) {
Element el = new Element("project");
el.addAttribute(new Attribute("id", id));
_root.appendChild(el);
Project project = (type.compareTo(Project.Type.STANDARD) == 0) ? new ProjectImpl(el) : new PSPProject(el);
// System.out.println(prj.getClass());
project.setType(type);
project.setTitle(title);
project.setStartDate(startDate);
project.setEndDate(endDate);
CurrentStorage.get().createProjectStorage(project);
if (type.compareTo(Project.Type.PSP) == 0) {
initializePSPAttrs(project);
}
return project;
}
示例9: createProject
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public static Project createProject(String id, String title, CalendarDate startDate, CalendarDate endDate) {
Element el = new Element("project");
el.addAttribute(new Attribute("id", id));
_root.appendChild(el);
Project prj = new ProjectImpl(el);
prj.setTitle(title);
prj.setStartDate(startDate);
prj.setEndDate(endDate);
CurrentStorage.get().createProjectStorage(prj);
return prj;
}
示例10: removeProject
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public static void removeProject(String id) {
Project prj = getProject(id);
if (prj == null)
return;
History.removeProjectHistory(prj);
CurrentStorage.get().removeProjectStorage(prj);
Elements prjs = _root.getChildElements("project");
for (int i = 0; i < prjs.size(); i++) {
String pid = ((Element) prjs.get(i)).getAttribute("id").getValue();
if (pid.equals(id)) {
_root.removeChild(prjs.get(i));
return;
}
}
}
示例11: set
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public static void set(Project project) {
if (project.getID().equals(_project.getID())) return;
TaskList newtasklist = CurrentStorage.get().openTaskList(project);
NoteList newnotelist = CurrentStorage.get().openNoteList(project);
ResourcesList newresources = CurrentStorage.get().openResourcesList(project);
notifyListenersBefore(project, newnotelist, newtasklist, newresources);
_project = project;
_tasklist = newtasklist;
_notelist = newnotelist;
_resources = newresources;
notifyListenersAfter();
Context.put("LAST_OPENED_PROJECT_ID", project.getID());
}
示例12: save
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public static void save() {
Storage storage = CurrentStorage.get();
storage.storeNoteList(_notelist, _project);
storage.storeTaskList(_tasklist, _project);
storage.storeResourcesList(_resources, _project);
storage.storeProjectManager();
}
示例13: saveNote
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
public void saveNote() {
if (currentNote == null)
currentNote = CurrentProject.getNoteList().createNoteForDate(currentDate);
currentNote.setTitle(editorPanel.titleField.getText());
currentNote.setId(Util.generateId());
CurrentStorage.get().storeNote(currentNote, editorPanel.getDocument());
/*DEBUG* System.out.println("Save");*/
}
示例14: newTypeB_actionPerformed
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
void newTypeB_actionPerformed(ActionEvent e) {
EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New resource type"));
Dimension dlgSize = new Dimension(420, 420);
dlg.setSize(dlgSize);
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.extField.setText(ext);
dlg.descField.setText(ext);
dlg.appPanel.argumentsField.setText("$1");
dlg.iconLabel.setIcon(
new ImageIcon(
net.sf.memoranda.ui.AppFrame.class.getResource("resources/icons/mimetypes/default.png")));
dlg.setVisible(true);
if (dlg.CANCELLED)
return;
String typeId = Util.generateId();
MimeType mt = MimeTypesList.addMimeType(typeId);
String[] exts = dlg.extField.getText().trim().split(" ");
for (int i = 0; i < exts.length; i++)
mt.addExtension(exts[i]);
mt.setLabel(dlg.descField.getText());
AppList appList = MimeTypesList.getAppList();
if (dlg.appPanel.applicationField.getText().length() > 0) {
File f = new File(dlg.appPanel.applicationField.getText());
String appId = Util.generateId();
appList.addApp(
appId,
f.getParent().replace('\\', '/'),
f.getName().replace('\\', '/'),
dlg.appPanel.argumentsField.getText());
mt.setApp(appId);
}
if (dlg.iconPath.length() > 0)
mt.setIconPath(dlg.iconPath);
CurrentStorage.get().storeMimeTypesList();
this.initTypesList();
typesList.setSelectedValue(mt, true);
}
示例15: ppClearNote_actionPerformed
import net.sf.memoranda.util.CurrentStorage; //导入依赖的package包/类
void ppClearNote_actionPerformed(ActionEvent e) {
String msg;
if (notesList.getSelectedIndices().length > 1)
msg = Local.getString(Local.getString("Clear")) + " " + notesList.getSelectedIndices().length + " "
+ Local.getString("notes") + "\n" + Local.getString("Are you sure?");
else
msg = Local.getString("Clear note") + "\n'"
+ ((Note) notesList.getNote(notesList.getSelectedIndex())).getDate().getFullDateString() + "'\n"
+ Local.getString("Are you sure?");
int n = JOptionPane.showConfirmDialog(App.getFrame(), msg, Local.getString("Clear note"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
for (int i = 0; i < notesList.getSelectedIndices().length; i++) {
Note note = (Note) notesList.getNote(notesList.getSelectedIndices()[i]);
if (CurrentProject.getNoteList().getActiveNote() != null
&& note.getDate().equals(CurrentProject.getNoteList().getActiveNote().getDate())) {
/* Debug */ System.out.println("[DEBUG] Current note removed");
CurrentNote.set(null, true);
}
CurrentProject.getNoteList().removeNote(note.getDate(), note.getId());
CurrentStorage.get().removeNote(note);
}
bookmarksListPanel.notesList.update();
searchPanel.notesList.update();
notesListPanel.notesList.update();
notesList.updateUI();
notesList.clearSelection();
// notesList.requestFocus();*/
// ((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.editorPanel.editor.requestFocus();
}