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


Java MacroGroup类代码示例

本文整理汇总了Java中org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup的典型用法代码示例。如果您正苦于以下问题:Java MacroGroup类的具体用法?Java MacroGroup怎么用?Java MacroGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MacroGroup类属于org.jivesoftware.smackx.workgroup.ext.macros包,在下文中一共展示了MacroGroup类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMacros

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
/**
 * Asks the workgroup for it's Global Macros.
 *
 * @param global true to retrieve global macros, otherwise false for personal macros.
 * @return MacroGroup the root macro group.
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public MacroGroup getMacros(boolean global) throws XMPPException {
    Macros request = new Macros();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setPersonal(!global);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    Macros response = (Macros)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getRootGroup();
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:30,代码来源:AgentSession.java

示例2: saveMacros

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
/**
 * Persists the Personal Macro for an agent.
 *
 * @param group the macro group to save. 
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public void saveMacros(MacroGroup group) throws XMPPException {
    Macros request = new Macros();
    request.setType(IQ.Type.SET);
    request.setTo(workgroupJID);
    request.setPersonal(true);
    request.setPersonalMacroGroup(group);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server on status set.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:29,代码来源:AgentSession.java

示例3: getMacros

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
/**
 * Asks the workgroup for it's Global Macros.
 * 
 * @param global
 *            true to retrieve global macros, otherwise false for personal
 *            macros.
 * @return MacroGroup the root macro group.
 * @throws XMPPException
 *             if an error occurs while getting information from the server.
 */
public MacroGroup getMacros(boolean global) throws XMPPException {
	Macros request = new Macros();
	request.setType(IQ.Type.GET);
	request.setTo(workgroupJID);
	request.setPersonal(!global);

	PacketCollector collector = connection
			.createPacketCollector(new PacketIDFilter(request.getPacketID()));
	connection.sendPacket(request);

	Macros response = (Macros) collector.nextResult(SmackConfiguration
			.getPacketReplyTimeout());

	// Cancel the collector.
	collector.cancel();
	if (response == null) {
		throw new XMPPException("No response from server.");
	}
	if (response.getError() != null) {
		throw new XMPPException(response.getError());
	}
	return response.getRootGroup();
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:34,代码来源:AgentSession.java

示例4: saveMacros

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
/**
 * Persists the Personal Macro for an agent.
 * 
 * @param group
 *            the macro group to save.
 * @throws XMPPException
 *             if an error occurs while getting information from the server.
 */
public void saveMacros(MacroGroup group) throws XMPPException {
	Macros request = new Macros();
	request.setType(IQ.Type.SET);
	request.setTo(workgroupJID);
	request.setPersonal(true);
	request.setPersonalMacroGroup(group);

	PacketCollector collector = connection
			.createPacketCollector(new PacketIDFilter(request.getPacketID()));
	connection.sendPacket(request);

	IQ response = (IQ) collector.nextResult(SmackConfiguration
			.getPacketReplyTimeout());

	// Cancel the collector.
	collector.cancel();
	if (response == null) {
		throw new XMPPException("No response from server on status set.");
	}
	if (response.getError() != null) {
		throw new XMPPException(response.getError());
	}
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:32,代码来源:AgentSession.java

示例5: getMacros

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
/**
 * Asks the workgroup for it's Global Macros.
 *
 * @param global true to retrieve global macros, otherwise false for personal macros.
 * @return MacroGroup the root macro group.
 * @throws XMPPErrorException if an error occurs while getting information from the server.
 * @throws NoResponseException 
 * @throws NotConnectedException 
 */
public MacroGroup getMacros(boolean global) throws NoResponseException, XMPPErrorException, NotConnectedException {
    Macros request = new Macros();
    request.setType(IQ.Type.get);
    request.setTo(workgroupJID);
    request.setPersonal(!global);

    Macros response = (Macros) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
    return response.getRootGroup();
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:19,代码来源:AgentSession.java

示例6: saveMacros

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
/**
 * Persists the Personal Macro for an agent.
 *
 * @param group the macro group to save. 
 * @throws XMPPErrorException 
 * @throws NoResponseException 
 * @throws NotConnectedException 
 */
public void saveMacros(MacroGroup group) throws NoResponseException, XMPPErrorException, NotConnectedException {
    Macros request = new Macros();
    request.setType(IQ.Type.set);
    request.setTo(workgroupJID);
    request.setPersonal(true);
    request.setPersonalMacroGroup(group);

    connection.createPacketCollectorAndSend(request).nextResultOrThrow();
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:18,代码来源:AgentSession.java

示例7: addSubMenus

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
private void addSubMenus(JMenu menu, List<MacroGroup> macroGroups) {
    Iterator<MacroGroup> subFolders = macroGroups.iterator();
    while (subFolders.hasNext()) {
        MacroGroup folder = subFolders.next();
        JMenu subMenu = new JMenu(folder.getTitle());
        menu.add(subMenu);

        addMenuItems(subMenu, folder.getMacros());


        addSubMenus(subMenu, folder.getMacroGroups());

    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:ChatMacroMenu.java

示例8: save

import org.jivesoftware.smackx.workgroup.ext.macros.MacroGroup; //导入依赖的package包/类
private void save() {
    // Save Personal Macros

    MacroGroup macroGroup = new MacroGroup();
    int count = table.getRowCount();
    for (int i = 0; i < count; i++) {
        Macro macro = new Macro();
        String title = (String)table.getValueAt(i, 0);
        String value = (String)table.getValueAt(i, 1);
        macro.setTitle(title);
        macro.setResponse(value);
        macroGroup.addMacro(macro);
    }

    macroGroup.setTitle(FpRes.getString("title.personal"));

    try {
        FastpathPlugin.getAgentSession().saveMacros(macroGroup);
    }
    catch (Exception ex) {
        JOptionPane.showMessageDialog(dialog, FpRes.getString("message.macros.not.saved"), FpRes.getString("title.error"), JOptionPane.ERROR_MESSAGE);
    }

    String initialResponse = initialResponseField.getText();
    Properties props = FastpathPlugin.getLitWorkspace().getWorkgroupProperties();
    if (ModelUtil.hasLength(initialResponse)) {
        props.setProperty(Workpane.INITIAL_RESPONSE_PROPERTY, initialResponse);
        FastpathPlugin.getLitWorkspace().saveProperties(props);
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:31,代码来源:MacrosEditor.java


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