當前位置: 首頁>>代碼示例>>Java>>正文


Java View類代碼示例

本文整理匯總了Java中org.aikodi.chameleon.workspace.View的典型用法代碼示例。如果您正苦於以下問題:Java View類的具體用法?Java View怎麽用?Java View使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


View類屬於org.aikodi.chameleon.workspace包,在下文中一共展示了View類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAndTestView

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
private View getAndTestView(Project project) {
	assertTrue(project.views().size() == 1);
	View view = project.views().get(0);
	assertTrue(view.language() instanceof Java7);
	assertTrue(view instanceof JavaView);
	boolean found = false;
	for(DocumentScanner loader: view.binaryScanners()) {
		if(loader instanceof BaseJavaProjectLoader) {
			// There should not be more that one base java project 
			// loader in a java project.
			assertTrue(! found);
			found = true;
		}
	}
	assertTrue(found);
	return view;
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:18,代碼來源:TestProjectConfig.java

示例2: assignableTo

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
public boolean assignableTo(Type other) throws LookupException {
	View view = view();
	ObjectOrientedLanguage language = view.language(ObjectOrientedLanguage.class);
Type objType = language.getDefaultSuperClass(view.namespace());
  return super.assignableTo(other) ||
         ( // Reference type
           elementType().subtypeOf(objType) &&
           (other instanceof ArrayType) &&
           elementType().assignableTo(((ArrayType)other).elementType())
         ) ||           
         ( // Primitive type
           (! elementType().subtypeOf(objType)) &&
           (other instanceof ArrayType) &&
           elementType().equals(((ArrayType)other).elementType())
         );
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:17,代碼來源:ArrayType.java

示例3: notifyContainerConnected

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Override
public void notifyContainerConnected(DocumentScannerContainer container) throws ProjectException {
	View view = view();
	if(view != null) {
		_loader = createLoader(view.project().absoluteFile(_path));
	}
	try {
		createInputSources();
	} catch (InputException e) {
		throw new ProjectException(e);
	}

}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:14,代碼來源:ReflectiveJarScanner.java

示例4: addBaseScanner

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Override
protected void addBaseScanner(View view) {
	try {
		//Add the base loader.
		// FIXME The loader waits until it is added and then creates the predefined elements
		// This does not work with the IBM VM, which splits the base jar in two parts.
		// Object and Integer are in separate jar files, so Integer isn't loaded right now.
		view.addBinary(new BaseJavaProjectLoader(baseJarPath(),(Java7)language()));
	} catch (ProjectException e) {
		throw new ConfigException(e);
	}
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:13,代碼來源:JavaProjectConfigurator.java

示例5: getParser

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Override
protected ChameleonANTLR3Parser<? extends Java7> getParser(InputStream inputStream, View view) throws IOException {
  ANTLRInputStream input = new ANTLRInputStream(inputStream);
  JavaLexer lexer = new JavaLexer(input);
  CommonTokenStream tokens = new CommonTokenStream(lexer);
  JavaParser parser = new JavaParser(tokens);
  parser.setView(view);
  return parser;
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:10,代碼來源:JavaModelFactory.java

示例6: testEmptyProject

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Test
public void testEmptyProject() {
	// 1. Create a basic project configuration.
	Project project = createProject("testBasicWrite.xml", "test");
	View view = getAndTestView(project);
	assertTrue(view.sourceScanners().isEmpty());
	assertTrue(view.binaryScanners().size() == 1);
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:9,代碼來源:TestProjectConfig.java

示例7: testOneSourceDirectory

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Test
public void testOneSourceDirectory() {
	Project project = readProject(configFile("one_source_directory.xml"));
	assertTrue(project.getName().equals("one source directory project"));
	View view = getAndTestView(project);
	assertTrue(view.binaryScanners().size() == 1);
	assertTrue(view.sourceScanners().size() == 1);
	DocumentScanner loader = view.sourceScanners().get(0);
	assertTrue(loader instanceof DirectoryScanner);
	assertTrue(loader.project() == project);
	DirectoryScanner directoryLoader = (DirectoryScanner) loader;
	assertTrue(directoryLoader.path().equals("src"));
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:14,代碼來源:TestProjectConfig.java

示例8: process

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
public List<SecondPhaseConstraint> process() throws LookupException {
	List<SecondPhaseConstraint> result = new ArrayList<SecondPhaseConstraint>();
	// If A is the type of null, no constraint is implied on Tj.
	Type A = A();
	View view = A.view();
   ObjectOrientedLanguage l = view.language(ObjectOrientedLanguage.class);
	
	if(! A.equals(l.getNullType(view.namespace()))) {
		result.addAll(processFirstLevel());
	}
	return result;
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:13,代碼來源:FirstPhaseConstraint.java

示例9: processUnresolvedParameters

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
private void processUnresolvedParameters() throws LookupException {
	// JLS 15.12.2.8
	// In context of assignment with type S.
	if(inContextOfAssignmentConversion()) {
		processUnresolved(S());
	} else {
		// Perform under the assumption that S is java.lang.Object
		if(! unresolvedParameters().isEmpty()) {
			View view = invocation().view();
		ObjectOrientedLanguage language = (ObjectOrientedLanguage) view.language();
			processUnresolved((JavaTypeReference) language.createTypeReferenceInNamespace(language.getDefaultSuperClassFQN(),view.namespace()));
		}
	}
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:15,代碼來源:SecondPhaseConstraintSet.java

示例10: addBaseLibraries

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Override
protected void addBaseLibraries(View view, BaseLibraryConfiguration baseLibraryConfiguration) {
	super.addBaseLibraries(view, baseLibraryConfiguration);

	JLoBaseLibraryConfigurator jLoBaseLibraryConfigurator = new JLoBaseLibraryConfigurator(language());
	jLoBaseLibraryConfigurator.process(view, baseLibraryConfiguration);
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:8,代碼來源:JLoProjectConfigurator.java

示例11: addBaseScanner

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Override
protected void addBaseScanner(View view) {
	// The base loader for Java already creates the primitive types
	// and load the Java base library.
	// Therefore, we only have to add a loader for the base JLo library file.

	// 1) For a normal jar release, the base library is always stored inside jlo.jar
	// 2) For the Eclipse plugin, the base library is included inside the plugin jar
	//    and the jlo-base.jar is included as well.
	// 3) When the Eclipse plugin is run as a nested Eclipse during development, 
	//    we use a Directory loader to read the sources directly.
	URL url = getClass().getProtectionDomain().getCodeSource().getLocation();
	try {
		String path = URLDecoder.decode(url.getFile(),"UTF-8");
		SafePredicate<? super String> sourceFileFilter = sourceFileFilter();
		if(path.endsWith(".jar")) {
			JarFile jarFile = new JarFile(path);
			view.addBinary(new ZipScanner(jarFile, sourceFileFilter));
		} else {
			File root = new File(url.toURI());
			if(_baseLibraryInParent) {
				root = root.getParentFile();
			}
			File file = new File(root,JLO_BASE_LIBRARY_DIRECTORY);
			view.addBinary(new BaseDirectoryLoader(file.getAbsolutePath(), new LazyJavaFileInputSourceFactory(), sourceFileFilter));
		}
	} catch (Exception e) {
		throw new ConfigException(e);
	}
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:31,代碼來源:JLoProjectConfigurator.java

示例12: getParser

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
public JLoParser getParser(InputStream inputStream, View view) throws IOException {
    ANTLRInputStream input = new ANTLRInputStream(inputStream);
    JLoLexer lexer = new JLoLexer(input);
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    JLoParser parser = new JLoParser(tokens);
//    parser.addParseListener(new JLoParseListener());
    return parser;
  }
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:9,代碼來源:JLoModelFactory.java

示例13: setContainer

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
@Override
	public <T extends ViewPlugin> void setContainer(View view, Class<T> pluginInterface) {
		if(! (view.language() instanceof JLo)) {
			throw new ChameleonProgrammerException();
		}
		super.setContainer(view, pluginInterface);
		Java7 target = new Java7LanguageFactory().create();
		JavaView targetView = new JavaView(new LazyRootNamespace(), target);
//		target.setPlugin(Syntax.class, new JLoSyntax()); // DEBUG for viewing the intermediate steps, we attach the JLo syntax.
		_translator = new JLoToJava8Translator(view(), targetView);
	}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:12,代碼來源:JLoBuilder.java

示例14: view

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
public View view() {
	return project().views().get(0);
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:4,代碼來源:CommandLineTool.java

示例15: JavaProjectConfiguration

import org.aikodi.chameleon.workspace.View; //導入依賴的package包/類
public JavaProjectConfiguration(View view, FileDocumentLoaderFactory inputSourceFactory) throws ConfigException {
	super(view, inputSourceFactory);
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:4,代碼來源:JavaProjectConfiguration.java


注:本文中的org.aikodi.chameleon.workspace.View類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。