本文整理汇总了Java中net.sf.memoranda.ui.App类的典型用法代码示例。如果您正苦于以下问题:Java App类的具体用法?Java App怎么用?Java App使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
App类属于net.sf.memoranda.ui包,在下文中一共展示了App类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureSizes
import net.sf.memoranda.ui.App; //导入依赖的package包/类
/**
* Initializes dlgDimension, other dimensions based on it,
* sets some component sizings.
*/
private void configureSizes() {
dlgDimension = new Dimension();
dlgDimension.setSize(
App.getFrame().getSize().width / 3,
App.getFrame().getSize().height / 3
);
this.setMinimumSize(dlgDimension);
projectBox.setPreferredSize(
new Dimension(
dlgDimension.width / 3,
projectBox.getPreferredSize().height
)
);
editTagTxtField.setPreferredSize(
new Dimension(
dlgDimension.width / 3,
editTagTxtField.getPreferredSize().height
)
);
tagSelectBox.setPreferredSize(new Dimension(0, 27));
}
示例2: newEstimateB_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的package包/类
private void newEstimateB_actionPerformed(ActionEvent e, String tasktext, Date startDate, Date endDate) {
EstimateDialog dlg = new EstimateDialog(App.getFrame(), Local.getString("New Estimate Worksheet"));
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
dlg.setVisible(true);
if (dlg.CANCELLED)
return;
// create Estimate
int size = (int)dlg.loc.getValue();
int time = (int)dlg.minutes.getValue();
//PSP.Phase phase = PSP.Phase.valueOf(PSP.reverseConversion(dlg.phase.getSelectedItem().toString(),0));
PSP.Phase phase = PSP.Phase.valueOf(dlg.phase.getSelectedItem().toString());
String comments = dlg.comments.getText();
String mod = dlg.module.getText();
EstimateManager.createEstimate(phase, mod, size, time, comments);
saveEstimate();
}
示例3: checkBrowser
import net.sf.memoranda.ui.App; //导入依赖的package包/类
public static boolean checkBrowser() {
AppList appList = MimeTypesList.getAppList();
String bpath = appList.getBrowserExec();
if (bpath != null)
if (new File(bpath).isFile())
return true;
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Select the web-browser executable"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
/*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE");
if (lastSel != null)
chooser.setCurrentDirectory(lastSel);*/
if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION)
return false;
appList.setBrowserExec(chooser.getSelectedFile().getPath());
CurrentStorage.get().storeMimeTypesList();
return true;
}
示例4: checkBrowser
import net.sf.memoranda.ui.App; //导入依赖的package包/类
/**
* From AppList's list of executables it searches for an already known
* browser executable file path. If one is found (meaning a browser has
* been opened prior and the executable was found) then control returns
* to runBrowser. If not, the file path is found through user navigation
* using FileChooser. Once found, the path is saved to the AppList for
* future calls to open a browser.
* @return boolean
*/
public static boolean checkBrowser() {
AppList appList = MimeTypesList.getAppList();
String bpath = appList.getBrowserExec();
if (bpath != null)
if (new File(bpath).isFile())
return true;
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Select the web-browser executable"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
/*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE");
if (lastSel != null)
chooser.setCurrentDirectory(lastSel);*/
if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION)
return false;
appList.setBrowserExec(chooser.getSelectedFile().getPath());
CurrentStorage.get().storeMimeTypesList();
return true;
}
示例5: setBrowser
import net.sf.memoranda.ui.App; //导入依赖的package包/类
/**
* Sets the browser via a java dialogue box in which
* the user can select the .exe for use.
*
* @return true if successful, false otherwise
*/
public static boolean setBrowser(){
AppList appList = MimeTypesList.getAppList();
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Select the web-browser executable"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
/*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE");
if (lastSel != null)
chooser.setCurrentDirectory(lastSel);*/
if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION)
return false;
appList.setBrowserExec(chooser.getSelectedFile().getPath());
CurrentStorage.get().storeMimeTypesList();
return true;
}
示例6: checkBrowser
import net.sf.memoranda.ui.App; //导入依赖的package包/类
public static boolean checkBrowser() {
AppList appList = MimeTypesList.getAppList();
String bpath = appList.getBrowserExec();
if (bpath != null)
if (new File(bpath).isFile())
return true;
File root = new File(System.getProperty("user.home"));
FileSystemView fsv = new SingleRootFileSystemView(root);
JFileChooser chooser = new JFileChooser(fsv);
chooser.setFileHidingEnabled(true);
chooser.setDialogTitle(Local.getString("Select the web-browser executable"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
/*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE");
if (lastSel != null)
chooser.setCurrentDirectory(lastSel);*/
if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION)
return false;
appList.setBrowserExec(chooser.getSelectedFile().getPath());
CurrentStorage.get().storeMimeTypesList();
return true;
}
示例7: checkBrowser
import net.sf.memoranda.ui.App; //导入依赖的package包/类
public static boolean checkBrowser() {
AppList appList = MimeTypesList.getAppList();
String bpath = appList.getBrowserExec();
if (bpath != null) {
if (new File(bpath).isFile()) {
return true;
}
}
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Select the web-browser executable"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
/*
* java.io.File lastSel = (java.io.File)
* Context.get("LAST_SELECTED_RESOURCE_FILE"); if (lastSel != null)
* chooser.setCurrentDirectory(lastSel);
*/
if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION) {
return false;
}
appList.setBrowserExec(chooser.getSelectedFile().getPath());
CurrentStorage.get().storeMimeTypesList();
return true;
}
示例8: ppRemoveBkmrk_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的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();
}
示例9: editTag_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的package包/类
public static void editTag_actionPerformed(ActionEvent e) {
EditProjectTagController dlg = new EditProjectTagController(App.getFrame(), "Edit Project Tags");
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width) / 3 + loc.x, (frmSize.height) / 3 + loc.y);
dlg.setVisible(true);
}
示例10: removeEstimateB_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的package包/类
private void removeEstimateB_actionPerformed(ActionEvent e) {
String msg;
Estimate est;
if (estimateTable.getSelectedRows().length > 1)
msg = Local.getString("Remove") + " " + estimateTable.getSelectedRows().length
+ " " + Local.getString("estimate") + "\n" + Local.getString("Are you sure?");
else {
est = (Estimate)estimateTable.getModel().getValueAt(
estimateTable.getSelectedRow(),
EstimateTable.ESTIMATE);
msg = Local.getString("Remove estimate") + "\n'"
+ est.getComments() + "'\n" + Local.getString("Are you sure?");
}
int n = JOptionPane.showConfirmDialog(
App.getFrame(),
msg,
Local.getString("Remove estimate"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
for (int i = 0; i < estimateTable.getSelectedRows().length; i++) {
est = (Estimate)estimateTable.getModel().getValueAt(
estimateTable.getSelectedRows()[i],
EstimateTable.ESTIMATE);
EstimateManager.removeEstimate(est);
}
estimateTable.getSelectionModel().clearSelection();
saveEstimate();
}
示例11: removeTimelogB_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的package包/类
private void removeTimelogB_actionPerformed(ActionEvent e) {
String msg;
TimeLog tl;
if (timelogTable.getSelectedRows().length > 1)
msg = Local.getString("Remove") + " " + timelogTable.getSelectedRows().length
+ " " + Local.getString("time logs") + "\n" + Local.getString("Are you sure?");
else {
tl = (TimeLog)timelogTable.getModel().getValueAt(
timelogTable.getSelectedRow(),
TimeLogTable.TIMELOG);
msg = Local.getString("Remove time log") + "\n'"
+ tl.getComments() + "'\n" + Local.getString("Are you sure?");
}
int n = JOptionPane.showConfirmDialog(
App.getFrame(),
msg,
Local.getString("Remove time log"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
for (int i = 0; i < timelogTable.getSelectedRows().length; i++) {
tl = (TimeLog)timelogTable.getModel().getValueAt(
timelogTable.getSelectedRows()[i],
TimeLogTable.TIMELOG);
TimeLogManager.removeTimelog(tl);
}
timelogTable.getSelectionModel().clearSelection();
saveTimeLogs();
}
示例12: newDefectlogB_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的package包/类
private void newDefectlogB_actionPerformed(ActionEvent e, String tasktext, Date startDate, Date endDate) {
DefectLogDialog dlg = new DefectLogDialog(App.getFrame(), Local.getString("New Defect Log"));
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
dlg.setVisible(true);
if (dlg.CANCELLED)
return;
// create defect log
Date defectDate = (Date)dlg.date.getValue();
LocalDateTime defectDateTime = LocalDateTime.ofInstant(defectDate.toInstant(), ZoneId.systemDefault());
int defectNum = DefectLogManager.getDefectLogsForProject(CurrentProject.get()).size() + 1;
int fixMin = (int)dlg.fixMin.getValue();
int reference = (int)dlg.reference.getValue();
PSP.Defect defectType = PSP.Defect.valueOf(dlg.defectType.getSelectedItem().toString());
PSP.Phase injectPhase = PSP.Phase.valueOf(dlg.injectPhase.getSelectedItem().toString());
PSP.Phase removePhase = PSP.Phase.valueOf(dlg.removePhase.getSelectedItem().toString());
//PSP.Defect defectType = PSP.Defect.valueOf(PSP.reverseTypeConversion(dlg.defectType.getSelectedItem().toString(),0));
//PSP.Phase injectPhase = PSP.Phase.valueOf(PSP.reverseConversion(dlg.injectPhase.getSelectedItem().toString(),0));
//PSP.Phase removePhase = PSP.Phase.valueOf(PSP.reverseConversion(dlg.removePhase.getSelectedItem().toString(),0));
String description = dlg.description.getText();
DefectLogManager.createDefectLog(defectDateTime, defectNum, defectType, injectPhase, removePhase, fixMin, reference, description);
saveDefectLogs();
}
示例13: removeDefectlogB_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的package包/类
private void removeDefectlogB_actionPerformed(ActionEvent e) {
String msg;
DefectLog dl;
if (defectlogTable.getSelectedRows().length > 1)
msg = Local.getString("Remove") + " " + defectlogTable.getSelectedRows().length
+ " " + Local.getString("defect logs") + "\n" + Local.getString("Are you sure?");
else {
dl = (DefectLog)defectlogTable.getModel().getValueAt(
defectlogTable.getSelectedRow(),
DefectLogTable.DEFECTLOG);
msg = Local.getString("Remove defect log") + "\n'"
+ dl.getDescription() + "'\n" + Local.getString("Are you sure?");
}
int n = JOptionPane.showConfirmDialog(
App.getFrame(),
msg,
Local.getString("Remove defect log"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
for (int i = 0; i < defectlogTable.getSelectedRows().length; i++) {
dl = (DefectLog)defectlogTable.getModel().getValueAt(
defectlogTable.getSelectedRows()[i],
TimeLogTable.TIMELOG);
DefectLogManager.removeDefectLog(dl);
}
defectlogTable.getSelectionModel().clearSelection();
saveDefectLogs();
}
示例14: ppRemoveBkmrk_actionPerformed
import net.sf.memoranda.ui.App; //导入依赖的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();
}
示例15: set
import net.sf.memoranda.ui.App; //导入依赖的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());
App.reload(true);
}