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


Java Util.generateId方法代码示例

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


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

示例1: newTypeB_actionPerformed

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
void newTypeB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New resource type"));
    Dimension dlgSize = new Dimension(420, 420);
    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.extField.setText(ext);
    dlg.descField.setText(ext);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.iconLabel.setIcon(
        new ImageIcon(
            net.sf.memoranda.ui.AppFrame.class.getResource("resources/icons/mimetypes/default.png")));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = Util.generateId();
    MimeType mt = MimeTypesList.addMimeType(typeId);
    String[] exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    AppList appList = MimeTypesList.getAppList();
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:40,代码来源:ResourceTypePanel.java

示例2: createTask

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public Task createTask(CalendarDate startDate, CalendarDate endDate, String text, int priority, long effort, String description, String parentTaskId) {
      Element el = new Element("task");
      el.addAttribute(new Attribute("startDate", startDate.toString()));
      el.addAttribute(new Attribute("endDate", endDate != null? endDate.toString():""));
String id = Util.generateId();
      el.addAttribute(new Attribute("id", id));
      el.addAttribute(new Attribute("progress", "0"));
      el.addAttribute(new Attribute("effort", String.valueOf(effort)));        
      el.addAttribute(new Attribute("priority", String.valueOf(priority)));
              
      Element txt = new Element("text");
      txt.appendChild(text);
      el.appendChild(txt);

      Element desc = new Element("description");
      desc.appendChild(description);
      el.appendChild(desc);

      if (parentTaskId == null) {
          _root.appendChild(el);
      }
      else {
          Element parent = getTaskElement(parentTaskId);
          parent.appendChild(el);
      }
      
elements.put(id, el);

      Util.debug("Created task with parent " + parentTaskId);
      
      return new TaskImpl(el, this);
  }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:33,代码来源:TaskListImpl.java

示例3: createTask

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
/**
 * @see net.sf.memoranda.TaskList#createTask(CalendarDate, CalendarDate, String, int, long, String, String)
 */
public Task createTask(CalendarDate startDate,
        CalendarDate endDate,
        String text,
        int priority,
        long effort,
        String description,
        String parentTaskId) {

    Element el = new Element("task");
    el.addAttribute(new Attribute("startDate", startDate.toString()));
    el.addAttribute(new Attribute("endDate", endDate != null? endDate.toString():""));
    String id = Util.generateId();
    el.addAttribute(new Attribute("id", id));
    el.addAttribute(new Attribute("progress", "0"));
    el.addAttribute(new Attribute("effort", String.valueOf(effort)));
    el.addAttribute(new Attribute("priority", String.valueOf(priority)));
            
    Element txt = new Element("text");
    txt.appendChild(text);
    el.appendChild(txt);

    Element desc = new Element("description");
    desc.appendChild(description);
    el.appendChild(desc);

    if (parentTaskId == null) {
        _root.appendChild(el);
    }
    else {
        Element parent = getTaskElement(parentTaskId);
        parent.appendChild(el);
    }
    
    elements.put(id, el);
    
    Util.debug("Created task with parent " + parentTaskId);
    
    return new TaskImpl(el, this);
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:43,代码来源:TaskListImpl.java

示例4: createTask

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public Task createTask(CalendarDate startDate, CalendarDate endDate, String text, int priority, long effort, 
  		String description, int defectNum, int defectRemCount, String parentTaskId) {
      Element el = new Element("task");
      el.addAttribute(new Attribute("startDate", startDate.toString()));
      el.addAttribute(new Attribute("endDate", endDate != null? endDate.toString():""));
String id = Util.generateId();
      el.addAttribute(new Attribute("id", id));
      el.addAttribute(new Attribute("progress", "0"));
      el.addAttribute(new Attribute("effort", String.valueOf(effort)));
      el.addAttribute(new Attribute("priority", String.valueOf(priority)));
      // added to create attribute for defect counts
      el.addAttribute(new Attribute("defectNum", Integer.toString(defectNum)));
      el.addAttribute(new Attribute("defectRemovedNum", Integer.toString(defectRemCount)));
              
      Element txt = new Element("text");
      txt.appendChild(text);
      el.appendChild(txt);

      Element desc = new Element("description");
      desc.appendChild(description);
      el.appendChild(desc);

      if (parentTaskId == null) {
          _root.appendChild(el);
      }
      else {
          Element parent = getTaskElement(parentTaskId);
          parent.appendChild(el);
      }
      
elements.put(id, el);

      Util.debug("Created task with parent " + parentTaskId);
      
      return new TaskImpl(el, this);
  }
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:37,代码来源:TaskListImpl.java

示例5: createTask

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public Task createTask(CalendarDate startDate, CalendarDate endDate, String text, int priority, long effort, String description, String parentTaskId) {
      Element el = new Element("task");
      el.addAttribute(new Attribute("startDate", startDate.toString()));
      el.addAttribute(new Attribute("endDate", endDate != null? endDate.toString():""));
String id = Util.generateId();
      el.addAttribute(new Attribute("id", id));
      el.addAttribute(new Attribute("progress", "0"));
      el.addAttribute(new Attribute("effort", String.valueOf(effort)));
      el.addAttribute(new Attribute("priority", String.valueOf(priority)));
              
      Element txt = new Element("text");
      txt.appendChild(text);
      el.appendChild(txt);

      Element desc = new Element("description");
      desc.appendChild(description);
      el.appendChild(desc);

      if (parentTaskId == null) {
          _root.appendChild(el);
      }
      else {
          Element parent = getTaskElement(parentTaskId);
          parent.appendChild(el);
      }
      
elements.put(id, el);

      Util.debug("Created task with parent " + parentTaskId);
      
      return new TaskImpl(el, this);
  }
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:33,代码来源:TaskListImpl.java

示例6: createTask

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public Task createTask(CalendarDate startDate, CalendarDate endDate, String text, int priority, long effort, long actual, String description, String parentTaskId) {
      Element el = new Element("task");
      el.addAttribute(new Attribute("startDate", startDate.toString()));
      el.addAttribute(new Attribute("endDate", endDate != null? endDate.toString():""));
String id = Util.generateId();
      el.addAttribute(new Attribute("id", id));
      el.addAttribute(new Attribute("progress", "0"));
      el.addAttribute(new Attribute("effort", String.valueOf(effort)));
      el.addAttribute(new Attribute("actual", String.valueOf(actual)));
      el.addAttribute(new Attribute("priority", String.valueOf(priority)));
              
      Element txt = new Element("text");
      txt.appendChild(text);
      el.appendChild(txt);

      Element desc = new Element("description");
      desc.appendChild(description);
      el.appendChild(desc);

      if (parentTaskId == null) {
          _root.appendChild(el);
      }
      else {
          Element parent = getTaskElement(parentTaskId);
          parent.appendChild(el);
      }
      
elements.put(id, el);

      Util.debug("Created task with parent " + parentTaskId);
      
      return new TaskImpl(el, this);
  }
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:34,代码来源:CommitListImpl.java

示例7: editB_actionPerformed

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
void editB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("Edit resource type"));
    Dimension dlgSize = new Dimension(420, 450);
    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);
    MimeType mt = (MimeType) typesList.getSelectedValue();
    String[] exts = mt.getExtensions();
    String extss = "";
    for (int i = 0; i < exts.length; i++)
        extss += exts[i] + " ";
    dlg.extField.setText(extss);
    dlg.descField.setText(mt.getLabel());
    dlg.iconLabel.setIcon(mt.getIcon());
    AppList appList = MimeTypesList.getAppList();
    dlg.appPanel.applicationField.setText(
        appList.getFindPath(mt.getAppId()) + "/" + appList.getExec(mt.getAppId()));
    dlg.appPanel.argumentsField.setText(appList.getCommandLinePattern(mt.getAppId()));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = mt.getMimeTypeId();
    MimeTypesList.removeMimeType(typeId);
    mt = MimeTypesList.addMimeType(typeId);
    exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);

}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:47,代码来源:ResourceTypePanel.java

示例8: Builder

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public Builder() {
 // Set some default values
    id = Util.generateId();
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:5,代码来源:Event.java

示例9: checkApp

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
/**
 * Find the application needed to run the file type.
 * @param mt
 * @return
 */
boolean checkApp(MimeType mt) {
    String appId = mt.getAppId();
    AppList appList = MimeTypesList.getAppList();
    File d;
    if (appId == null) {
        appId = Util.generateId();
        d = new File("/");
    }
    else {
        File exe = new File(appList.getFindPath(appId) + "/" + appList.getExec(appId));
        if (exe.isFile())
            return true;
        d = new File(exe.getParent());
        while (!d.exists())
            d = new File(d.getParent());
    }
    SetAppDialog dlg =
        new SetAppDialog(
            App.getFrame(),
            Local.getString(Local.getString("Select the application to open files of type")+" '" + mt.getLabel() + "'"));
    Dimension dlgSize = new Dimension(420, 300);
    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.setDirectory(d);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return false;
    File f = new File(dlg.appPanel.applicationField.getText());

    appList.addOrReplaceApp(
        appId,
        f.getParent().replace('\\', '/'),
        f.getName().replace('\\', '/'),
        dlg.appPanel.argumentsField.getText());
    mt.setApp(appId);
    /*appList.setFindPath(appId, chooser.getSelectedFile().getParent().replace('\\','/'));
    appList.setExec(appId, chooser.getSelectedFile().getName().replace('\\','/'));*/
    CurrentStorage.get().storeMimeTypesList();
    return true;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:49,代码来源:ResourcesPanel.java

示例10: editB_actionPerformed

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
/**
 * Edit a resource type.
 * @param e
 */
void editB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("Edit resource type"));
    Dimension dlgSize = new Dimension(420, 450);
    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);
    MimeType mt = (MimeType) typesList.getSelectedValue();
    String[] exts = mt.getExtensions();
    String extss = "";
    for (int i = 0; i < exts.length; i++)
        extss += exts[i] + " ";
    dlg.extField.setText(extss);
    dlg.descField.setText(mt.getLabel());
    dlg.iconLabel.setIcon(mt.getIcon());
    AppList appList = MimeTypesList.getAppList();
    dlg.appPanel.applicationField.setText(
        appList.getFindPath(mt.getAppId()) + "/" + appList.getExec(mt.getAppId()));
    dlg.appPanel.argumentsField.setText(appList.getCommandLinePattern(mt.getAppId()));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = mt.getMimeTypeId();
    MimeTypesList.removeMimeType(typeId);
    mt = MimeTypesList.addMimeType(typeId);
    exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);

}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:51,代码来源:ResourceTypePanel.java

示例11: createTimeLog

import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
@Override
public TimeLog createTimeLog(CalendarDate startDate, String parentTimeLogID, String timeLogTaskName, 
		int startHour, int startMin, int startPeriod, int endHour, int endMin, int endPeriod,
		int interruptTime, int deltaTime, String description) {
      
	Element el = new Element("timelog");
       el.addAttribute(new Attribute("startDate", startDate.toString()));
       
	String id = Util.generateId();
       el.addAttribute(new Attribute("id", id));
       
       el.addAttribute(new Attribute("startHour", String.valueOf(startHour)));
       el.addAttribute(new Attribute("startMin", String.valueOf(startMin)));
       el.addAttribute(new Attribute("startPeriod", String.valueOf(startPeriod)));
       
       el.addAttribute(new Attribute("endHour", String.valueOf(endHour)));
       el.addAttribute(new Attribute("endMin", String.valueOf(endMin)));
       el.addAttribute(new Attribute("endPeriod",  String.valueOf(endPeriod)));
       
       
       el.addAttribute(new Attribute("interruptTime", String.valueOf(interruptTime)));
       el.addAttribute(new Attribute("deltaTime", String.valueOf(deltaTime)));
       
               
       Element txt = new Element("timeLogTaskName");
       txt.appendChild(timeLogTaskName);
       el.appendChild(txt);

       Element desc = new Element("description");
       desc.appendChild(description);
       el.appendChild(desc);
       
       if (parentTimeLogID == null) {
           _root.appendChild(el);
       }
       else {
           Element parent = getTimeLogElement(parentTimeLogID);
           parent.appendChild(el);
       }
       
	
       Util.debug("Created timelog with parent " + parentTimeLogID);
	elements.put(id, el);
	
       
       return new TimeLogImpl(el, this);
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:48,代码来源:TimeLogListImpl.java


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