• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AuthorAccess类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AuthorAccess类属于ro.sync.ecss.extensions.api包,在下文中一共展示了AuthorAccess类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: customizePopUpMenu

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void customizePopUpMenu(Object popUp, AuthorAccess authorAccess) {
    String editorURLString = PluginWorkspaceProvider.getPluginWorkspace().
            getCurrentEditorAccess(StandalonePluginWorkspace.MAIN_EDITING_AREA).getEditorLocation().toString();
    final String selectedText = authorAccess.getEditorAccess().getSelectedText();
    if ((selectedText != null) && (!selectedText.equals(""))) {
        JMenuItem editorSelectionMenu = createSnippetEditorPopUpAddition();
        ((JPopupMenu) popUp).add(editorSelectionMenu, 0);
    }
    if (editorURLString.toLowerCase().startsWith("argon")) {
        if (authorAccess.getEditorAccess().isEditable()) {
            JMenuItem checkInMenuItem = createCheckInEditorPopUpAddition();
            ((JPopupMenu) popUp).add(checkInMenuItem, 0);
        } else {
            JMenuItem checkOutMenuItem = createCheckOutEditorPopUpAddition();
            ((JPopupMenu) popUp).add(checkOutMenuItem, 0);
        }
    }
}
 
开发者ID:axxepta,项目名称:project-argon,代码行数:20,代码来源:ArgonEditorChangeListener.java


示例2: doOperation

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args) throws IllegalArgumentException, AuthorOperationException {
	try {
		final int 			caretOffset = authorAccess.getEditorAccess().getCaretOffset();
		final AuthorNode	nodeAtCaret = authorAccess.getDocumentController().getNodeAtOffset(caretOffset);
		//logger.info("nodeAtCaret: " + nodeAtCaret.getDisplayName());
		
		XsltConref	xsltConref 	= XsltConrefResolver.getInstance().xsltConrefFromNode(nodeAtCaret, authorAccess);
		if (xsltConref == null) {
			// check if the parent node is an XSLT-Conref
			xsltConref 	= XsltConrefResolver.getInstance().xsltConrefFromNode(nodeAtCaret.getParent(), authorAccess);
			//logger.info("nodeAtCaret.getParent(): " + nodeAtCaret.getParent().getDisplayName());
		}
		if (xsltConref != null) {
			final String 	filetype 	= (String)args.getArgumentValue(ARG_FILETYPE);
			//logger.info("filetype: " + filetype);
			final URL 		url 		= ((filetype != null) && (filetype.equalsIgnoreCase(FILETYPE_SOURCE))) ? xsltConref.getXmlSourceUrl() : xsltConref.getScriptUrl();
			PluginWorkspaceProvider.getPluginWorkspace().open(url, EditorPageConstants.PAGE_TEXT);
		}
	} catch (Exception e) {
		logger.error(e, e);
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:24,代码来源:OpenXsltConrefFile.java


示例3: resolve

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
private static boolean resolve(Styles styles, AuthorNode contextNode, String attrName, boolean replaceFirst) {
	boolean handled = false;
	final StaticContent[] mixedContent = styles.getMixedContent();
	if ((mixedContent != null) && (mixedContent.length > 0)) {
		final AuthorAccess authorAccess = getAuthorAccess();
		if (authorAccess != null) {
			final AuthorNodeWrapper context 	= new AuthorNodeWrapper(contextNode, authorAccess);
			final String			attrValue	= context.getAttribute(attrName, NAMESPACE_URI);
			if (attrValue != null) {
				String resolved;
				try {
					resolved = EmbeddedXPathResolver.resolve(attrValue, context);
				} catch (XPathException e) {
					final String errMsg = e.getMessage().replaceFirst(ERR_MSG_REMOVE_REGEXP, "");
					resolved = ERR_PREFIX + errMsg + ERR_SUFFIX;
					styles.setProperty(Styles.KEY_FONT_WEIGHT, Styles.FONT_WEIGHT_BOLD);
					styles.setProperty(Styles.KEY_FOREGROUND_COLOR, Color.COLOR_RED);
				}
				styles.getMixedContent()[replaceFirst ? 0 : styles.getMixedContent().length-1] = new StringContent(resolved);
			}
		}
		handled = true;
	}
	return handled;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:26,代码来源:ConbatStylesFilter.java


示例4: doOperation

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap argumentsMap) {
	try {
		final int 						caretOffset 		= authorAccess.getEditorAccess().getCaretOffset();
		final AuthorDocumentController 	documentController 	= authorAccess.getDocumentController();
		final AuthorNode				nodeAtCaret 		= documentController.getNodeAtOffset(caretOffset);
		final AuthorNodeWrapper			authorNode			= new AuthorNodeWrapper(nodeAtCaret, authorAccess);

		KeyDef keyDef = KeyDef.fromNode(authorNode);
		KeyDefInformationDialog keyInformationDialog = new KeyDefInformationDialog((Frame)authorAccess.getWorkspaceAccess().getParentFrame(), keyDef);

		keyInformationDialog.setLocationRelativeTo((Component)authorAccess.getWorkspaceAccess().getParentFrame());

		keyInformationDialog.showDialog();
		
	} catch (Exception e) {
		logger.error(e, e);
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:20,代码来源:ShowKeyDefInformation.java


示例5: replacePageSelectionWith

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
/**
 * Performs a replace operation in the author page.
 * 
 * @param fragment
 *            the fragment to insert
 */
private void replacePageSelectionWith(String fragment) {
    AuthorAccess authorAccess = editorPage.getAuthorAccess();
    AuthorDocumentController controller = authorAccess
            .getDocumentController();
    controller.beginCompoundEdit();
    boolean deleteSelection = false;
    try {
        if (authorAccess.getEditorAccess().hasSelection()) {
            deleteSelection = true;
            authorAccess.getEditorAccess().deleteSelection();
        }
        CommonsOperationsUtil.surroundWithFragment(authorAccess, false,
                fragment);
    } catch (AuthorOperationException e) {
        if (deleteSelection) {
            controller.cancelCompoundEdit();
        }
        LOGGER.warn("Error: replacePageSelectionWith()", e);
    } finally {
        controller.endCompoundEdit();
    }
}
 
开发者ID:aerhard,项目名称:dbTagger,代码行数:29,代码来源:AuthorPageAccess.java


示例6: actionPerformed

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    String selection = "";
    WSEditor editorAccess = workspace.getCurrentEditorAccess(PluginWorkspace.MAIN_EDITING_AREA);
    if (editorAccess.getCurrentPageID().equals(EditorPageConstants.PAGE_AUTHOR)) {
        WSEditorPage editorPage = editorAccess.getCurrentPage();
        AuthorAccess authorAccess = ((WSAuthorEditorPage) editorPage).getAuthorAccess();
        //selection = authorAccess.getEditorAccess().getSelectedText();
        WSAuthorEditorPageBase baseAccess = authorAccess.getEditorAccess();
        int[] nodeSelection = baseAccess.
                getBalancedSelection(baseAccess.getBalancedSelectionStart(), baseAccess.getBalancedSelectionEnd());
        AuthorParentNode selectedNode = (AuthorParentNode) baseAccess.
                getFullySelectedNode(nodeSelection[0], nodeSelection[1]);
        try {
            selection = getAuthorText(((WSAuthorEditorPage) editorPage).getDocumentController(), selectedNode, 0);
        } catch (BadLocationException ble) {
            logger.error("Error while parsing XML from AuthorPage selection: ", ble.getMessage());
        }
    } else if (editorAccess.getCurrentPageID().equals(EditorPageConstants.PAGE_TEXT)) {
        WSTextEditorPage textPage = (WSTextEditorPage)editorAccess.getCurrentPage();
        selection = textPage.getSelectedText();
    } else return;

    String[] buttons = {Lang.get(Lang.Keys.cm_tofile), Lang.get(Lang.Keys.cm_todb), Lang.get(Lang.Keys.cm_cancel)};
    int[] responseIDs = { 0, 1, -1};
    int saveTo = workspace.showConfirmDialog(Lang.get(Lang.Keys.dlg_snippet), Lang.get(Lang.Keys.lbl_snippet), buttons, responseIDs, 0);
    if (saveTo == -1)
        return;
    if (saveTo == 0)
        saveToFile(selection);
    else
        saveToArgon(selection);
}
 
开发者ID:axxepta,项目名称:project-argon,代码行数:34,代码来源:StoreSnippetSelectionAction.java


示例7: doOperation

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap argumentsMap) throws IllegalArgumentException, AuthorOperationException {

	final AuthorEditorAccess 	editorAccess 	= authorAccess.getEditorAccess();
	final boolean 				isModified 		= editorAccess.isModified();
	
	try {
		final int 			caretOffset = authorAccess.getEditorAccess().getCaretOffset();
		final AuthorNode	nodeAtCaret = authorAccess.getDocumentController().getNodeAtOffset(caretOffset);
		
		AuthorNode 	xsltConrefNode 	= nodeAtCaret;
		XsltConref	xsltConref 	= XsltConrefResolver.getInstance().xsltConrefFromNode(xsltConrefNode, authorAccess);
		if (xsltConref == null) {
			// check if the parent node is an XSLT-Conref
			xsltConrefNode 	= nodeAtCaret.getParent();
			xsltConref 		= XsltConrefResolver.getInstance().xsltConrefFromNode(xsltConrefNode, authorAccess);
		}

		if (xsltConref != null) {
			// ensure the script will be recompiled.
			XsltConrefResolver.getInstance().getTransformerCache().removeFromCache(xsltConref.getScriptUrl());

			// ensure the schema will be reloaded.
			XsltConrefResolver.getInstance().getTransformerCache().getConfiguration().clearSchemaCache();
		}
		authorAccess.getDocumentController().refreshNodeReferences(xsltConrefNode);
		
	} catch (Exception e) {
		logger.error(e, e);
	}

	if (!isModified) {
		editorAccess.setModified(false);
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:36,代码来源:RefreshXsltConref.java


示例8: resolveReference

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
public static String resolveReference(AuthorNode authorNode, AuthorAccess authorAccess) {
	String resolved = null;
	final AuthorNodeWrapper node 		= new AuthorNodeWrapper(authorNode, authorAccess);
	final String			attrClass	= node.getAttribute(DitaUtil.ATTR_CLASS, null);
	final String			attrHref	= node.getAttribute(DitaUtil.ATTR_HREF, null);
	if ((attrHref != null) && (!attrHref.isEmpty()) && (attrClass.contains(DitaUtil.CLASS_XREF)) && (attrHref.contains(DitaUtil.HREF_URL_ID_DELIMITER))) {
		final int 		hrefSplitPos 	= attrHref.indexOf(DitaUtil.HREF_URL_ID_DELIMITER);
		final String 	hrefUrl 		= attrHref.substring(0, hrefSplitPos);
		final String 	hrefId 			= attrHref.substring(hrefSplitPos + 1);
		//logger.info("hrefUrl: " + hrefUrl + ", hrefId: " + hrefId);
		
		URL refUrl;
		if (hrefUrl.isEmpty()) {
			refUrl = node.getBaseUrl();
		} else {
			try {
				refUrl = new URL(node.getBaseUrl(), hrefUrl);
			} catch (MalformedURLException e) {
				logger.error(e, e);
				refUrl = null;
			}
		}
		
		//logger.info("refUrl: " + refUrl);
		if (refUrl != null) {
			final BookCache	bookCache 	= BookCacheHandler.getInstance().getBookCache(node.getBaseUrl());
			final FileCache	fileCache	= bookCache.getFile(refUrl);
			if (fileCache != null) {
				resolved = fileCache.getLinkText(hrefId, node);
			}
		}
	}
	return resolved;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:35,代码来源:XRefLinkTextResolver.java


示例9: getAuthorAccess

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
private static AuthorAccess getAuthorAccess() {
	WSEditor editorAccess = PluginWorkspaceProvider.getPluginWorkspace().getCurrentEditorAccess(PluginWorkspace.MAIN_EDITING_AREA);
    if (editorAccess != null) {
      WSEditorPage currentPage = editorAccess.getCurrentPage();
      if (currentPage instanceof WSAuthorEditorPage) {
        return ((WSAuthorEditorPage)currentPage).getAuthorAccess();
      }
    }
	return null;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:11,代码来源:ConbatStylesFilter.java


示例10: resolveContent

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
public static String resolveContent(AuthorNode node, AuthorAccess authorAccess) {

		KeyRef keyRef = KeyRef.fromNode(new AuthorNodeWrapper(node, authorAccess));
		if (keyRef != null) {
			final BookCache cache = BookCacheHandler.getInstance().getBookCache(node.getXMLBaseURL());
			return keyRef.getDisplaySuffix(cache, true).toString();
		} else {
			return null;
		}
	}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:11,代码来源:AdvancedKeyRefContentResolver.java


示例11: getReferenceSystemID

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public String getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess) {
	String systemID = null;
	if (XsltConref.isXsltConref(new AuthorNodeWrapper(node, null))) {
		systemID = node.getXMLBaseURL().toExternalForm();
	} else {
		systemID = super.getReferenceSystemID(node, authorAccess);
	}
	//logger.info("getReferenceSystemID: " + systemID);
	return systemID;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:12,代码来源:DitaSemiaReferenceResolver.java


示例12: resolveReference

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public SAXSource resolveReference(AuthorNode node, String systemID, AuthorAccess authorAccess, EntityResolver entityResolver) throws ReferenceResolverException {
	final XsltConref 	xsltConref 	= XsltConrefResolver.getInstance().xsltConrefFromNode(node, authorAccess);
	SAXSource 			saxSource 	= null;
	if (xsltConref != null) {
		saxSource = XsltConrefResolver.getInstance().resolveXsltConref(xsltConref, authorAccess);
	} else {
		saxSource = super.resolveReference(node, systemID, authorAccess, entityResolver);
	}
	return saxSource;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:12,代码来源:DitaSemiaReferenceResolver.java


示例13: getReferenceSystemID

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public String getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess) 
{
	String systemID = null;
	if (XsltConref.isXsltConref(new AuthorNodeWrapper(node, null))) {
		systemID = node.getXMLBaseURL().toExternalForm();
	} else {
		systemID = super.getReferenceSystemID(node, authorAccess);
	}
	//logger.info("getReferenceSystemID: " + systemID);
	return systemID;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:13,代码来源:DitaSemiaMapReferenceResolver.java


示例14: resolveReference

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
public SAXSource resolveReference(AuthorNode node, String systemID, AuthorAccess authorAccess, EntityResolver entityResolver) 
{
	final XsltConref	xsltConref 	= XsltConrefResolver.getInstance().xsltConrefFromNode(node, authorAccess);
	SAXSource 			saxSource 	= null;
	if (xsltConref != null) {
		saxSource = XsltConrefResolver.getInstance().resolveXsltConref(xsltConref, authorAccess);
	} else { 
		saxSource = super.resolveReference(node, systemID, authorAccess, entityResolver);
	}
	//logger.info("saxSource: " + saxSource);
	return saxSource;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:13,代码来源:DitaSemiaMapReferenceResolver.java


示例15: customizePopUpMenu

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void customizePopUpMenu(Object popUp, AuthorAccess authorAccess) {
  Highlight[] highlights = authorAccess.getEditorAccess().getHighlighter().getHighlights();
  int caretOffset = authorAccess.getEditorAccess().getCaretOffset();
  for (Highlight highlight : highlights) {
    if (caretOffset >= highlight.getStartOffset() && caretOffset <= highlight.getEndOffset()) {
      RuleMatch match = (RuleMatch) highlight.getAdditionalData();
      replaceMenuItems((JPopupMenu) popUp, match, new AuthorModeApplyReplacementAction(match, authorAccess));
      break;
    }
  }
}
 
开发者ID:danielnaber,项目名称:oxygen-languagetool-plugin,代码行数:13,代码来源:LanguageToolPluginExtension.java


示例16: surroundPageSelectionWith

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
/**
 * Performs a surround operation in the author page.
 * 
 * @param fragment
 *            the fragment to insert
 */
private void surroundPageSelectionWith(String fragment) {
    AuthorAccess authorAccess = editorPage.getAuthorAccess();
    try {
        CommonsOperationsUtil.surroundWithFragment(authorAccess, false,
                fragment);
    } catch (AuthorOperationException e) {
        LOGGER.warn("Error: surroundPageSelectionWith()", e);
    }
}
 
开发者ID:aerhard,项目名称:dbTagger,代码行数:16,代码来源:AuthorPageAccess.java


示例17: xsltConrefFromNode

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
public XsltConref xsltConrefFromNode(AuthorNode node, AuthorAccess authorAccess) {
	final XsltConref xsltConref = XsltConref.fromNode(new AuthorNodeWrapper(node, authorAccess), xsltConrefCache);
	return xsltConref;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:5,代码来源:XsltConrefResolver.java


示例18: activated

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void activated(AuthorAccess authorAccess) {
	this.authorAccess = authorAccess;
	super.activated(authorAccess);
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:6,代码来源:DitaSemiaLinkTextResolver.java


示例19: doOperation

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap argumentsMap) {
	try {
		final int 						caretOffset 		= authorAccess.getEditorAccess().getCaretOffset();
		final AuthorDocumentController 	documentController 	= authorAccess.getDocumentController();
		final AuthorNode				nodeAtCaret 		= documentController.getNodeAtOffset(caretOffset);
		final KeyDefListInterface 		keyDefList 			= BookCacheHandler.getInstance().getBookCache(nodeAtCaret.getXMLBaseURL());
		final KeyRef 					keyRef 				= KeyRef.fromNode(new AuthorNodeWrapper(nodeAtCaret, authorAccess));
		// contextKeyDef?
		// ancestorKeyDef, keyrefFactory für keyPrioritizer?
		final KeyPrioritizer			keyPrioritizer		= new KeyPrioritizer(keyDefList, keyRef, null, null);
		final OxyAdvancedKeyrefDialog 	editKeyRefDialog 	= new OxyAdvancedKeyrefDialog((Frame)authorAccess.getWorkspaceAccess().getParentFrame(), keyDefList, keyRef, null, keyPrioritizer);

		editKeyRefDialog.setLocationRelativeTo((Component)authorAccess.getWorkspaceAccess().getParentFrame());

		KeyDefInterface keyDef;
		
		if (editKeyRefDialog.showDialog()) {
			keyDef = editKeyRefDialog.getSelectedKeyDef();
		} else {
			keyDef = null;
		}

		if (keyDef != null) {
			String keyValue = editKeyRefDialog.getKeyText();
			
			documentController.beginCompoundEdit();
			
			AuthorElement keyRefElement = (AuthorElement)nodeAtCaret;
			if (keyRefElement.getEndOffset() > keyRefElement.getStartOffset() + 1) {
				//logger.info("L�sche bestehenden Inhalt.");
				documentController.delete(keyRefElement.getStartOffset() + 1, keyRefElement.getEndOffset() - 1);
			}
			//logger.info("Setze Key = " + keyValue);
			documentController.insertText(keyRefElement.getStartOffset() + 1, keyValue);
			final NamespaceContext namespaceContext = nodeAtCaret.getNamespaceContext();
			String namespacePrefix	= namespaceContext.getPrefixForNamespace(KeyRef.NAMESPACE_URI);
			if (namespacePrefix == null) {
				namespacePrefix = KeyRef.NAMESPACE_PREFIX;
				documentController.setAttribute(
						"xmlns:" + KeyRef.NAMESPACE_PREFIX, 
						new AttrValue(KeyRef.NAMESPACE_URI), 
						documentController.getAuthorDocumentNode().getRootElement());
			}
	        documentController.setAttribute(namespacePrefix + ":" + KeyRef.ATTR_REF, new AttrValue(keyDef.getRefString()), keyRefElement);
	        
	        if (!keyRef.isOutputclassFixed()) {
	        	documentController.setAttribute(KeyRef.ATTR_OUTPUTCLASS, new AttrValue(editKeyRefDialog.getOutputclass()), keyRefElement);
	        }
			
			documentController.endCompoundEdit();
			
			authorAccess.getEditorAccess().refresh(nodeAtCaret);
		}
	} catch (Exception e) {
		logger.error(e, e);
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:59,代码来源:EditKeyRef.java


示例20: doOperation

import ro.sync.ecss.extensions.api.AuthorAccess; //导入依赖的package包/类
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap argumentsMap) {
	try {
	
		final AuthorDocumentController 	documentController 	= authorAccess.getDocumentController();
		final AuthorNode				rootNode			= documentController.getNodeAtOffset(0);

		final Frame parentFrame = (Frame)authorAccess.getWorkspaceAccess().getParentFrame();

	    final JDialog dialog = new JDialog(parentFrame, "Refreshing Book Cache...", true);
	    JPanel barPanel = new JPanel();
	    JProgressBar progressBar = new JProgressBar(0, 1);
	    dialog.getContentPane().setLayout(new BoxLayout(dialog.getContentPane(), BoxLayout.PAGE_AXIS));
	    barPanel.setLayout(new BoxLayout(barPanel, BoxLayout.LINE_AXIS));
	    
	    barPanel.add(Box.createRigidArea(new Dimension(5, 0)));
	    barPanel.add(progressBar);
	    progressBar.setMaximumSize(new Dimension(272, 27));
	    barPanel.add(Box.createRigidArea(new Dimension(5, 0)));
	    
	    dialog.add(Box.createRigidArea(new Dimension(0, 5)));
	    dialog.add(barPanel);
	    dialog.add(Box.createRigidArea(new Dimension(0, 5)));
	    
	    dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
	    dialog.setSize(300, 75);
	    dialog.setLocationRelativeTo(parentFrame);
	    
	    final ProgressListener progressListener = new ProgressListener() {
			@Override
			public void setProgress(int progress, int total) {
				if (progressBar.getMaximum() != total) {
					progressBar.setMaximum(total);
				}
				progressBar.setValue(progress);
			}
	    };

	    Thread workerThread = new Thread(new Runnable() {
	    	@Override
	    	public void run() {
	    		BookCacheHandler.getInstance().refreshBookCache(rootNode.getXMLBaseURL(), progressListener);
	    		dialog.setVisible(false);
	    	}
	    });

	    workerThread.start();
	    dialog.setVisible(true);

	} catch (Exception e) {
		logger.error(e, e);
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:54,代码来源:RefreshBookCache.java



注:本文中的ro.sync.ecss.extensions.api.AuthorAccess类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TextFieldNavigationHandler类代码示例发布时间:2022-05-22
下一篇:
Java FilterContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap