本文整理汇总了Java中net.sf.memoranda.CurrentNote.get方法的典型用法代码示例。如果您正苦于以下问题:Java CurrentNote.get方法的具体用法?Java CurrentNote.get怎么用?Java CurrentNote.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.CurrentNote
的用法示例。
在下文中一共展示了CurrentNote.get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入方法依赖的package包/类
void previewB_actionPerformed(ActionEvent e) {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8",
false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath());
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例2: getCellRenderer
import net.sf.memoranda.CurrentNote; //导入方法依赖的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;
}
};
}
示例3: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入方法依赖的package包/类
void previewB_actionPerformed(ActionEvent e) {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8",
false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath().replace("\\", "/"));
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例4: getCellRenderer
import net.sf.memoranda.CurrentNote; //导入方法依赖的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;
}
};
}
示例5: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入方法依赖的package包/类
private void previewB_actionPerformed() {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8",
false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath());
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例6: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入方法依赖的package包/类
void previewB_actionPerformed(ActionEvent e) {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8", false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath());
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例7: getCellRenderer
import net.sf.memoranda.CurrentNote; //导入方法依赖的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);
//Possible future use, allows user to click on star to add bookmark
//Not fully functional.
/*list.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
int pointIndex = list.locationToIndex(p);
Note currentNote = getNote(pointIndex);
//NotesControlPanel ncp = new NotesControlPanel();
if(p.getX() < 10){
if(currentNote.isMarked()){
currentNote.setMark(false);
//ncp.ppRemoveBkmrk_actionPerformed(currentNote);
//list.updateUI();
list.repaint();
}
else{
currentNote.setMark(true);
//ncp.ppAddBkmrk_actionPerformed(currentNote);
//list.updateUI();
list.repaint();
}
}
}
});*/
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);
}
else{
//All new notes will be initialized with an empty star.
label.setIcon(emptyStar);
}
//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;
}
};
}
示例8: exportB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入方法依赖的package包/类
void exportB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put("FileChooser.lookInLabelText", Local.getString("Save in:"));
UIManager.put("FileChooser.upFolderToolTipText", Local.getString("Up One Level"));
UIManager.put("FileChooser.newFolderToolTipText", Local.getString("Create New Folder"));
UIManager.put("FileChooser.listViewButtonToolTipText", Local.getString("List"));
UIManager.put("FileChooser.detailsViewButtonToolTipText", Local.getString("Details"));
UIManager.put("FileChooser.fileNameLabelText", Local.getString("File Name:"));
UIManager.put("FileChooser.filesOfTypeLabelText", Local.getString("Files of Type:"));
UIManager.put("FileChooser.saveButtonText", Local.getString("Save"));
UIManager.put("FileChooser.saveButtonToolTipText", Local.getString("Save selected file"));
UIManager.put("FileChooser.cancelButtonText", Local.getString("Cancel"));
UIManager.put("FileChooser.cancelButtonToolTipText", Local.getString("Cancel"));
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Export note"));
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.addChoosableFileFilter(new AllFilesFilter(AllFilesFilter.XHTML));
chooser.addChoosableFileFilter(new AllFilesFilter(AllFilesFilter.HTML));
// chooser.addChoosableFileFilter(new
// AllFilesFilter(AllFilesFilter.RTF));
String lastSel = (String) Context.get("LAST_SELECTED_EXPORT_FILE");
if (lastSel != null) {
chooser.setCurrentDirectory(new File(lastSel));
}
FileExportDialog dlg = new FileExportDialog(App.getFrame(), Local.getString("Export note"), chooser);
String enc = (String) Context.get("EXPORT_FILE_ENCODING");
exportB_actionPerformed_checkFor_dlg(dlg, enc);
Dimension dlgSize = new Dimension(550, 475);
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;
}
Context.put("LAST_SELECTED_EXPORT_FILE", chooser.getSelectedFile().getPath());
Context.put("EXPORT_FILE_ENCODING", dlg.encCB.getSelectedItem());
Context.put("EXPORT_NUMENT", dlg.numentChB.isSelected() ? "YES" : "NO");
Context.put("EXPORT_XHTML", dlg.xhtmlChB.isSelected() ? "YES" : "NO");
String template = null;
if (dlg.usetemplChB.isSelected() && dlg.templF.getText().length() > 0) {
template = dlg.templF.getText();
Context.put("EXPORT_TEMPLATE", template);
}
/*
* if (chooser.getFileFilter().getDescription().equals("Rich Text
* Format")) new RTFFileExport(chooser.getSelectedFile(),
* editor.document); else
*/
int ei = dlg.encCB.getSelectedIndex();
enc = null;
if (ei == 1) {
enc = "UTF-8";
}
File f = chooser.getSelectedFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), enc, dlg.numentChB.isSelected(), template,
dlg.xhtmlChB.isSelected());
}
示例9: getCellRenderer
import net.sf.memoranda.CurrentNote; //导入方法依赖的package包/类
@Override
public ListCellRenderer getCellRenderer() {
return new DefaultListCellRenderer() {
@Override
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;
}
};
}