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


Java ProjectManager.removeProject方法代码示例

本文整理汇总了Java中net.sf.memoranda.ProjectManager.removeProject方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectManager.removeProject方法的具体用法?Java ProjectManager.removeProject怎么用?Java ProjectManager.removeProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.memoranda.ProjectManager的用法示例。


在下文中一共展示了ProjectManager.removeProject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tearDown

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
	ProjectManager.removeProject(tp1.getID());
	ProjectManager.removeProject(tp2.getID());
	ProjectManager.removeProject(tp3.getID());
	ProjectManager.removeProject(tp4.getID());
	ProjectManager.removeProject(tp5.getID());
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:9,代码来源:ProjectManagerTest.java

示例2: testRemove

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@Test
public void testRemove(){
	int totalBefore = ProjectManager.getAllProjectsNumber();
	ProjectManager.removeProject(tp1.getID());
	ProjectManager.removeProject(tp4.getID());
	assertEquals(totalBefore-2,ProjectManager.getAllProjectsNumber());
	Vector allProj = ProjectManager.getAllProjects();
	boolean correctProj = true;
	for(Object o: allProj){
		correctProj &= !((Project)o).getTitle().equals("testProj1") && !((Project)o).getTitle().equals("testProj4");
	}
	assertTrue(correctProj);
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:14,代码来源:ProjectManagerTest.java

示例3: ppDeleteProject_actionPerformed

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
void ppDeleteProject_actionPerformed(ActionEvent e) {
	String msg;
	Project prj;
	Vector toremove = new Vector();
	if (prjTablePanel.projectsTable.getSelectedRows().length > 1) {
		msg = Local.getString("Delete") + " " + prjTablePanel.projectsTable.getSelectedRows().length + " "
				+ Local.getString("projects") + "\n" + Local.getString("Are you sure?");
	} else {
		prj = prjTablePanel.getSelectedProject();
		msg = Local.getString("Delete project") + " '" + prj.getTitle() + "'.\n" + Local.getString("Are you sure?");
	}

	int n = JOptionPane.showConfirmDialog(App.getFrame(), msg, Local.getString("Delete project"),
			JOptionPane.YES_NO_OPTION);
	if (n != JOptionPane.YES_OPTION) {
		return;
	}

	for (int i = 0; i < prjTablePanel.projectsTable.getSelectedRows().length; i++) {
		prj = (net.sf.memoranda.Project) prjTablePanel.projectsTable.getModel()
				.getValueAt(prjTablePanel.projectsTable.getSelectedRows()[i], ProjectsTablePanel.PROJECT);
		toremove.add(prj.getID());
	}
	for (int i = 0; i < toremove.size(); i++) {
		ProjectManager.removeProject((String) toremove.get(i));
	}
	CurrentStorage.get().storeProjectManager();
	prjTablePanel.projectsTable.clearSelection();
	prjTablePanel.updateUI();
	setMenuEnabled(false);
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:32,代码来源:ProjectsPanel.java

示例4: BDeleteProject_actionPerformed

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public void BDeleteProject_actionPerformed(ActionEvent e) {
	String msg;
	Project prj;
	prj = CurrentProject.get();
	msg = Local.getString("Delete project")
				+ " '"
				+ prj.getTitle()
				+ "'.\n"
				+ Local.getString("Are you sure?");

	int n =
		JOptionPane.showConfirmDialog(
			App.getFrame(),
			msg,
			Local.getString("Delete project"),
			JOptionPane.YES_NO_OPTION);
	if (n != JOptionPane.YES_OPTION)
		return;
	
	if(ProjectManager.getActiveProjectsNumber() > 1) 
		if(((Project)ProjectManager.getActiveProjects().toArray()[1]).equals(prj))
			CurrentProject.set((Project)(ProjectManager.getActiveProjects().toArray()[0]));
		else
			CurrentProject.set((Project)(ProjectManager.getActiveProjects().toArray()[1]));
	else
		CurrentProject.set(ProjectManager.createProject("Default Project", CalendarDate.today(), null));
	ProjectManager.removeProject(prj.getID());
	CurrentProject.set(CurrentProject.get());
	CurrentStorage.get().storeProjectManager();
	prjTablePanel.projectsTable.clearSelection();
	prjTablePanel.updateUI();
	setMenuEnabled(false);
	AgendaPanel.refresh(CalendarDate.today());
}
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:35,代码来源:ProjectsPanel.java

示例5: testNormalDeleteProject

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
/**
 * Tests an appropriate project deletion.
 */
@Test
public void testNormalDeleteProject() {
	if(allProj < 1) {
		ProjectManager.createProject("Default", CalendarDate.today(), null);
	}
	ProjectManager.removeProject("1");
	assertTrue(allProj-1 == ProjectManager.getAllProjectsNumber());
}
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:12,代码来源:ProjectCreationDeletionTest.java

示例6: testDeleteProjectRefresh

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@Test
public void testDeleteProjectRefresh() {
	AgendaPanel.setRefreshCount(0);
	ProjectManager.removeProject("My Project6");
	ProjectManager.removeProject("My Project5");
	ProjectManager.removeProject("My Project4");
	ProjectManager.removeProject("My Project3");
	ProjectManager.removeProject("My Project2");
	assert(AgendaPanel.getRefreshCount() == 5);
}
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:11,代码来源:TestAgendaRefresh.java

示例7: ppDeleteProject_actionPerformed

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
void ppDeleteProject_actionPerformed(ActionEvent e) {
	String msg;
	Project prj;
	Vector toremove = new Vector();
	if (prjTablePanel.projectsTable.getSelectedRows().length > 1)
		msg =
			Local.getString("Delete")
				+ " "
				+ prjTablePanel.projectsTable.getSelectedRows().length
				+ " "
				+ Local.getString("projects")
				+ "\n"
				+ Local.getString("Are you sure?");
	else {
		prj = prjTablePanel.getSelectedProject();
		msg =
			Local.getString("Delete project")
				+ " '"
				+ prj.getTitle()
				+ "'.\n"
				+ Local.getString("Are you sure?");
	}

	int n =
		JOptionPane.showConfirmDialog(
			App.getFrame(),
			msg,
			Local.getString("Delete project"),
			JOptionPane.YES_NO_OPTION);
	if (n != JOptionPane.YES_OPTION)
		return;

	for (int i = 0;
		i < prjTablePanel.projectsTable.getSelectedRows().length;
		i++) {
		prj =
			(net.sf.memoranda.Project) prjTablePanel
				.projectsTable
				.getModel()
				.getValueAt(
				prjTablePanel.projectsTable.getSelectedRows()[i],
				ProjectsTablePanel.PROJECT);
		toremove.add(prj.getID());
	}
	for (int i = 0; i < toremove.size(); i++) {
		ProjectManager.removeProject((String) toremove.get(i));
	}
	CurrentStorage.get().storeProjectManager();
	prjTablePanel.projectsTable.clearSelection();
	prjTablePanel.updateUI();
	setMenuEnabled(false);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:53,代码来源:ProjectsPanel.java

示例8: tearDown

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@After
public void tearDown() {
  ProjectManager.removeProject(project1.getID());
  ProjectManager.removeProject(project2.getID());
  CurrentStorage.get().storeProjectManager();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:7,代码来源:ProjectImplTest.java

示例9: tearDown

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@AfterClass
public static void tearDown() {
  ProjectManager.removeProject(project1.getID());
  ProjectManager.removeProject(project2.getID());
  CurrentStorage.get().storeProjectManager();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:7,代码来源:TagTest.java

示例10: removeProject_actionPerformed

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
void removeProject_actionPerformed(ActionEvent e) {
    String msg;
    Project prj;
    Vector toremove = new Vector();
    if (mainPanel.projectsTable.getSelectedRows().length > 1){
      msg =
        Local.getString("Delete")
          + " "
          + mainPanel.projectsTable.getSelectedRows().length
          + " "
          + Local.getString("projects")
          + "\n"
          + Local.getString("Are you sure?");
    } else {
      prj = mainPanel.getSelectedProject();
      msg =
        Local.getString("Delete project")
          + " '"
          + prj.getTitle()
          + "'.\n"
          + Local.getString("Are you sure?");
    }

    int n =
      JOptionPane.showConfirmDialog(
        App.getFrame(),
        msg,
        Local.getString("Delete project"),
        JOptionPane.YES_NO_OPTION);
    if (n != JOptionPane.YES_OPTION){
      return;
    }
    for (int i = 0;i < mainPanel.projectsTable.getSelectedRows().length;i++) {
      prj =
        (net.sf.memoranda.Project) mainPanel
          .projectsTable
          .getModel()
          .getValueAt(
          mainPanel.projectsTable.getSelectedRows()[i],
          ProjectsTablePanel.PROJECT);
      toremove.add(prj.getID());
    }
    for (int i = 0; i < toremove.size(); i++) {
      ProjectManager.removeProject((String) toremove.get(i));
    }
    CurrentStorage.get().storeProjectManager();
    mainPanel.projectsTable.clearSelection();
    mainPanel.updateUI();
    //setMenuEnabled(false);
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:51,代码来源:ProjectManagerDialog.java

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

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

示例13: ppDeleteProject_actionPerformed

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
void ppDeleteProject_actionPerformed(ActionEvent e) {
	String msg;
	Project prj;
	Vector<String> toRemove = new Vector<String>();
	if (prjTablePanel.projectsTable.getSelectedRows().length > 1)
		msg =
			Local.getString("Delete")
				+ " "
				+ prjTablePanel.projectsTable.getSelectedRows().length
				+ " "
				+ Local.getString("projects")
				+ "\n"
				+ Local.getString("Are you sure?");
	else {
		prj = prjTablePanel.getSelectedProject();
		msg =
			Local.getString("Delete project")
				+ " '"
				+ prj.getTitle()
				+ "'.\n"
				+ Local.getString("Are you sure?");
	}

	int n =
		JOptionPane.showConfirmDialog(
			App.getFrame(),
			msg,
			Local.getString("Delete project"),
			JOptionPane.YES_NO_OPTION);
	if (n != JOptionPane.YES_OPTION)
		return;

	for (int i = 0;
		i < prjTablePanel.projectsTable.getSelectedRows().length;
		i++) {
		prj =
			(net.sf.memoranda.Project) prjTablePanel
				.projectsTable
				.getModel()
				.getValueAt(
				prjTablePanel.projectsTable.getSelectedRows()[i],
				ProjectsTablePanel.PROJECT);
		toRemove.add(prj.getID());
	}
	for (String remove : toRemove) {
		ProjectManager.removeProject(remove);
	}
	CurrentStorage.get().storeProjectManager();
	prjTablePanel.projectsTable.clearSelection();
	prjTablePanel.updateUI();
	setMenuEnabled(false);
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:53,代码来源:ProjectsPanel.java

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

示例15: ppDeleteProject_actionPerformed

import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
private void ppDeleteProject_actionPerformed() {
    String msg;
    Project prj;
    Vector<String> toremove = new Vector<String>();
    if (prjTablePanel.projectsTable.getSelectedRows().length > 1)
        msg =
                Local.getString("Delete")
                        + " "
                        + prjTablePanel.projectsTable.getSelectedRows().length
                        + " "
                        + Local.getString("projects")
                        + "\n"
                        + Local.getString("Are you sure?");
    else {
        prj = prjTablePanel.getSelectedProject();
        msg =
                Local.getString("Delete project")
                        + " '"
                        + prj.getTitle()
                        + "'.\n"
                        + Local.getString("Are you sure?");
    }

    int n =
            JOptionPane.showConfirmDialog(
                    App.getFrame(),
                    msg,
                    Local.getString("Delete project"),
                    JOptionPane.YES_NO_OPTION);
    if (n != JOptionPane.YES_OPTION)
        return;

    for (int i = 0;
         i < prjTablePanel.projectsTable.getSelectedRows().length;
         i++) {
        prj =
                (net.sf.memoranda.Project) prjTablePanel
                        .projectsTable
                        .getModel()
                        .getValueAt(
                                prjTablePanel.projectsTable.getSelectedRows()[i],
                                ProjectsTablePanel.PROJECT);
        toremove.add(prj.getID());
    }
    for (String aToremove : toremove) {
        ProjectManager.removeProject(aToremove);
    }
    CurrentStorage.get().storeProjectManager();
    prjTablePanel.projectsTable.clearSelection();
    prjTablePanel.updateUI();
    setMenuEnabled();
}
 
开发者ID:cst316,项目名称:spring16project-Team-Laredo,代码行数:53,代码来源:ProjectsPanel.java


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