Skip to content

Instantly share code, notes, and snippets.

View samueltcsantos's full-sized avatar

Samuel Santos samueltcsantos

  • Signove Tecnologia S/A
  • Campina Grande, PB-Brazil
View GitHub Profile
@samueltcsantos
samueltcsantos / functions.py
Created April 18, 2014 17:35
Funções em Python
'''
Created on 18/04/2014
@author: Samuel T. C. Santos
Criando funcoes em Python
'''
def soma(a, b):
return a + b
@samueltcsantos
samueltcsantos / conditional.py
Created April 18, 2014 17:59
Estrutura condicional em Python
'''
Created on 18/04/2014
@author: Samuel T. C. Santos
Estrutura de descisao em Python if-else
'''
x = 10
@samueltcsantos
samueltcsantos / SampleHandler.java
Last active August 29, 2015 14:00
Listando todos os projetos do workspace
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;
@samueltcsantos
samueltcsantos / SampleHandler.java
Last active August 29, 2015 14:00
Criando um IJavaProject
/**
* 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 {
@samueltcsantos
samueltcsantos / SampleHandler.java
Created April 19, 2014 19:35
Pegar todos os pacotes de um Projeto do Workspace
/**
* get all packages in the project including the '.jars' packages
*
* @param javaProject
* @return
* @throws JavaModelException
*/
private IPackageFragment [] getProjectPackages(IJavaProject javaProject) throws JavaModelException{
@samueltcsantos
samueltcsantos / SampleHandler.java
Created April 19, 2014 20:31
Pegar todas as Unidade de Compilação em um pacote.
/**
* 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{
@samueltcsantos
samueltcsantos / SampleHandler.java
Created April 19, 2014 20:57
Como acessar todos os métodos dentro de uma classe.
/**
* 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{
@samueltcsantos
samueltcsantos / SampleHandler.java
Created April 19, 2014 21:24
Acessando o nomes dos pacotes com código fonte.
/**
* 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();
@samueltcsantos
samueltcsantos / SampleHandler.java
Created April 19, 2014 21:54
Pegar um projeto específico por nome
/**
* 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();
@samueltcsantos
samueltcsantos / SampleHandler.java
Created April 19, 2014 22:12
Como listar ao nomes de todos os métodos em um projeto.
/**
* 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 {