本文整理汇总了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;
}
示例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())
);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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"));
}
示例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;
}
示例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()));
}
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例14: view
import org.aikodi.chameleon.workspace.View; //导入依赖的package包/类
public View view() {
return project().views().get(0);
}
示例15: JavaProjectConfiguration
import org.aikodi.chameleon.workspace.View; //导入依赖的package包/类
public JavaProjectConfiguration(View view, FileDocumentLoaderFactory inputSourceFactory) throws ConfigException {
super(view, inputSourceFactory);
}