Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT API only Jar
SWT API only Jar [message #1708031] Fri, 11 September 2015 14:46 Go to next message
Florian Latifi is currently offline Florian LatifiFriend
Messages: 3
Registered: September 2015
Junior Member
Hello Guys,

I am developing a framework which uses SWT, and would like to build it without depending on platform relevant stuff. Other projects, which use my framework, should take care of the platform specific dependencies.

When I look at the Eclipse release site, I only find platform specific SWT libraries, which all contain api relevant java classes I need for my framework. So I am asking, why Eclipse doesn't provide something like a API only jar file.

Best regards.
Re: SWT API only Jar [message #1708121 is a reply to message #1708031] Mon, 14 September 2015 05:37 Go to previous messageGo to next message
Niraj Modi is currently offline Niraj ModiFriend
Messages: 47
Registered: November 2013
Member
Hi Florian,
Do you plan to port SWT to a different UI framework ? What's the underlying framework are you targeting ?
Re: SWT API only Jar [message #1708177 is a reply to message #1708031] Mon, 14 September 2015 11:48 Go to previous messageGo to next message
Florian Latifi is currently offline Florian LatifiFriend
Messages: 3
Registered: September 2015
Junior Member
Hello Niraj and thanks for your reply.

We are currently creating a 2d rpg game and want to use swt for our map editor.
We are developing a small framework, which is used by our game and our map editor.
This framework has some dependencies to swt.

And here is our problem:
We want our framework to be without any platform relevant dependencies, because it's not a standalone application.
The framework is used by the game and the map editor,
we want THEM to be built for different platforms with the platform relevant dependencies, and not our framework.

Eclipse only provides platform dependent bundles of swt.
There is no api-only bundle which we could use.

Well, we could simply download a specific platform dependent bundle and just extract the swt-api-classes that we need.
The question is, are these classes in all these different bundles the same?

Best regards,
Florian Latifi

[Updated on: Mon, 14 September 2015 11:49]

Report message to a moderator

Re: SWT API only Jar [message #1708314 is a reply to message #1708177] Tue, 15 September 2015 12:32 Go to previous messageGo to next message
Niraj Modi is currently offline Niraj ModiFriend
Messages: 47
Registered: November 2013
Member
Hi Florian,
There is no such thing like platform-independent swt-api-classes.
Suggest you to have a look at the existing SWT sources.. you can setup SWT-dev environment: https://www.eclipse.org/swt/git.php

Once you have a setup in place.. you will see Widgets being implemented for various platforms like Windows, Cocoa for MAC, GTK2/GTK3 for Linux
Note:- SWT have two categories of widgets Native(platform dependent) and Custom Widgets(they consume native widgets and have common implementation for all platforms)

So if you plan to port SWT for your UI framework, you need to have widget classes written using your UI framework.
Re: SWT API only Jar [message #1708737 is a reply to message #1708314] Sat, 19 September 2015 16:34 Go to previous message
Florian Latifi is currently offline Florian LatifiFriend
Messages: 3
Registered: September 2015
Junior Member
Hello Niraj,

thanks for pointing me to the git repo.
I managed to take a look at the sources and finally I see,
why it's impossible to have something like a api-only package of swt.

For each platform, there are different sources of the same classes.
I only took a look at the Widget.java sources in all platform boundles, but it's the same for all other files, they are either the same or slightly different, when it comes to the content.

I am just a little bit curious about this code design,
what benefit would it have to write the same classes for each platform in a different way
or having copies of multiple classes, which may be just identical.

Instead, you would write something like abstract classes or interfaces and implement them for each platform differently. That's basically how they teach you object oriented programming in java, isn't it?.

Best regards
Florian Latifi

[Updated on: Sat, 19 September 2015 16:36]

Report message to a moderator

Previous Topic:Realign ragged-left TableEditor after update
Next Topic:Adding Multiple Images to ExpandItem
Goto Forum:
  


Current Time: Mon Dec 11 09:40:38 GMT 2017

Powered by FUDForum. Page generated in 0.01823 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software