Codota Logo
IType.getJavaProject
Code IndexAdd Codota to your IDE (free)

How to use
getJavaProject
method
in
org.eclipse.jdt.core.IType

Best Java code snippets using org.eclipse.jdt.core.IType.getJavaProject (Showing top 20 results out of 315)

  • Common ways to obtain IType
private void myMethod () {
IType i =
  • Codota IconIMethod method;method.getDeclaringType()
  • Codota IconIJavaProject javaProject;String fullyQualifiedName;javaProject.findType(fullyQualifiedName)
  • Codota IconIMember member;member.getDeclaringType()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Returns the java project this hierarchy was created in.
 */
public IJavaProject javaProject() {
  return this.focusType.getJavaProject();
}
protected static byte[] readUntil(InputStream input, byte separator) throws JavaModelException, IOException{
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private StringBuilder composeTypeReference(IType type) {
  StringBuilder buffer= new StringBuilder();
  buffer.append(type.getJavaProject().getElementName());
  buffer.append(PROJECT_END_CHAR);
  buffer.append(type.getFullyQualifiedName());
  return buffer;
}
origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e

/**
 * Converts the {@link IType} to {@link org.eclipse.scout.sdk.core.model.api.IType}
 *
 * @param jdtType
 *          The input jdt {@link IType}
 * @return The resulting {@link org.eclipse.scout.sdk.core.model.api.IType}
 */
public static org.eclipse.scout.sdk.core.model.api.IType jdtTypeToScoutType(IType jdtType) {
 return jdtTypeToScoutType(jdtType, ScoutSdkCore.createJavaEnvironment(jdtType.getJavaProject()));
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * 
 * @param type the type for which a method is created
 * @param dialog the dialog box where the user has defined his preferences
 * @return settings applicable for this action
 */
CodeGenerationSettings createSettings(IType type, SourceActionDialog dialog) {
  CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject());
  settings.createComments= dialog.getGenerateComment();
  return settings;
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

protected void openCodeTempatePage(String id) {
  HashMap<String, String> arg= new HashMap<>();
  arg.put(CodeTemplatePreferencePage.DATA_SELECT_TEMPLATE, id);
  PreferencesUtil.createPropertyDialogOn(getShell(), fType.getJavaProject().getProject(), CodeTemplatePreferencePage.PROP_ID, null, arg).open();
}
origin: org.eclipse/org.eclipse.jdt.ui

protected void openCodeTempatePage(String id) {
  HashMap arg= new HashMap();
  arg.put(CodeTemplatePreferencePage.DATA_SELECT_TEMPLATE, id);
  PreferencesUtil.createPropertyDialogOn(getShell(), fType.getJavaProject().getProject(), CodeTemplatePreferencePage.PROP_ID, null, arg).open();
}

origin: org.eclipse/org.eclipse.jdt.ui

private IType resolveType(String qualifiedTypeName) throws JavaModelException{
  IType type= getDeclaringType().getJavaProject().findType(qualifiedTypeName);
  if (type == null)
    type= getDeclaringType().getJavaProject().findType(getDeclaringType().getPackageFragment().getElementName(), qualifiedTypeName);
  return type;
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

private IType resolveType(String qualifiedTypeName) throws JavaModelException{
  IType type= getDeclaringType().getJavaProject().findType(qualifiedTypeName);
  if (type == null)
    type= getDeclaringType().getJavaProject().findType(getDeclaringType().getPackageFragment().getElementName(), qualifiedTypeName);
  return type;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private String getAlignedSourceBlock(final ICompilationUnit unit, final String block) {
  Assert.isNotNull(block);
  final String[] lines= Strings.convertIntoLines(block);
  Strings.trimIndentation(lines, unit.getJavaProject(), false);
  return Strings.concatenate(lines, StubUtility.getLineDelimiterUsed(fType.getJavaProject()));
}
origin: eclipse/eclipse.jdt.ls

private String createTypeTags(IDocument document, int offset, String indentation, String lineDelimiter, IType type) throws CoreException, BadLocationException {
  if (!accept(offset, type)) {
    return null;
  }
  String[] typeParamNames = StubUtility.getTypeParameterNames(type.getTypeParameters());
  String comment = CodeGeneration.getTypeComment(type.getCompilationUnit(), type.getTypeQualifiedName('.'), typeParamNames, lineDelimiter);
  if (comment != null) {
    return prepareTemplateComment(comment.trim(), indentation, type.getJavaProject(), lineDelimiter);
  }
  return null;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
protected void createTypeMembers(IType newType, ImportsManager imports, IProgressMonitor monitor) throws CoreException {
  String lineDelimiter= StubUtility.getLineDelimiterUsed(newType.getJavaProject());
  fTargetSelection.addAnnotation(newType, imports, lineDelimiter);
  fRetentionSelection.addAnnotation(newType, imports, lineDelimiter);
  addDocumentedAnnotation(newType, imports, lineDelimiter);
  persistSettings();
}
origin: org.eclipse/org.eclipse.jdt.ui

private void addParameterToConstructor(final ASTRewrite rewrite, final MethodDeclaration declaration) throws JavaModelException {
  Assert.isNotNull(rewrite);
  Assert.isNotNull(declaration);
  final AST ast= declaration.getAST();
  final String name= getNameForEnclosingInstanceConstructorParameter();
  final SingleVariableDeclaration variable= ast.newSingleVariableDeclaration();
  variable.setType(createEnclosingType(ast));
  variable.setName(ast.newSimpleName(name));
  rewrite.getListRewrite(declaration, MethodDeclaration.PARAMETERS_PROPERTY).insertFirst(variable, null);
  JavadocUtil.addParamJavadoc(name, declaration, rewrite, fType.getJavaProject(), null);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void addParameterToConstructor(final ASTRewrite rewrite, final MethodDeclaration declaration) throws JavaModelException {
  Assert.isNotNull(rewrite);
  Assert.isNotNull(declaration);
  final AST ast= declaration.getAST();
  final String name= getNameForEnclosingInstanceConstructorParameter();
  final SingleVariableDeclaration variable= ast.newSingleVariableDeclaration();
  variable.setType(createEnclosingType(ast));
  variable.setName(ast.newSimpleName(name));
  rewrite.getListRewrite(declaration, MethodDeclaration.PARAMETERS_PROPERTY).insertFirst(variable, null);
  JavadocUtil.addParamJavadoc(name, declaration, rewrite, fType.getJavaProject(), null);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static void startExtractInterfaceRefactoring(final IType type, final Shell shell) {
  ExtractInterfaceProcessor processor= new ExtractInterfaceProcessor(type, JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject()));
  Refactoring refactoring= new ProcessorBasedRefactoring(processor);
  new RefactoringStarter().activate(new ExtractInterfaceWizard(processor, refactoring), shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring,
      RefactoringSaveHelper.SAVE_REFACTORING);
}
origin: org.eclipse/org.eclipse.jdt.ui

public static void startMoveInnerRefactoring(final IType type, final Shell shell) throws JavaModelException {
  if (!RefactoringAvailabilityTester.isMoveInnerAvailable(type))
    return;
  final MoveInnerToTopRefactoring refactoring= new MoveInnerToTopRefactoring(type, JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject()));
  new RefactoringStarter().activate(refactoring, new MoveInnerToTopWizard(refactoring), shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringSaveHelper.SAVE_JAVA_ONLY_UPDATES);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static void startMoveInnerRefactoring(final IType type, final Shell shell) throws JavaModelException {
  if (!RefactoringAvailabilityTester.isMoveInnerAvailable(type))
    return;
  final MoveInnerToTopRefactoring refactoring= new MoveInnerToTopRefactoring(type, JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject()));
  new RefactoringStarter().activate(new MoveInnerToTopWizard(refactoring), shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringSaveHelper.SAVE_REFACTORING);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public static void startMoveInnerRefactoring(final IType type, final Shell shell) throws JavaModelException {
  if (!RefactoringAvailabilityTester.isMoveInnerAvailable(type))
    return;
  final MoveInnerToTopRefactoring refactoring= new MoveInnerToTopRefactoring(type, JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject()));
  new RefactoringStarter().activate(new MoveInnerToTopWizard(refactoring), shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringSaveHelper.SAVE_REFACTORING);
}
origin: eclipse/eclipse.jdt.ls

private void computeQualifiedNameMatches(IProgressMonitor pm) {
  IPackageFragment fragment = fType.getPackageFragment();
  if (fQualifiedNameSearchResult == null) {
    fQualifiedNameSearchResult = new QualifiedNameSearchResult();
  }
  QualifiedNameFinder.process(fQualifiedNameSearchResult, fType.getFullyQualifiedName(), fragment.getElementName() + "." + getNewElementName(), //$NON-NLS-1$
      fFilePatterns, fType.getJavaProject().getProject(), pm);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void computeQualifiedNameMatches(IProgressMonitor pm) {
  IPackageFragment fragment= fType.getPackageFragment();
  if (fQualifiedNameSearchResult == null)
    fQualifiedNameSearchResult= new QualifiedNameSearchResult();
  QualifiedNameFinder.process(fQualifiedNameSearchResult, fType.getFullyQualifiedName(),
    fragment.getElementName() + "." + getNewElementName(), //$NON-NLS-1$
    fFilePatterns, fType.getJavaProject().getProject(), pm);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
CodeGenerationSettings createSettings(IType type, SourceActionDialog dialog) {
  ToStringGenerationSettings settings= ((GenerateToStringDialog) dialog).getGenerationSettings();
  super.createSettings(type, dialog).setSettings(settings);
  settings.createComments= dialog.getGenerateComment();
  settings.useBlocks= useBlocks(type.getJavaProject());
  String version= fUnit.getJavaElement().getJavaProject().getOption(JavaCore.COMPILER_SOURCE, true);
  settings.is50orHigher= !JavaModelUtil.isVersionLessThan(version, JavaCore.VERSION_1_5);
  settings.is60orHigher= !JavaModelUtil.isVersionLessThan(version, JavaCore.VERSION_1_6);
  return settings;
}
org.eclipse.jdt.coreITypegetJavaProject

Popular methods of IType

  • getFullyQualifiedName
    Returns the fully qualified name of this type, including qualification for any containing types and
  • getElementName
    Returns the simple name of this type, unqualified by package or enclosing type. This is a handle-onl
  • getMethods
    Returns the methods and constructors declared by this type. For binary types, this may include the s
  • getFlags
  • getPackageFragment
    Returns the package fragment in which this element is defined. This is a handle-only method.
  • getCompilationUnit
  • newSupertypeHierarchy
    Creates and returns a type hierarchy for this type containing this type and all of its supertypes, c
  • exists
  • isInterface
    Returns whether this type represents an interface. Note that an interface can also be an annotation
  • getDeclaringType
  • getMethod
    Returns the method with the specified name and parameter types in this type (for example, "foo", {"I
  • getParent
  • getMethod,
  • getParent,
  • isClass,
  • getSourceRange,
  • newTypeHierarchy,
  • isAnonymous,
  • isBinary,
  • getResource,
  • getTypeParameters

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
  • requestLocationUpdates (LocationManager)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now