This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on 18/04/2014 | |
@author: Samuel T. C. Santos | |
Criando funcoes em Python | |
''' | |
def soma(a, b): | |
return a + b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on 18/04/2014 | |
@author: Samuel T. C. Santos | |
Estrutura de descisao em Python if-else | |
''' | |
x = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jdt.info.handlers; | |
import org.eclipse.core.commands.AbstractHandler; | |
import org.eclipse.core.commands.ExecutionEvent; | |
import org.eclipse.core.commands.ExecutionException; | |
import org.eclipse.core.resources.IProject; | |
import org.eclipse.core.resources.IWorkspace; | |
import org.eclipse.core.resources.IWorkspaceRoot; | |
import org.eclipse.core.resources.ResourcesPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show the project name and create a IJavaProject object. | |
* | |
* @see {https://github.com/samueltcsantos/eclipse-jdt} | |
* | |
* @param project | |
* @throws CoreException | |
*/ | |
private IJavaProject createIJavaProject(IProject project) throws CoreException { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* get all packages in the project including the '.jars' packages | |
* | |
* @param javaProject | |
* @return | |
* @throws JavaModelException | |
*/ | |
private IPackageFragment [] getProjectPackages(IJavaProject javaProject) throws JavaModelException{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get all compilation Unit in the package. | |
* | |
* @see {https://github.com/samueltcsantos/eclipse-jdt} | |
* | |
* @param myPackage | |
* @return | |
* @throws JavaModelException | |
*/ | |
private ICompilationUnit [] getCompilationUnits(IPackageFragment myPackage) throws JavaModelException{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get all types in the Compilation Unit. | |
* | |
* @see {https://github.com/samueltcsantos/eclipse-jdt} | |
* | |
* @param unit | |
* @return | |
* @throws JavaModelException | |
*/ | |
private IType[] getITypes(ICompilationUnit unit) throws JavaModelException{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* the command has been executed, so extract extract the needed information | |
* from the application context. | |
* | |
* @see {https://github.com/samueltcsantos/eclipse-jdt} | |
* | |
*/ | |
public Object execute(ExecutionEvent event) throws ExecutionException { | |
IWorkspace workspace = ResourcesPlugin.getWorkspace(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get a specific project by project name. | |
* | |
* @see {https://github.com/samueltcsantos/eclipse-jdt} | |
* | |
* @param projectName | |
* @return | |
*/ | |
public IProject getProject(String projectName){ | |
// here root is IWorkspaceRoot from ResourcesPlugin.getWorkspace().getRoot(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* the command has been executed, so extract extract the needed information | |
* from the application context. | |
* | |
* @see {https://github.com/samueltcsantos/eclipse-jdt} | |
* | |
*/ | |
public Object execute(ExecutionEvent event) throws ExecutionException { | |