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


Java IllegalArgumentException类代码示例

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


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

示例1: loadDocument

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private XComponent loadDocument(OfficeContext context, File inputFile) throws OfficeException {
	if (!inputFile.exists()) {
		throw new OfficeException("input document not found");
	}
	XComponentLoader loader = cast(XComponentLoader.class, context.getService(SERVICE_DESKTOP));
	Map<String, ?> loadProperties = getLoadProperties(inputFile);
	XComponent document = null;
	try {
		document = loader.loadComponentFromURL(toUrl(inputFile), "_blank", 0, toUnoProperties(loadProperties));
	} catch (IllegalArgumentException illegalArgumentException) {
		throw new OfficeException("could not load document: " + inputFile.getName(), illegalArgumentException);
	} catch (ErrorCodeIOException errorCodeIOException) {
		throw new OfficeException("could not load document: " + inputFile.getName() + "; errorCode: "
				+ errorCodeIOException.ErrCode, errorCodeIOException);
	} catch (IOException ioException) {
		throw new OfficeException("could not load document: " + inputFile.getName(), ioException);
	}
	if (document == null) {
		throw new OfficeException("could not load document: " + inputFile.getName());
	}
	XRefreshable refreshable = cast(XRefreshable.class, document);
	if (refreshable != null) {
		refreshable.refresh();
	}
	return document;
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:27,代码来源:AbstractConversionTask.java

示例2: loadDocument

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private XComponent loadDocument(OfficeContext context, File inputFile) throws OfficeException {
    if (!inputFile.exists()) {
        throw new OfficeException("input document not found");
    }
    XComponentLoader loader = cast(XComponentLoader.class, context.getService(SERVICE_DESKTOP));
    Map<String,?> loadProperties = getLoadProperties(inputFile);
    XComponent document = null;
    try {
        document = loader.loadComponentFromURL(toUrl(inputFile), "_blank", 0, toUnoProperties(loadProperties));
    } catch (IllegalArgumentException illegalArgumentException) {
        throw new OfficeException("could not load document: " + inputFile.getName(), illegalArgumentException);
    } catch (ErrorCodeIOException errorCodeIOException) {
        throw new OfficeException("could not load document: "  + inputFile.getName() + "; errorCode: " + errorCodeIOException.ErrCode, errorCodeIOException);
    } catch (IOException ioException) {
        throw new OfficeException("could not load document: "  + inputFile.getName(), ioException);
    }
    if (document == null) {
        throw new OfficeException("could not load document: "  + inputFile.getName());
    }
    return document;
}
 
开发者ID:qjx378,项目名称:wenku,代码行数:22,代码来源:AbstractConversionTask.java

示例3: setPropertyValue

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
@Override
public void setPropertyValue(String key, Object val)
    throws UnknownPropertyException, PropertyVetoException,
    IllegalArgumentException, WrappedTargetException
{
  if (STAGE.equalsIgnoreCase(key))
  {
    if (val != null)
    {
      stage = val.toString();
      master.setStage(stage);
    }
  }
  else
    master.setPropertyValue(key, val);
}
 
开发者ID:WollMux,项目名称:WollMux,代码行数:17,代码来源:PrintModels.java

示例4: createUIElement

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
@Override
public XUIElement createUIElement(String resourceUrl, PropertyValue[] arguments)
    throws NoSuchElementException, IllegalArgumentException
{
  Logger.debug("WollMuxSidebarFactory:createUIElement");

  if (!resourceUrl.startsWith("private:resource/toolpanel/WollMuxSidebarFactory/WollMuxSidebarPanel"))
  {
    throw new NoSuchElementException(resourceUrl, this);
  }

  XWindow parentWindow = null;
  for (int i = 0; i < arguments.length; i++)
  {
    if (arguments[i].Name.equals("ParentWindow"))
    {
      parentWindow =
        UnoRuntime.queryInterface(XWindow.class, arguments[i].Value);
      break;
    }
  }

  return new WollMuxSidebarPanel(context, parentWindow, resourceUrl);
}
 
开发者ID:WollMux,项目名称:WollMux,代码行数:25,代码来源:WollMuxSidebarFactory.java

示例5: insertTextAtCurrentLocation

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
public static void insertTextAtCurrentLocation(XText text, XTextCursor cursor, String string, String parStyle)
        throws WrappedTargetException, PropertyVetoException, UnknownPropertyException,
        UndefinedParagraphFormatException {
    text.insertString(cursor, string, true);
    XParagraphCursor parCursor = UnoRuntime.queryInterface(
            XParagraphCursor.class, cursor);
    // Access the property set of the cursor, and set the currently selected text
    // (which is the string we just inserted) to be bold
    XPropertySet props = UnoRuntime.queryInterface(
            XPropertySet.class, parCursor);
    try {
        props.setPropertyValue(PARA_STYLE_NAME, parStyle);
    } catch (IllegalArgumentException ex) {
        throw new UndefinedParagraphFormatException(parStyle);
    }
    cursor.collapseToEnd();

}
 
开发者ID:JabRef,项目名称:jabref,代码行数:19,代码来源:OOUtil.java

示例6: rebuildBibTextSection

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
public void rebuildBibTextSection(List<BibDatabase> databases, OOBibStyle style)
        throws NoSuchElementException, WrappedTargetException, IllegalArgumentException,
        CreationException, PropertyVetoException, UnknownPropertyException, UndefinedParagraphFormatException {
    List<String> cited = findCitedKeys();
    Map<String, BibDatabase> linkSourceBase = new HashMap<>();
    Map<BibEntry, BibDatabase> entries = findCitedEntries(databases, cited, linkSourceBase); // Although entries are redefined without use, this also updates linkSourceBase

    List<String> names = sortedReferenceMarks;

    if (style.isSortByPosition()) {
        // We need to sort the entries according to their order of appearance:
        entries = getSortedEntriesFromSortedRefMarks(names, linkSourceBase);
    } else {
        SortedMap<BibEntry, BibDatabase> newMap = new TreeMap<>(entryComparator);
        for (Map.Entry<BibEntry, BibDatabase> bibtexEntryBibtexDatabaseEntry : findCitedEntries(databases, cited,
                linkSourceBase).entrySet()) {
            newMap.put(bibtexEntryBibtexDatabaseEntry.getKey(), bibtexEntryBibtexDatabaseEntry.getValue());
        }
        entries = newMap;
    }
    clearBibTextSectionContent2();
    populateBibTextSection(entries, style);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:24,代码来源:OOBibBase.java

示例7: createBibTextSection2

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private void createBibTextSection2(boolean end)
        throws IllegalArgumentException, CreationException {

    XTextCursor mxDocCursor = text.createTextCursor();
    if (end) {
        mxDocCursor.gotoEnd(false);
    }
    OOUtil.insertParagraphBreak(text, mxDocCursor);
    // Create a new TextSection from the document factory and access it's XNamed interface
    XNamed xChildNamed;
    try {
        xChildNamed = UnoRuntime.queryInterface(XNamed.class,
            mxDocFactory.createInstance("com.sun.star.text.TextSection"));
    } catch (Exception e) {
        throw new CreationException(e.getMessage());
    }
    // Set the new sections name to 'Child_Section'
    xChildNamed.setName(OOBibBase.BIB_SECTION_NAME);
    // Access the Child_Section's XTextContent interface and insert it into the document
    XTextContent xChildSection = UnoRuntime.queryInterface(XTextContent.class, xChildNamed);
    text.insertTextContent(mxDocCursor, xChildSection, false);

}
 
开发者ID:JabRef,项目名称:jabref,代码行数:24,代码来源:OOBibBase.java

示例8: clearBibTextSectionContent2

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private void clearBibTextSectionContent2()
        throws NoSuchElementException, WrappedTargetException, IllegalArgumentException, CreationException {

    // Check if the section exists:
    XTextSectionsSupplier supplier = UnoRuntime.queryInterface(XTextSectionsSupplier.class, mxDoc);
    if (supplier.getTextSections().hasByName(OOBibBase.BIB_SECTION_NAME)) {
        XTextSection section = (XTextSection) ((Any) supplier.getTextSections().getByName(OOBibBase.BIB_SECTION_NAME))
                .getObject();
        // Clear it:
        XTextCursor cursor = text.createTextCursorByRange(section.getAnchor());
        cursor.gotoRange(section.getAnchor(), false);
        cursor.setString("");
    } else {
        createBibTextSection2(atEnd);
    }
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:17,代码来源:OOBibBase.java

示例9: insertBookMark

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private XTextContent insertBookMark(String name, XTextCursor position)
        throws IllegalArgumentException, CreationException {
    Object bookmark;
    try {
        bookmark = mxDocFactory.createInstance("com.sun.star.text.Bookmark");
    } catch (Exception e) {
        throw new CreationException(e.getMessage());
    }
    // name the bookmark
    XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, bookmark);
    xNamed.setName(name);
    // get XTextContent interface
    XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, bookmark);
    // insert bookmark at the end of the document
    // instead of mxDocText.getEnd you could use a text cursor's XTextRange interface or any XTextRange
    text.insertTextContent(position, xTextContent, true);
    position.collapseToEnd();
    return xTextContent;
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:20,代码来源:OOBibBase.java

示例10: createTestUsers

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private void createTestUsers() throws IllegalArgumentException, SystemException, NotSupportedException, HeuristicRollbackException, HeuristicMixedException, RollbackException
{
    AuthenticationUtil.setFullyAuthenticatedUser(user1);
    for (String[] properties: userProperties)
    {
        int l = properties.length;
        if (l > 0)
        {
            PersonInfo personInfo = newPersonInfo(properties);
            String originalUsername = personInfo.getUsername();
            String id = createUser(personInfo, networkOne);
            Person person = new Person(
                           id,
                           null, // Not set to originalUsername, as the returned JSON does not set it
                           true, // enabled
                personInfo.getFirstName(),
                personInfo.getLastName(),
                personInfo.getCompany(),
                personInfo.getSkype(),
                personInfo.getLocation(),
                personInfo.getTel(),
                personInfo.getMob(),
                personInfo.getInstantmsg(),
                personInfo.getGoogle(),
                           null); // description
            testUsernames.add(originalUsername);
            testPersons.add(person);

            // The following call to personService.getPerson(id) returns a NodeRef like:
            //    workspace://SpacesStore/9db76769-96de-4de4-bdb4-a127130af362
            // We call tenantService.getName(nodeRef) to get a fully qualified NodeRef as Solr returns this.
            // They look like:
            //    workspace://@[email protected]/9db76769-96de-4de4-bdb4-a127130af362
            NodeRef nodeRef = personService.getPerson(id);
            nodeRef = tenantService.getName(nodeRef);
            testPersonNodeRefs.add(nodeRef);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:40,代码来源:QueriesPeopleApiTest.java

示例11: newPersonInfo

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private static PersonInfo newPersonInfo(String... properties) throws IllegalArgumentException
{
    int l = properties.length;
    if (l > 17)
    {
        throw new IllegalArgumentException("Too many properties supplied for "+properties);
    }
    return new PersonInfo(
        (l <=  1 ? null : properties[ 1]),  // firstName
        (l <=  2 ? null : properties[ 2]),  // lastName
        (l <=  0 ? null : properties[ 0]),  // username

        (l <=  3 || properties[ 3] == null
           ? "password" : properties[ 3]),  // password
        (l <=  4 ? null : new Company(
                          properties[ 4],   // organization
        (l <=  5 ? null : properties[ 5]),  // address1
        (l <=  6 ? null : properties[ 6]),  // address2
        (l <=  7 ? null : properties[ 7]),  // address3
        (l <=  8 ? null : properties[ 8]),  // postcode
        (l <=  9 ? null : properties[ 9]),  // telephone
        (l <= 10 ? null : properties[10]),  // fax
        (l <= 11 ? null : properties[11]))),// email
        (l <= 12 ? null : properties[12]),  // skype
        (l <= 13 ? null : properties[13]),  // location
        (l <= 14 ? null : properties[14]),  // tel
        (l <= 15 ? null : properties[15]),  // mob
        (l <= 16 ? null : properties[16]),  // instantmsg
        (l <= 17 ? null : properties[17])); // google
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:31,代码来源:QueriesPeopleApiTest.java

示例12: createTestUsers

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private Map<String, Person> createTestUsers(String[][] userProperties) throws IllegalArgumentException 
{
    for (String[] properties: userProperties)
    {
        int l = properties.length;
        if (l > 0)
        {
            PersonInfo personInfo = newPersonInfo(properties);
            String originalUsername = personInfo.getUsername();
            String id = createUser(personInfo, networkOne);
            Person person = new Person(
                           id,
                           null, // Not set to originalUsername, as the returned JSON does not set it
                           true, // enabled
                personInfo.getFirstName(),
                personInfo.getLastName(),
                personInfo.getCompany(),
                personInfo.getSkype(),
                personInfo.getLocation(),
                personInfo.getTel(),
                personInfo.getMob(),
                personInfo.getInstantmsg(),
                personInfo.getGoogle(),
                           null); // description
            testUsers.put(originalUsername, person);
            
            // The following would automatically delete users after a test, but
            // we need to clear other data and as we created them we should delete
            // them.
            // super.users.add(id);
        }
    }
    return testUsers;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:35,代码来源:QueriesPeopleApiTest.java

示例13: newPersonInfo

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
private static PersonInfo newPersonInfo(String... properties) throws IllegalArgumentException 
{
    int l = properties.length;
    if (l > 17)
    {
        throw new IllegalArgumentException("Too many properties supplied for "+properties);
    }
    return new PersonInfo(
        (l <=  1 ? null : properties[ 1]),  // firstName
        (l <=  2 ? null : properties[ 2]),  // lastName
        (l <=  0 ? null : properties[ 0]),  // username
        
        (l <=  3 || properties[ 3] == null
           ? "password" : properties[ 3]),  // password
        (l <=  4 ? null : new Company(
                          properties[ 4],   // organization
        (l <=  5 ? null : properties[ 5]),  // address1
        (l <=  6 ? null : properties[ 6]),  // address2
        (l <=  7 ? null : properties[ 7]),  // address3
        (l <=  8 ? null : properties[ 8]),  // postcode
        (l <=  9 ? null : properties[ 9]),  // telephone
        (l <= 10 ? null : properties[10]),  // fax
        (l <= 11 ? null : properties[11]))),// email
        (l <= 12 ? null : properties[12]),  // skype
        (l <= 13 ? null : properties[13]),  // location
        (l <= 14 ? null : properties[14]),  // tel
        (l <= 15 ? null : properties[15]),  // mob
        (l <= 16 ? null : properties[16]),  // instantmsg
        (l <= 17 ? null : properties[17])); // google 
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:31,代码来源:QueriesPeopleApiTest.java

示例14: ignoreRule

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
/**
 * Called when "Ignore" is selected e.g. in the context menu for an error.
 */
@Override
public void ignoreRule(final String ruleId, final Locale locale)
    throws IllegalArgumentException {
  // TODO: config should be locale-dependent
  disabledRulesUI.add(ruleId);
  //config.setDisabledRuleIds(disabledRulesUI);
  try {
    //config.saveConfiguration(langTool.getLanguage());
  } catch (final Throwable t) {
    showError(t);
  }
  recheck = true;
}
 
开发者ID:prowritingaid,项目名称:openoffice-extension,代码行数:17,代码来源:Main.java

示例15: isVerfuegungspunkt

import com.sun.star.lang.IllegalArgumentException; //导入依赖的package包/类
/**
 * Liefert true, wenn es sich bei dem übergebenen Absatz paragraph um einen als
 * Verfuegungspunkt markierten Absatz handelt.
 * 
 * @param paragraph
 *          Das Objekt mit der Property ParaStyleName, die für den Vergleich
 *          herangezogen wird.
 * @return true, wenn der Name des Absatzformates mit "WollMuxVerfuegungspunkt"
 *         beginnt.
 */
private static boolean isVerfuegungspunkt(XTextRange paragraph)
{
  String paraStyleName = "";
  try
  {
    paraStyleName =
      AnyConverter.toString(UNO.getProperty(paragraph, "ParaStyleName"));
  }
  catch (IllegalArgumentException e)
  {}
  return paraStyleName.startsWith(ParaStyleNameVerfuegungspunkt);
}
 
开发者ID:WollMux,项目名称:WollMux,代码行数:23,代码来源:SachleitendeVerfuegung.java


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