当前位置: 首页>>代码示例>>Java>>正文


Java CurrentStorage类代码示例

本文整理汇总了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));
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:22,代码来源:EditorPanel.java

示例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;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:17,代码来源:ResourcesPanel.java

示例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();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:19,代码来源:ResourceTypePanel.java

示例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;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:24,代码来源:ResourcesPanel.java

示例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();
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:23,代码来源:ResourceTypePanel.java

示例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;
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:18,代码来源:ResourcesPanel.java

示例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;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:18,代码来源:ResourcesPanel.java

示例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;
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:17,代码来源:ProjectManager.java

示例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;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:12,代码来源:ProjectManager.java

示例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;
        }
    }
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:16,代码来源:ProjectManager.java

示例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());
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:14,代码来源:CurrentProject.java

示例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();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:9,代码来源:CurrentProject.java

示例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");*/
  }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:9,代码来源:DailyItemsPanel.java

示例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);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:40,代码来源:ResourceTypePanel.java

示例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();
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:34,代码来源:NotesControlPanel.java


注:本文中的net.sf.memoranda.util.CurrentStorage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。