本文整理汇总了Java中net.sf.memoranda.ProjectManager.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectManager.getProject方法的具体用法?Java ProjectManager.getProject怎么用?Java ProjectManager.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.ProjectManager
的用法示例。
在下文中一共展示了ProjectManager.getProject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tagB_actionPerformed
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
void tagB_actionPerformed(ActionEvent e) {
ProjectTagDialog dlg = new ProjectTagDialog(App.getFrame(), Local.getString("Add new tag"));
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 Tag
ProjectComboItem projectitem = (ProjectComboItem)dlg.project.getSelectedItem();
String projectid = projectitem.getValue();
Project p=ProjectManager.getProject(projectid);
Util.debug("Adding tag "+dlg.tag.getText()+ " for project " + projectitem.getValue());
if(Tag.addTagToProject(dlg.tag.getText(),p)){
JOptionPane.showMessageDialog(null, Local.getString("Tag added successfully to project ")+p.getTitle());
}
else{
JOptionPane.showMessageDialog(null, Local.getString("Tag was not added to project ")+p.getTitle());
}
}
示例2: setUpBeforeClass
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
today = CalendarDate.today();
tomorrow = CalendarDate.tomorrow();
dayAfterTomorrow = CalendarDate.tomorrow();
ProjectManager.createProject("FirstTestProject", "FirstTestProject", today, dayAfterTomorrow);
firstProject = ProjectManager.getProject("FirstTestProject");
firstDefectList = new DefectListImpl(firstProject);
firstDefectList.addDefect(today, today, 0, 0, 0, "First Defect");
firstDefectList.addDefect(today, tomorrow, 3, 4, 5, "Second Defect");
firstDefectList.addDefect(tomorrow, dayAfterTomorrow, 6, 6, 10, "Third Defect");
ProjectManager.createProject("SecondTestProject", "SecondTestProject", today, dayAfterTomorrow);
secondProject = ProjectManager.getProject("SecondTestProject");
secondDefectList = new DefectListImpl(secondProject);
secondDefectList.addDefect(today, today, 1, 2, 3, "Second Defect List: First Defect");
fileStorage = new FileStorage();
fileStorage.createProjectStorage(firstProject);
fileStorage.storeProjectManager();
}
示例3: setUpBeforeClass
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
today = CalendarDate.today();
tomorrow = CalendarDate.tomorrow();
fileStorage = new FileStorage();
Project pulledFirstProject = ProjectManager.getProject("FirstTestProject");
pulledFirstDefectList = fileStorage.openDefectList(pulledFirstProject);
Project pulledSecondProject = ProjectManager.getProject("SecondTestProject");
pulledSecondDefectList = fileStorage.openDefectList(pulledSecondProject);
}
示例4: testEndAfterStart
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
/**
* Test End date is before start date.
*/
@Test
public void testEndAfterStart() {
ProjectManager.createProject("6", "Basic Test", CalendarDate.tomorrow(), CalendarDate.today());
assertTrue(allProj+1 == ProjectManager.getAllProjectsNumber());
Project testPrj = ProjectManager.getProject("6");
assertTrue(testPrj.getEndDate().equals(testPrj.getStartDate()));
}
示例5: unpack
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File(JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例6: unpack
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File (JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例7: unpack
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pType = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, Project.Type.valueOf(pType), pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File (JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例8: unpack
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements(); ) {
ZipEntry ze = (ZipEntry) files.nextElement();
if (ze.isDirectory()) {
File theDirectory = new File(JN_DOCPATH + prj.getID() + "/" + ze.getName());
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() + "/" + ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while ((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
} catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from " + zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例9: unpack
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n = JOptionPane.showConfirmDialog(App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"), JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null) {
prj.setEndDate(new CalendarDate(pEndD));
}
// File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();) {
ZipEntry ze = (ZipEntry) files.nextElement();
if (ze.isDirectory()) {
File theDirectory = new File(JN_DOCPATH + prj.getID() + "/" + ze.getName());
// create this directory (including any necessary parent
// directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() + "/" + ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while ((len = inp.read(buffer)) >= 0) {
out.write(buffer, 0, len);
}
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
} catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from " + zipfile,
"Make sure that this file is a Memoranda project archive.");
}
}