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

Java AndroidBundle类代码示例

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

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



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

示例1: getApk

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Nullable
private static File getApk(@NotNull Variant variant, @NotNull IDevice device) {
  AndroidArtifact mainArtifact = variant.getMainArtifact();
  List<AndroidArtifactOutput> outputs = Lists.newArrayList(mainArtifact.getOutputs());
  if (outputs.isEmpty()) {
    LOG.info("No outputs for the main artifact of variant: " + variant.getDisplayName());
    return null;
  }

  List<String> abis = device.getAbis();
  int density = device.getDensity();
  Set<String> variantAbiFilters = mainArtifact.getAbiFilters();
  List<OutputFile> apkFiles = SplitOutputMatcher.computeBestOutput(outputs, variantAbiFilters, density, abis);
  if (apkFiles.isEmpty()) {
    String message = AndroidBundle.message("deployment.failed.splitapk.nomatch", outputs.size(), density, Joiner.on(", ").join(abis));
    LOG.error(message);
    return null;
  }
  return apkFiles.get(0).getOutputFile();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AndroidRunningState.java


示例2: generate

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
private static void generate(Project project, final Module... modules) {
  CompilerManager.getInstance(project).executeTask(new CompileTask() {
    @Override
    public boolean execute(CompileContext context) {
      // todo: compatibility with background autogenerating

      for (Module module : modules) {
        final AndroidFacet facet = AndroidFacet.getInstance(module);

        if (facet != null) {
          for (AndroidAutogeneratorMode mode : AndroidAutogeneratorMode.values()) {
            AndroidCompileUtil.generate(facet, mode, context, true);
          }
        }
      }
      return true;
    }
  }, new ModuleCompileScope(project, modules, false), AndroidBundle.message("android.compile.messages.generating.r.java.content.name"),
                                                   null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AndroidRegenerateSourcesAction.java


示例3: getText

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@NotNull
@Override
public String getText() {
  String id = getLintId(myId);
  final PsiFile file = PsiTreeUtil.getParentOfType(myElement, PsiFile.class);
  if (file == null) {
    return "";
  } else if (file instanceof XmlFile) {
    return AndroidBundle.message("android.lint.fix.suppress.lint.api.attr", id);
  } else if (file instanceof PsiJavaFile) {
    return AndroidBundle.message("android.lint.fix.suppress.lint.api.annotation", id);
  } else if (file instanceof GroovyFile) {
    return "Suppress: Add //noinspection " + id;
  } else {
    return "";
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SuppressLintIntentionAction.java


示例4: MyDialog

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
protected MyDialog(@NotNull AndroidFacet facet, @Nullable InputValidator validator) {
  super(facet.getModule().getProject());
  myValidator = validator;
  setTitle(AndroidBundle.message("new.typed.resource.dialog.title", myResourcePresentableName));
  final List<String> tagNames = getSortedAllowedTagNames(facet);
  myRootElementField = new TextFieldWithAutoCompletion<String>(
    facet.getModule().getProject(), new TextFieldWithAutoCompletion.StringsCompletionProvider(tagNames, null), true, null);
  myRootElementField.setText(myDefaultRootTag);
  myRootElementFieldWrapper.add(myRootElementField, BorderLayout.CENTER);
  myRootElementLabel.setLabelFor(myRootElementField);
  init();

  myFileNameField.getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    public void textChanged(DocumentEvent event) {
      final String text = myFileNameField.getText().trim();
      if (myValidator instanceof InputValidatorEx) {
        setErrorText(((InputValidatorEx) myValidator).getErrorText(text));
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CreateMultiRootResourceFileAction.java


示例5: reportMissingOnClickProblem

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
private void reportMissingOnClickProblem(OnClickConverter.MyReference reference,
                                         PsiClass activity,
                                         String methodName,
                                         boolean incorrectSignature) {
  String activityName = activity.getName();

  if (activityName == null) {
    activityName = "";
  }
  final String message =
    incorrectSignature
    ? AndroidBundle.message("android.inspections.on.click.missing.incorrect.signature", methodName, activityName)
    : AndroidBundle.message("android.inspections.on.click.missing.problem", methodName, activityName);

  final LocalQuickFix[] fixes =
    StringUtil.isJavaIdentifier(methodName)
    ? new LocalQuickFix[]{new MyQuickFix(methodName, reference.getConverter(), activity)}
    : LocalQuickFix.EMPTY_ARRAY;

  myResult.add(myInspectionManager.createProblemDescriptor(
    reference.getElement(), reference.getRangeInElement(), message,
    ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly, fixes));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AndroidMissingOnClickHandlerInspection.java


示例6: getResourceName

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Nullable
private static String getResourceName(Project project, String newFieldName, String oldResourceName) {
  if (newFieldName.indexOf('_') < 0) return newFieldName;
  if (oldResourceName.indexOf('_') < 0 && oldResourceName.indexOf('.') >= 0) {
    String suggestion = newFieldName.replace('_', '.');
    newFieldName = Messages.showInputDialog(project, AndroidBundle.message("rename.resource.dialog.text", oldResourceName),
                                            RefactoringBundle.message("rename.title"), Messages.getQuestionIcon(), suggestion, null);
  }
  return newFieldName;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AndroidResourceRenameResourceProcessor.java


示例7: doOKAction

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Override
protected void doOKAction() {
  FileSaverDescriptor descriptor =
    new FileSaverDescriptor(AndroidBundle.message("android.ddms.screenshot.save.title"), "", SdkConstants.EXT_PNG);
  FileSaverDialog saveFileDialog = FileChooserFactory.getInstance().createSaveFileDialog(descriptor, myProject);
  VirtualFile baseDir = ourLastSavedFolder != null ? ourLastSavedFolder : myProject.getBaseDir();
  VirtualFileWrapper fileWrapper = saveFileDialog.save(baseDir, getDefaultFileName());
  if (fileWrapper == null) {
    return;
  }

  myScreenshotFile = fileWrapper.getFile();
  try {
    ImageIO.write(myDisplayedImageRef.get(), SdkConstants.EXT_PNG, myScreenshotFile);
  }
  catch (IOException e) {
    Messages.showErrorDialog(myProject,
                             AndroidBundle.message("android.ddms.screenshot.save.error", e),
                             AndroidBundle.message("android.ddms.actions.screenshot"));
    return;
  }

  VirtualFile virtualFile = fileWrapper.getVirtualFile();
  if (virtualFile != null) {
    //noinspection AssignmentToStaticFieldFromInstanceMethod
    ourLastSavedFolder = virtualFile.getParent();
  }

  super.doOKAction();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ScreenshotViewer.java


示例8: createCenterPanel

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  panel.setPreferredSize(new Dimension(350, 200));
  final JBLabel label = new JBLabel(AndroidBundle.message("android.import.dependencies.source.roots.dialog.label"));
  label.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
  panel.add(label, BorderLayout.NORTH);
  panel.add(mySourcePathsChooser, BorderLayout.CENTER);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ImportSourceRootsDialog.java


示例9: doValidatePackageName

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@NotNull
static String doValidatePackageName(boolean library, @NotNull String candidate, @Nullable ModulesProvider modulesProvider) {
  if (candidate.length() == 0) {
    return AndroidBundle.message("specify.package.name.error");
  }
  if (!AndroidUtils.isValidAndroidPackageName(candidate)) {
    return candidate;
  }
  if (!AndroidCommonUtils.contains2Identifiers(candidate)) {
    return AndroidBundle.message("package.name.must.contain.2.ids.error");
  }

  if (!library) {
    for (Module module : modulesProvider.getModules()) {
      final AndroidFacet facet = AndroidFacet.getInstance(module);
      if (facet != null && !facet.isLibraryProject()) {
        final Manifest manifest = facet.getManifest();
        if (manifest != null) {
          final String packageName = manifest.getPackage().getValue();
          if (candidate.equals(packageName)) {
            return "Package name '" + packageName + "' is already used by module '" + module.getName() + "'";
          }
        }
      }
    }
  }
  return "";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:AndroidAppPropertiesEditor.java


示例10: validateActivityName

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
private String validateActivityName() {
  String candidate = myActivityNameField.getText().trim();
  if (!AndroidUtils.isIdentifier(candidate)) {
    return AndroidBundle.message("not.valid.acvitiy.name.error", candidate);
  }
  return "";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AndroidAppPropertiesEditor.java


示例11: getActiveText

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Override
@NotNull
protected String getActiveText(@NotNull Client c) {
  return c.getClientData().getAllocationStatus() == ClientData.AllocationTrackingStatus.ON ?
                AndroidBundle.message("android.ddms.actions.allocationtracker.stop") :
                AndroidBundle.message("android.ddms.actions.allocationtracker.start");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ToggleAllocationTrackingAction.java


示例12: getErrorMessage

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Override
public String getErrorMessage(@Nullable String s, ConvertContext context) {
  if (s != null) {
    String message = ResourceNameValidator.create(false, ResourceFolderType.VALUES).getErrorText(s);
    if (message != null) {
      return message;
    }
  }

  return AndroidBundle.message("invalid.resource.name.error", s);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ResourceNameConverter.java


示例13: getQuickFixes

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@NotNull
@Override
public AndroidLintQuickFix[] getQuickFixes(@NotNull String message) {
  return new AndroidLintQuickFix[]{
    new ParcelableQuickFix(AndroidBundle.message("implement.parcelable.intention.text"), ParcelableQuickFix.Operation.IMPLEMENT),
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AndroidLintInspectionToolProvider.java


示例14: createFindStyleApplicationsProcessor

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
public static AndroidFindStyleApplicationsProcessor createFindStyleApplicationsProcessor(XmlTag tag,
                                                                                          MyStyleData styleData,
                                                                                          PsiFile context) {
  final ErrorReporter errorReporter = new ProjectBasedErrorReporter(tag.getProject());
  final Style style = styleData.getStyle();
  final Map<AndroidAttributeInfo, String> attrMap =
    AndroidRefactoringUtil.computeAttributeMap(style, new ProjectBasedErrorReporter(tag.getProject()),
                                               AndroidBundle.message("android.find.style.applications.title"));

  if (attrMap == null || attrMap.size() == 0) {
    return null;
  }
  final AndroidFacet facet = styleData.getFacet();
  final StyleRefData parentStyleRef = AndroidRefactoringUtil.getParentStyle(style);
  PsiElement parentStyleAttrName = null;

  if (parentStyleRef != null) {
    parentStyleAttrName = resolveStyleRef(parentStyleRef, facet);

    if (parentStyleAttrName == null) {
      errorReporter.report("Cannot resolve parent style '" + parentStyleRef.getStyleName() + "'",
                           AndroidBundle.message("android.find.style.applications.title"));
      return null;
    }
  }
  return new AndroidFindStyleApplicationsProcessor(styleData.getFacet().getModule(), attrMap, styleData.getName(), tag,
                                                   styleData.getNameAttrValue(), parentStyleAttrName, context);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:AndroidFindStyleApplicationsAction.java


示例15: checkConfiguration

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Override
public void checkConfiguration(@NotNull AndroidFacet facet) throws RuntimeConfigurationException {
  if (getTargetSelectionMode() == TargetSelectionMode.CLOUD_MATRIX_TEST && !IS_VALID_CLOUD_MATRIX_SELECTION) {
    throw new RuntimeConfigurationError(INVALID_CLOUD_MATRIX_SELECTION_ERROR);
  }
  if (getTargetSelectionMode() == TargetSelectionMode.CLOUD_DEVICE_LAUNCH && !IS_VALID_CLOUD_DEVICE_SELECTION) {
    throw new RuntimeConfigurationError(INVALID_CLOUD_DEVICE_SELECTION_ERROR);
  }

  Module module = facet.getModule();
  JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
  switch (TESTING_TYPE) {
    case TEST_ALL_IN_PACKAGE:
      final PsiPackage testPackage = facade.findPackage(PACKAGE_NAME);
      if (testPackage == null) {
        throw new RuntimeConfigurationWarning(ExecutionBundle.message("package.does.not.exist.error.message", PACKAGE_NAME));
      }
      break;
    case TEST_CLASS:
      final PsiClass testClass =
        getConfigurationModule().checkModuleAndClassName(CLASS_NAME, ExecutionBundle.message("no.test.class.specified.error.text"));
      if (!JUnitUtil.isTestClass(testClass)) {
        throw new RuntimeConfigurationWarning(ExecutionBundle.message("class.isnt.test.class.error.message", CLASS_NAME));
      }
      break;
    case TEST_METHOD:
      checkTestMethod();
      break;
  }
  if (INSTRUMENTATION_RUNNER_CLASS.length() > 0) {
    if (facade.findClass(INSTRUMENTATION_RUNNER_CLASS, module.getModuleWithDependenciesAndLibrariesScope(true)) == null) {
      throw new RuntimeConfigurationError(AndroidBundle.message("instrumentation.runner.class.not.specified.error"));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:AndroidTestRunConfiguration.java


示例16: DumpHprofAction

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
public DumpHprofAction(@NotNull Project project, @NotNull DeviceContext deviceContext, @NotNull EventData events) {
  super(deviceContext,
        AndroidBundle.message("android.ddms.actions.dump.hprof"),
        AndroidBundle.message("android.ddms.actions.dump.hprof.description"),
        AndroidIcons.Ddms.DumpHprof);
  myProject = project;
  myEvents = events;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DumpHprofAction.java


示例17: find

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@NotNull
public static ChooseDeviceDialogFixture find(@NotNull Robot robot) {
  Dialog dialog = WindowFinder.findDialog(DialogMatcher.withTitle(AndroidBundle.message("choose.device.dialog.title")))
                              .withTimeout(LONG_TIMEOUT.duration()).using(robot)
                              .target();
  assertThat(dialog).isInstanceOf(JDialog.class);
  return new ChooseDeviceDialogFixture(robot, (JDialog)dialog);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ChooseDeviceDialogFixture.java


示例18: onSuccess

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
@Override
public void onSuccess() {
  if (myException != null) {
    Messages.showErrorDialog("Unexpected error while converting heap dump: " + myException.getMessage(),
                             AndroidBundle.message("android.profiler.hprof.actions.conv"));
  }
  else {
    LocalFileSystem.getInstance().refreshAndFindFileByIoFile(myDestination);
    Notifications.Bus.notify(new Notification("Android", AndroidBundle.message("android.profiler.hprof.actions.conv"), AndroidBundle
      .message("android.profiler.hprof.actions.conv.saved", myDestination.getAbsolutePath()), NotificationType.INFORMATION));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:RunHprofConvAndSaveAsAction.java


示例19: TestRunParameters

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
TestRunParameters(Project project, ConfigurationModuleSelector moduleSelector) {
  myProject = project;
  myModuleSelector = moduleSelector;

  myPackageComponent.setComponent(new EditorTextFieldWithBrowseButton(project, false));
  bind(myPackageComponent, new MyPackageBrowser());

  myClassComponent
    .setComponent(new EditorTextFieldWithBrowseButton(project, true, new AndroidTestClassVisibilityChecker(moduleSelector)));

  bind(myClassComponent,
       new AndroidTestClassBrowser(project, moduleSelector, AndroidBundle.message("android.browse.test.class.dialog.title"), false));

  myRunnerComponent.setComponent(new EditorTextFieldWithBrowseButton(project, true,
                                                                     new AndroidInheritingClassVisibilityChecker(myProject, moduleSelector,
                                                                                                       AndroidUtils.INSTRUMENTATION_RUNNER_BASE_CLASS)));
  bind(myRunnerComponent, new AndroidInheritingClassBrowser(project, moduleSelector, AndroidUtils.INSTRUMENTATION_RUNNER_BASE_CLASS,
                                                  AndroidBundle.message("android.browse.instrumentation.class.dialog.title"), true
  ));
  bind(myMethodComponent, new MyMethodBrowser());

  addTestingType(TEST_ALL_IN_MODULE, myAllInModuleButton);
  addTestingType(TEST_ALL_IN_PACKAGE, myAllInPackageButton);
  addTestingType(TEST_CLASS, myClassButton);
  addTestingType(TEST_METHOD, myTestMethodButton);

  setAnchor(myPackageComponent.getLabel());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:TestRunParameters.java


示例20: validateFacet

import org.jetbrains.android.util.AndroidBundle; //导入依赖的package包/类
public static List<ValidationError> validateFacet(@Nullable AndroidFacet facet, Module module) {
  List<ValidationError> errors = Lists.newArrayList();
  if (facet == null) {
    errors.add(ValidationError.fatal(AndroidBundle.message("no.facet.error", module.getName())));
    return errors;
  }
  if (facet.getConfiguration().getAndroidPlatform() == null) {
    errors.add(ValidationError.fatal(AndroidBundle.message("select.platform.error")));
  }
  return errors;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:12,代码来源:BlazeAndroidRunConfigurationValidationUtil.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java IdFieldMapper类代码示例发布时间:2022-05-22
下一篇:
Java JPAKEPrimeOrderGroups类代码示例发布时间: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