<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dreams of Upul &#187; Uncategorized</title>
	<atom:link href="http://www.iroshan.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iroshan.net</link>
	<description>All About Me &#124; සියල්ල මම ගැනමයි..</description>
	<lastBuildDate>Wed, 21 Apr 2010 17:37:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SWT Browser Widget with Mozilla (SWT.MOZILLA)</title>
		<link>http://www.iroshan.net/uncategorized/swt-browser-widget-with-mozilla-swt-mozilla/</link>
		<comments>http://www.iroshan.net/uncategorized/swt-browser-widget-with-mozilla-swt-mozilla/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 16:39:01 +0000</pubDate>
		<dc:creator>Iroshan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.iroshan.net/?p=18</guid>
		<description><![CDATA[We can use browser inside our java application with SWT browser widget. We can load external HTML pages or websites into our applications using it. Normal way to initialize browser widget in your application is following. Browser browser = new Browser(shell, SWT.NONE); This will create a widget with OS specific browser instance. If you are [...]]]></description>
			<content:encoded><![CDATA[<p>We can use browser inside our java application with SWT browser widget. We can load external HTML pages or websites into our applications using it.</p>
<p>Normal way to initialize browser widget in your application is following.</p>
<p><span style="font-family:Courier New; font-size:10pt"><span style="color:black">Browser browser = </span><span style="color:#7f0055"><strong>new</strong></span><span style="color:black"> Browser(shell, SWT.</span><span style="color:#0000c0"><em>NONE</em></span><span style="color:black">); </span></span></p>
<p><span style="color:black">This will create a widget with OS specific browser instance. If you are in windows, Internet Explorer will be your browser host. For Linux default is Mozilla. Personally I don&#8217;t like IE much. And there&#8217;s a way to load Mozilla to SWT browser widget. Other than that there&#8217;s another advantage with using Mozilla, By using Mozilla if you right click nothing will happen inside the application. With IE, users can detect we are using HTML page inside the application. That&#8217;s by right click will show the browser specific context menu. Other than that using Mozilla we can get powerful features from Mozilla and XUL runner runtime. Powerful feature with browser widget is we can call JavaScript functions from Java as well as java functions from JavaScript. </span></p>
<p><span style="color:black">There are few steps you have to achieve this goal. </span></p>
<ul>
<li>
<div><span style="color:black">Download and install XUL runner. </span></div>
<ul>
<li><span style="color:black">I&#8217;ve downloaded the SDK version. This includes runtime version and additional files needed for development purposes.<br />
</span><a href="http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.2/sdk/" target="_blank">http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.2/sdk/</a><span style="color:black"><br />
</span></li>
<li><span style="color:black">Installation instructions can be found at following<br />
</span><a href="https://developer.mozilla.org/en/XULRunner_1.9.1_Release_Notes" target="_blank">https://developer.mozilla.org/en/XULRunner_1.9.1_Release_Notes</a><span style="color:black"><br />
</span></li>
<li><span style="color:black">It mentioned to run following command in order to install XUL Runner.<br />
<span style="font-family:Courier New; font-size:10pt">xulrunner.exe &#8211;register-global</span><br />
</span></li>
<li><span style="color:black">But we can&#8217;t see anything happening. Actually it&#8217;s registering some variables in windows registry. Run <span style="font-family:Courier New; font-size:10pt">regedit</span> and see whether following variables are set in your registry.<br />
</span></li>
<li><span style="color:black">HKEY_LOCAL_MACHINE/Software/mozilla.org/GRE (for register global)<br />
</span></li>
<li><span style="color:black">HKEY_CURRENT_USER/Software/mozilla.org/GRE (for register user)<br />
</span></li>
<li><a href="https://developer.mozilla.org/en/GRE_Registration" target="_blank">https://developer.mozilla.org/en/GRE_Registration</a><span style="color:black"><br />
</span></li>
</ul>
</li>
<li><span style="color:black">Now you can start with Development of SWT Browser application.<br />
Just change <span style="font-family:Courier New; font-size:10pt">SWT.</span></span><span style="color:#0000c0; font-family:Courier New; font-size:10pt"><em>NONE</em></span><span style="color:black"> to <span style="font-family:Courier New; font-size:10pt">SWT.</span></span><span style="color:#0000c0; font-family:Courier New; font-size:10pt"><em>MOZILLA </em></span>to load Mozilla into the widget.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.iroshan.net/uncategorized/swt-browser-widget-with-mozilla-swt-mozilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Aspects</title>
		<link>http://www.iroshan.net/uncategorized/introduction-to-aspects/</link>
		<comments>http://www.iroshan.net/uncategorized/introduction-to-aspects/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:36:11 +0000</pubDate>
		<dc:creator>Iroshan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.iroshan.net/?p=3</guid>
		<description><![CDATA[Application-context.xml &#60;?xml version="1.0" encoding="UTF-8"?&#62; &#60;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&#62; &#60;aop:aspectj-autoproxy /&#62; &#60;bean name="firstAspect"/&#62; &#60;bean name="helloWorld"/&#62; &#60;/beans&#62; FirstAspect.java package com.iroshan.aop.aspects; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; @Aspect public class FirstAspect { @Pointcut("execution(* sayHello(..))") public void helloPointCut(){ } @Before("helloPointCut()") public void helloAdvice(){ System.out.println("Hello There!!!"); } @Around("helloPointCut()") public Object helloAroundAdvice(ProceedingJoinPoint pjp) [...]]]></description>
			<content:encoded><![CDATA[<h4><span style="text-decoration: underline;">Application-context.xml</span></h4>
<pre class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans
 xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

http://www.springframework.org/schema/aop

 http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&gt;

 &lt;aop:aspectj-autoproxy /&gt;

 &lt;bean name="firstAspect"/&gt;

 &lt;bean name="helloWorld"/&gt;

&lt;/beans&gt;</pre>
<p><span id="more-3"></span></p>
<h4>FirstAspect.java</h4>
<pre class="java">package com.iroshan.aop.aspects;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class FirstAspect {

 @Pointcut("execution(* sayHello(..))")
 public void helloPointCut(){

 }

 @Before("helloPointCut()")
 public void helloAdvice(){
 System.out.println("Hello There!!!");
 }

 @Around("helloPointCut()")
 public Object helloAroundAdvice(ProceedingJoinPoint pjp) throws Throwable{
 Object retVal = pjp.proceed();
 System.out.println(retVal);
 return 2;
 }

}</pre>
<h4>HelloWorld.java</h4>
<pre class="java">package com.iroshan.aop;

public class HelloWorld {

public int sayHello() {
    System.out.println("Hello World");
    return 1;
}

}</pre>
<h4>Main.java</h4>
<pre class="java">package com.iroshan.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

public static void main(String[] args) {
   ApplicationContext factory = new ClassPathXmlApplicationContext("Application-context.xml");
   HelloWorld helloWorld = (HelloWorld) factory.getBean("helloWorld");
   System.out.println(helloWorld.sayHello());
}

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.iroshan.net/uncategorized/introduction-to-aspects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

