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


Java StringUtilRt.parseInt方法代码示例

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


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

示例1: DefaultHtmlDoctypeInitialConfigurator

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
                                             PropertiesComponent propertiesComponent) {
  if (!propertiesComponent.getBoolean("DefaultHtmlDoctype.MigrateToHtml5")) {
    propertiesComponent.setValue("DefaultHtmlDoctype.MigrateToHtml5", true);
    ExternalResourceManagerEx.getInstanceEx()
      .setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), projectManager.getDefaultProject());
  }
  // sometimes VFS fails to pick up updated schema contents and we need to force refresh
  if (StringUtilRt.parseInt(propertiesComponent.getValue("DefaultHtmlDoctype.Refreshed"), 0) < VERSION) {
    propertiesComponent.setValue("DefaultHtmlDoctype.Refreshed", Integer.toString(VERSION));
    final String schemaUrl = VfsUtilCore.pathToUrl(Html5SchemaProvider.getHtml5SchemaLocation());
    final VirtualFile schemaFile = VirtualFileManager.getInstance().findFileByUrl(schemaUrl);
    if (schemaFile != null) {
      schemaFile.getParent().refresh(false, true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DefaultHtmlDoctypeInitialConfigurator.java

示例2: extractArgNum

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
private static int extractArgNum(String[] options) {


    for (String value : options) {
      Integer parsedValue = parseArgNum(value);
      if (parsedValue != null) {
        return parsedValue;
      }
    }

    if (options.length == 1) {
      return StringUtilRt.parseInt(options[0], 0);
    }

    return 0;
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:MapEntryOrKeyValueHintProcessor.java

示例3: parseArgNum

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
private static Integer parseArgNum(String value) {
  Couple<String> pair = parseValue(value);
  if (pair == null) return null;

  Integer parsedValue = StringUtilRt.parseInt(pair.getSecond(), 0);
  if ("argNum".equals(pair.getFirst())) {
    return parsedValue;
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MapEntryOrKeyValueHintProcessor.java

示例4: getInt

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
public int getInt(@NotNull String name, int defaultValue) {
  return StringUtilRt.parseInt(getValue(name), defaultValue);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PropertiesComponent.java

示例5: getIntParameter

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
protected static int getIntParameter(@NotNull String name, @NotNull QueryStringDecoder urlDecoder) {
  return StringUtilRt.parseInt(StringUtil.nullize(ContainerUtil.getLastItem(urlDecoder.parameters().get(name)), true), -1);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:RestService.java

示例6: execute

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
@Nullable
@Override
public String execute(@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) throws IOException {
  final boolean keepAlive = HttpUtil.isKeepAlive(request);
  final Channel channel = context.channel();

  OpenFileRequest apiRequest;
  if (request.method() == HttpMethod.POST) {
    apiRequest = gson.getValue().fromJson(createJsonReader(request), OpenFileRequest.class);
  }
  else {
    apiRequest = new OpenFileRequest();
    apiRequest.file = StringUtil.nullize(getStringParameter("file", urlDecoder), true);
    apiRequest.line = getIntParameter("line", urlDecoder);
    apiRequest.column = getIntParameter("column", urlDecoder);
    apiRequest.focused = getBooleanParameter("focused", urlDecoder, true);
  }

  int prefixLength = 1 + PREFIX.length() + 1 + getServiceName().length() + 1;
  String path = urlDecoder.path();
  if (path.length() > prefixLength) {
    Matcher matcher = LINE_AND_COLUMN.matcher(path).region(prefixLength, path.length());
    LOG.assertTrue(matcher.matches());
    if (apiRequest.file == null) {
      apiRequest.file = matcher.group(1).trim();
    }
    if (apiRequest.line == -1) {
      apiRequest.line = StringUtilRt.parseInt(matcher.group(2), 1);
    }
    if (apiRequest.column == -1) {
      apiRequest.column = StringUtilRt.parseInt(matcher.group(3), 1);
    }
  }

  if (apiRequest.file == null) {
    sendStatus(HttpResponseStatus.BAD_REQUEST, keepAlive, channel);
    return null;
  }

  openFile(apiRequest)
    .done(new Consumer<Void>() {
      @Override
      public void consume(Void aVoid) {
        sendStatus(HttpResponseStatus.OK, keepAlive, channel);
      }
    })
    .rejected(new Consumer<Throwable>() {
      @Override
      public void consume(Throwable throwable) {
        if (throwable == NOT_FOUND) {
          sendStatus(HttpResponseStatus.NOT_FOUND, keepAlive, channel);
        }
        else {
          // todo send error
          sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR, keepAlive, channel);
          LOG.error(throwable);
        }
      }
    });
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:62,代码来源:OpenFileHttpService.java

示例7: loadState

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
@Override
public void loadState(Element state) {
  int savedVersion = StringUtilRt.parseInt(state.getAttributeValue(ATTRIBUTE_VERSION), 0);

  for (Element element : state.getChildren()) {
    if (element.getName().equals(ELEMENT_IGNORE_FILES)) {
      myIgnoredPatterns.setIgnoreMasks(element.getAttributeValue(ATTRIBUTE_LIST));
    }
    else if (AbstractFileType.ELEMENT_EXTENSION_MAP.equals(element.getName())) {
      readGlobalMappings(element);
    }
  }

  if (savedVersion < 4) {
    if (savedVersion == 0) {
      addIgnore(".svn");
    }

    if (savedVersion < 2) {
      restoreStandardFileExtensions();
    }

    addIgnore("*.pyc");
    addIgnore("*.pyo");
    addIgnore(".git");
  }

  if (savedVersion < 5) {
    addIgnore("*.hprof");
  }

  if (savedVersion < 6) {
    addIgnore("_svn");
  }

  if (savedVersion < 7) {
    addIgnore(".hg");
  }

  if (savedVersion < 8) {
    addIgnore("*~");
  }

  if (savedVersion < 9) {
    addIgnore("__pycache__");
  }

  if (savedVersion < 11) {
    addIgnore("*.rbc");
  }

  if (savedVersion < 13) {
    // we want *.lib back since it's an important user artifact for CLion, also for IDEA project itself, since we have some libs.  
    unignoreMask("*.lib");
  }

  if (savedVersion < 15) {
    // we want .bundle back, bundler keeps useful data there
    unignoreMask(".bundle");
  }
  
  if (savedVersion < 16) {
    // we want .tox back to allow users selecting interpreters from it
    unignoreMask(".tox");
  }
  
  myIgnoredFileCache.clearCache();

  String counter = JDOMExternalizer.readString(state, "fileTypeChangedCounter");
  if (counter != null) {
    fileTypeChangedCount.set(StringUtilRt.parseInt(counter, 0));
    autoDetectedAttribute = autoDetectedAttribute.newVersion(fileTypeChangedCount.get());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:75,代码来源:FileTypeManagerImpl.java

示例8: readInteger

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
public static int readInteger(Element root, String name, int defaultValue) {
  return StringUtilRt.parseInt(readString(root, name), defaultValue);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JDOMExternalizer.java

示例9: AutoTestManager

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
public AutoTestManager(@NotNull Project project) {
  myProject = project;
  myDelayMillis = StringUtilRt.parseInt(PropertiesComponent.getInstance(project).getValue(AUTO_TEST_MANAGER_DELAY), AUTO_TEST_MANAGER_DELAY_DEFAULT);
  myDocumentWatcher = createWatcher();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AutoTestManager.java

示例10: getValueTooltipDelay

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
private int getValueTooltipDelay() {
  Object value = valueTooltipDelayTextField.getValue();
  return value instanceof Number ? ((Number)value).intValue() :
         StringUtilRt.parseInt((String)value, XDebuggerDataViewSettings.DEFAULT_VALUE_TOOLTIP_DELAY);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DataViewsConfigurableUi.java

示例11: getIntegerValue

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
private static int getIntegerValue(String s, int defaultValue) {
  int value = StringUtilRt.parseInt(s, defaultValue);
  return value < 0 ? defaultValue : value;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:CodeCompletionPanel.java

示例12: ModeSwitchableDialog

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
public ModeSwitchableDialog(com.intellij.openapi.project.Project project, boolean canBeParent) {
  super(project, canBeParent);

  myMode = Mode.values()[StringUtilRt.parseInt(PropertiesComponent.getInstance().getValue(getPrivateDimensionServiceKey() + ".MODE", "0"), 0)];
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ModeSwitchableDialog.java

示例13: getInt

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
public int getInt(@Nonnull String name, int defaultValue) {
  return StringUtilRt.parseInt(getValue(name), defaultValue);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:PropertiesComponent.java

示例14: loadState

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
@Override
public void loadState(Element state) {
  int savedVersion = StringUtilRt.parseInt(state.getAttributeValue(ATTRIBUTE_VERSION), 0);

  for (Element element : state.getChildren()) {
    if (element.getName().equals(ELEMENT_IGNORE_FILES)) {
      myIgnoredPatterns.setIgnoreMasks(element.getAttributeValue(ATTRIBUTE_LIST));
    }
    else if (AbstractFileType.ELEMENT_EXTENSION_MAP.equals(element.getName())) {
      readGlobalMappings(element);
    }
  }

  if (savedVersion < 4) {
    if (savedVersion == 0) {
      addIgnore(".svn");
    }

    if (savedVersion < 2) {
      restoreStandardFileExtensions();
    }

    addIgnore("*.pyc");
    addIgnore("*.pyo");
    addIgnore(".git");
  }

  if (savedVersion < 5) {
    addIgnore("*.hprof");
  }

  if (savedVersion < 6) {
    addIgnore("_svn");
  }

  if (savedVersion < 7) {
    addIgnore(".hg");
  }

  if (savedVersion < 8) {
    addIgnore("*~");
  }

  if (savedVersion < 9) {
    addIgnore("__pycache__");
  }

  if (savedVersion < 11) {
    addIgnore("*.rbc");
  }

  if (savedVersion < 13) {
    // we want *.lib back since it's an important user artifact for CLion, also for IDEA project itself, since we have some libs.
    unignoreMask("*.lib");
  }

  if (savedVersion < 15) {
    // we want .bundle back, bundler keeps useful data there
    unignoreMask(".bundle");
  }

  if (savedVersion < 16) {
    // we want .tox back to allow users selecting interpreters from it
    unignoreMask(".tox");
  }

  if (savedVersion < 17) {
    addIgnore("*.rbc");
  }

  myIgnoredFileCache.clearCache();

  String counter = JDOMExternalizer.readString(state, "fileTypeChangedCounter");
  if (counter != null) {
    fileTypeChangedCount.set(StringUtilRt.parseInt(counter, 0));
    autoDetectedAttribute = autoDetectedAttribute.newVersion(fileTypeChangedCount.get());
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:79,代码来源:FileTypeManagerImpl.java


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