本文整理汇总了Java中net.sf.memoranda.Note类的典型用法代码示例。如果您正苦于以下问题:Java Note类的具体用法?Java Note怎么用?Java Note使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Note类属于net.sf.memoranda包,在下文中一共展示了Note类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDocument
import net.sf.memoranda.Note; //导入依赖的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: setDocument
import net.sf.memoranda.Note; //导入依赖的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());
tagsField.setText(note.getTags());
}
else {
titleField.setText("");
tagsField.setText("");
}
initialTitle = titleField.getText();
initialTags = tagsField.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));
}
示例3: noteToDocument
import net.sf.memoranda.Note; //导入依赖的package包/类
private Document noteToDocument(Note note, String noteHtmlContents) {
Document d = new Document ();
String id = note.getId ();
Project project = note.getProject();
String projectId = project.getID();
String projectName = project.getTitle();
String title = note.getTitle ();
String date = note.getDate() != null ? new SimpleDateFormat ("yyyy-MM-dd").format(note.getDate().getDate()) : null;
d.add (new StringField ("id", id, Field.Store.YES));
d.add (new StringField ("project_id", projectId, Field.Store.YES));
d.add (new StoredField ("project_name", projectName));
d.add (new TextField ("title", title, Field.Store.YES));
d.add (new TextField ("title_cs", title, Field.Store.YES));
d.add (new TextField ("date", date != null ? date : "", Field.Store.YES));
d.add (new TextField ("body", noteHtmlContents, Field.Store.YES));
return d;
}
示例4: ppAddBkmrk_actionPerformed
import net.sf.memoranda.Note; //导入依赖的package包/类
void ppAddBkmrk_actionPerformed(ActionEvent e) {
for (int i = 0; i < notesList.getSelectedIndices().length; i++) {
Note note = (Note) notesList.getNote(notesList.getSelectedIndices()[i]);
note.setMark(true);
}
notesList.updateUI();
bookmarksListPanel.notesList.update();
ppSetEnabled();
}
示例5: ppRemoveBkmrk_actionPerformed
import net.sf.memoranda.Note; //导入依赖的package包/类
void ppRemoveBkmrk_actionPerformed(ActionEvent e) {
for (int i = 0; i < notesList.getSelectedIndices().length; i++) {
Note note = (Note) notesList.getNote(notesList.getSelectedIndices()[i]);
note.setMark(false);
}
bookmarksListPanel.notesList.update();
ppSetEnabled();
notesList.updateUI();
notesList.clearSelection();
((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.editorPanel.editor.requestFocus();
}
示例6: currentNoteChanged
import net.sf.memoranda.Note; //导入依赖的package包/类
void currentNoteChanged(Note note, boolean toSaveCurrentNote) {
// Util.debug("currentNoteChanged");
if (editorPanel.isDocumentChanged()) {
if (toSaveCurrentNote) {
saveNote();
}
notesControlPane.refresh();
}
currentNote = note;
editorPanel.setDocument(currentNote);
calendar.set(CurrentDate.get());
editorPanel.editor.requestFocus();
}
示例7: ppAddBkmrk_actionPerformed
import net.sf.memoranda.Note; //导入依赖的package包/类
void ppAddBkmrk_actionPerformed(ActionEvent e) {
for (int i = 0; i < notesList.getSelectedIndices().length; i++) {
Note note = (Note) notesList.getNote(notesList.getSelectedIndices()[i]);
note.setMark(true);
}
notesList.updateUI();
bookmarksListPanel.notesList.update();
ppSetEnabled();
}
示例8: getCellRenderer
import net.sf.memoranda.Note; //导入依赖的package包/类
public ListCellRenderer getCellRenderer() {
return new DefaultListCellRenderer() {
public Component getListCellRendererComponent(
JList list,
Object value, // value to display
int index, // cell index
boolean isSelected, // is the cell selected
boolean cellHasFocus) // the list and the cell have the focus
{
JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
String s = value.toString();
label.setText(s);
//Note currentNote = CurrentProject.getNoteList().getActiveNote();
Note currentNote = CurrentNote.get();
if (currentNote != null) {
if (getNote(index).getId().equals(currentNote.getId()))
label.setFont(label.getFont().deriveFont(Font.BOLD));
}
if (getNote(index).isMarked())
label.setIcon(bookmarkIcon);
//setIcon();
/*if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
setEnabled(list.isEnabled());
setFont(list.getFont());
setOpaque(true);*/
label.setToolTipText(s);
return label;
}
};
}
示例9: HTMLFileExport
import net.sf.memoranda.Note; //导入依赖的package包/类
/**
* Constructor for HTMLFileExport.
*/
public HTMLFileExport(File f, Document doc, Note note, String charset, boolean num, String templFile, boolean xhtml) {
this.f = f;
this.doc = (HTMLDocument)doc;
this.note = note;
this.charset = charset;
this.num = num;
this.templFile = templFile;
this.xhtml = xhtml;
doExport();
}
示例10: ppSetEnabled
import net.sf.memoranda.Note; //导入依赖的package包/类
void ppSetEnabled() {
boolean enbl = (notesList.getModel().getSize() > 0) && (notesList.getSelectedIndex() > -1);
ppRemoveBkmrk.setEnabled(enbl && (((Note) notesList.getNote(notesList.getSelectedIndex())).isMarked())
|| notesList.getSelectedIndices().length > 1);
ppAddBkmrk.setEnabled(enbl && !(((Note) notesList.getNote(notesList.getSelectedIndex())).isMarked())
|| notesList.getSelectedIndices().length > 1);
ppOpenNote.setEnabled(enbl);
ppClearNote.setEnabled(enbl);
}
示例11: ppSetEnabled
import net.sf.memoranda.Note; //导入依赖的package包/类
void ppSetEnabled() {
boolean enbl = (notesList.getModel().getSize() > 0) && (notesList.getSelectedIndex() > -1);
ppRemoveBkmrk.setEnabled(enbl && (((Note) notesList.getNote(notesList.getSelectedIndex())).isMarked())
|| notesList.getSelectedIndices().length > 1);
ppAddBkmrk.setEnabled(enbl && !(((Note) notesList.getNote(notesList.getSelectedIndex())).isMarked())
|| notesList.getSelectedIndices().length > 1);
ppOpenNote.setEnabled(enbl);
ppClearNote.setEnabled(enbl);
}
示例12: currentNoteChanged
import net.sf.memoranda.Note; //导入依赖的package包/类
/**
* If a note is changed it is saved and then the panel is refreshed.
* @param note
* @param toSaveCurrentNote
*/
void currentNoteChanged(Note note, boolean toSaveCurrentNote) {
if (editorPanel.isDocumentChanged()) {
if (toSaveCurrentNote) {
saveNote();
}
notesControlPane.refresh();
}
currentNote = note;
editorPanel.setDocument(currentNote);
calendar.set(CurrentDate.get());
editorPanel.editor.requestFocus();
}
示例13: NotesList
import net.sf.memoranda.Note; //导入依赖的package包/类
public NotesList(int type) {
super();
if(Configuration.get("NOTES_SORT_ORDER").toString().equalsIgnoreCase("true")) {
sortOrderDesc = true;
}
_type = type;
this.setFont(new java.awt.Font("Dialog", 0, 11));
this.setModel(new NotesListModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
updateUI();
}
});
CurrentNote.addNoteListener(new NoteListener() {
public void noteChange(Note n, boolean toSaveCurrentNote) {
updateUI();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, ResourcesList rl) {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}
示例14: getCellRenderer
import net.sf.memoranda.Note; //导入依赖的package包/类
public ListCellRenderer getCellRenderer() {
return new DefaultListCellRenderer() {
public Component getListCellRendererComponent(
JList list,
Object value, // value to display
int index, // cell index
boolean isSelected, // is the cell selected
boolean cellHasFocus) // the list and the cell have the focus
{
JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
String s = value.toString();
label.setText(s);
//Note currentNote = CurrentProject.getNoteList().getActiveNote();
Note currentNote = CurrentNote.get();
if (currentNote != null) {
if (getNote(index).getId().equals(currentNote.getId()))
label.setFont(label.getFont().deriveFont(Font.BOLD));
}
if (getNote(index).isMarked())
label.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.STAR, 8, ColorMap.ICON));
//setIcon();
/*if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
setEnabled(list.isEnabled());
setFont(list.getFont());
setOpaque(true);*/
label.setToolTipText(s);
return label;
}
};
}
示例15: ppRemoveBkmrk_actionPerformed
import net.sf.memoranda.Note; //导入依赖的package包/类
void ppRemoveBkmrk_actionPerformed(Note note) {
note.setMark(false);
bookmarksListPanel.notesList.update();
ppSetEnabled();
notesList.updateUI();
notesList.clearSelection();
((AppFrame) App.getFrame()).workPanel.dailyItemsPanel.editorPanel.editor.requestFocus();
}