1. Put the following log4j.properties file at root directory at the Eclipse JUnit project

####################################
# Categories & Levels
####################################
#For develop
log4j.rootCategory=DEBUG, ConApp, FileApp 

####################################
# Appender
####################################

# ConApp is set to be a ConsoleAppender
log4j.appender.ConApp=org.apache.log4j.ConsoleAppender
log4j.appender.ConApp.layout=org.apache.log4j.PatternLayout
log4j.appender.ConApp.layout.ConversionPattern=%d [%t] %-5p %l - %m%n

# FileApp is to create log-file using FileAppender
log4j.appender.FileApp=org.apache.log4j.FileAppender
log4j.appender.FileApp.File=./test.log
log4j.appender.FileApp.ImmediateFlush=true
log4j.appender.FileApp.Append=false
log4j.appender.FileApp.layout=org.apache.log4j.PatternLayout
log4j.appender.FileApp.layout.ConversionPattern=%d [%t] %-5p %l - %m%n

 

2. Add static initializer to JUnit test class

private static Logger gLogger = Logger.getLogger(TestClass.class);

static 
{
	PropertyConfigurator.configure("log4j.properties");
}

 

Run a JUnit test, then log4j log will be shown at console and file.

Posted by zennken

cat plugin_directory/plugin.properties

aboutText=blah blah\n\n\
Build Number: 

 

cat build.xml

...

<target name="before-pde-build">

<echo file="${buildDirectory}/plugins/plug_in_name/plugin.properties" message=${env.BUILD_NUMBER}" append="true"/>
</target>

Posted by zennken

http://lj4newbies.blogspot.kr/2008/03/using-classgetresource-load-resource.html



Posted by zennken
Input as follow at command line

rcp_applicatoin_name.exe -vmargs -Xmx1G

Set maximum Java heap size as 1GB  

Check allocated size:
System.out.println(java.lang.Runtime.getRuntime().maxMemory()); 
Posted by zennken

SWT Template

Eclipse/SWT 2010. 12. 8. 16:41
// Composite
Composite composite = new Composite(tabFolder, SWT.NONE); 
composite.setLayout(new GridLayout(1, false)); 
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
...
composite.setTabList(new Control[] {...});
Posted by zennken

ProgressMonitor with UI

Eclipse 2010. 8. 11. 18:03

IRunnableWithProgress runnable = new IRunnableWithProgress()
{

 public void run(IProgressMonitor progressMonitor)
 {

  ...
  progressMonitor.beginTask("Generating DDL(s)", count);

  ...

  }

  progressMonitor.done();
 }
};

progressMonitor.run(false, true, runnable); <- fork should be false

* void org.eclipse.jface.dialogs.ProgressMonitorDialog.run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException

If fork is set to false, the runnable will run in the UI thread and it is the runnable's responsibility to call Display.readAndDispatch() to ensure UI responsiveness.

Posted by zennken

Busy cursor in Eclipse

Eclipse 2010. 2. 5. 00:14
        Runnable runnable = new Runnable() {
            public void run() {
                // code to execute
            }
        };       
        org.eclipse.swt.custom.BusyIndicator.showWhile(null, runnable);

http://dev.eclipse.org/newslists/news.eclipse.tools/msg40810.html
Posted by zennken

Eclipse Remote Debugging

Eclipse 2009. 7. 31. 11:54
Debugging Target 
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 -jar xxx.jar

Eclipse
Debug as Remote Server
참조: http://www.eclipsezone.com/eclipse/forums/t53459.html

Posted by zennken
Run Configuration 기반에서 확인하기
1. 해당 프로젝트의 Run As -> Run Configuration-> Plug-ins에서 다음의 플러그인을 추가
org.eclipse.help.webapp
org.eclipse.help.ui

2.
같은 화면에서 Add Required Plug-ins를 실행한 후, Validate Plug-ins를 수행하여 필요한 플러그인들이 전부 들어 있는지 확인한다.

3. Eclipse내에서 Run Configuration기반으로 실행하여 (Ctrl + F11) 필요한 플러그인들이 모두 추가 되었는지 확인한다.

Product 기반에서 확인하기
4. 해당 프로젝트의 product화면에서 'Testing'항목에서 Synchronize를 시킨 후, Lauch an Eclipse application을 실행하여 빠진 플러그인이 없는 지 확인한다.

5. 빠진 플러그인들이 있으면 feature 프로젝트의 feature.xml-> Plug-ins에 추가한뒤, Dependencies화면에서 'Compute'를 수행한다.

6. 4번항목을 다시 수행하여 문제가 있으면 5번을 다시 반복한다. 문제가 없으면 Product를 Export시킨다.



Posted by zennken
RCP에 추가되는 Plugin에 Help를 추가

1. Pluing.xml -> Extensions -> "Add" -> Extension Wizards -> Help Content -> Primary 선택
2. Plugin.xml -> Build -> html & help관련 xml들을 추가한다.
Posted by zennken
12

zennken

달력