| JSP <jsp:useBean ... /> tag: Difference between 'class' and 'type' |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Printing Frames With JavascriptI apologize if this is the wrong group for this but I have looked for
an answer with no luck. I have the following frame setup on a site I
am working on:
http://img98.imageshack.us/img98/6238/frameprint1lr.jpg
I want to add a java print button in frame 3 that will then print
frames 3, 4, and 5 when clicked (preferably as laid out on screen in
landscape mode). Is something like this possible?
Thanks.
- 1
- New Mobile Phone forumHello Guys,
This is an awsome place, its nice to be here
Thanks,
Rajen
http://www.mobileuserforum.info
Ps. i run this generic mobile site called
http://www.mobileuserforum.info, we are looking for moderators, please
get in touch with me if any one of you is interested.
- 2
- What is a type error?Marshall <email***@***.com> wrote:
+---------------
| Joachim Durchholz wrote:
| > Actually SQL has references - they are called "primary keys", but they
| > are references nevertheless.
|
| I strongly object; this is quite incorrect. I grant you that from the
| 50,000 foot level they appear identical, but they are not.
+---------------
Agreed. The only thing different about "primary" keys from any other
key is uniqueness -- a selection by primary key will return only one
record. Other than that constraint, many databases treat them exactly
the same as non-primary keys [e.g., can form indexes on them, etc.].
+---------------
| To qualify as a reference, there need to be reference and dereference
| operations on the reference datatype; there is no such operation is SQL.
+---------------
Not in "ANSI SQL92", say, but there might be in most SQL databases!
[See below re OIDs. Also, SQL:1999 had a "REF" type that was essentially
and OID.]
+---------------
| Would you say the relational algebra has references?
+---------------
Don't confuse "SQL" & "relational algebra"!! You'll get real
relational algebraists *way* bent out of shape if you do that!
+---------------
| > (Some SQL dialects also offer synthetic "ID" fields that are
| > guaranteed to remain stable over the lifetime of a record.
|
| Primary keys are updatable; there is nothing special about them.
+---------------
I think he's probably talking about "OIDs" (object IDs). Most
current SQL-based databases provide them, usually as a normally-
invisible "system column" that doesn't show up when you say
"SELECT * FROM", but that *does* appear if you say "SELECT oid, *",
and may be used as a "primary" key even on tables with no actual
primary key:
rpw3=# select * from toy limit 4;
c1 | c2 | c3 | upd
--------+-------+--------------------------------+-----
fall | tape | My Favorite Thanksgiving | 16
xmas | book | My Favorite Christmas | 2
xmas | video | The Grinch who Stole Christmas | 4
summer | book | Unusual 4ths of July | 17
(4 rows)
rpw3=# select oid, * from toy limit 4;
oid | c1 | c2 | c3 | upd
-------+--------+-------+--------------------------------+-----
19997 | fall | tape | My Favorite Thanksgiving | 16
19998 | xmas | book | My Favorite Christmas | 2
19999 | xmas | video | The Grinch who Stole Christmas | 4
20000 | summer | book | Unusual 4ths of July | 17
(4 rows)
rpw3=# select * from toy where oid = 19998;
c1 | c2 | c3 | upd
------+------+-----------------------+-----
xmas | book | My Favorite Christmas | 2
(1 row)
rpw3=# insert into toy values ('fall','book','Glory Road');
INSERT 32785 1
rpw3=# select oid, * from toy where oid = 32785;
oid | c1 | c2 | c3 | upd
-------+------+------+------------+-----
32785 | fall | book | Glory Road | 21
(1 row)
rpw3=#
See <http://www.postgresql.org/docs/8.1/static/datatype-oid.html>
for how PostgreSQL treats OIDs [including some critical limitations].
-Rob
-----
Rob Warnock <email***@***.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
- 4
- cglib/asm NoClassDefFoundErrorI'm having trouble running the cglib sample KeySample
http://cglib.sourceforge.net/xref/samples/KeySample.html. It compiles
fine, but when I try to run it, I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/
objectweb/asm/Type
at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.java:180)
at net.sf.cglib.core.KeyFactory.<clinit>(KeyFactory.java:66)
at Test.main(Test.java:8)
To ensure asm.jar is definitely in the classpath, I'm running it as:
java -classpath .;$JAVA_HOME/lib;$CGLIB_LIB/cglib-2.1_3.jar;$CGLIB_LIB/
asm.jar;$CGLIB_LIB/aspectwerkz-core-0.10.RC1.jar;$CGLIB_LIB/ant.jar;
$CGLIB_LIB/asm-attrs.jar;$CGLIB_LIB/asm-util.jar;$CGLIB_LIB/jarjar.jar;
$CGLIB_LIB/junit.jar KeySample
The call in net.sf.cglib.core.KeyFactory which is triggering this is:
private static final Type KEY_FACTORY =
TypeUtils.parseType("net.sf.cglib.core.KeyFactory");
The call at net.sf.cglib.core.TypeUtils.parseType is:
public static Type parseType(String s) {
return Type.getType(map(s));
}
map is a private method which effectively transforms the input into
"L"+s.replace('.', '/'))+";" (i.e. "Lnet/sf/cglib/core/KeyFactory;").
I've traced through this with Eclipse, so I'm absolutely certain that
this is what's being passed to Type.getType. Based on the exception
and my trace, I don't think it's getting as far as calling
Type.getType, though.
If I add the lines:
org.objectweb.asm.Type t = Type.getType("Lnet/sf/cglib/core/
KeyFactory;");
System.out.println(t.getClassName());
to the sample code, those lines execute properly (i.e. it prints
"net.sf.cglib.core.KeyFactory"), but then it throws the exception
above.
The fun part is that I get the same result if I re-compile the
original sample code and run with the no-dependency version of cglib:
java -classpath .:$JAVA_HOME/lib:$CGLIB_LIB/cglib-nodep-2.1_3.jar
KeySample
I suspect that there's something truly screwed up with my environment,
but I haven't seen any other overt misbehavior like this. Any ideas?
- 5
- Print via Command LineHello NG.
I'm trying to write a tool which is able to print a PostScript documents via
the command line. The call I'm making is the following:
String s = "copy /b " + filename + " lpt1:";
rt.exec(s);
This is commented by the interpreter as follows:
java.io.IOException: CreateProcess: copy /b
J:\Tmp\KyoceraMita\PostScript\Philipp.prn.tmp lpt1: error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at PrintPostScript.print(PrintPostScript.java:82)
at PrintPostScript.main(PrintPostScript.java:38)
Error = 2 means, that the file or something else is missing. The problem is:
The same command typed into my command line (I'm using W2k3) produces the
desired result. What am I doing wrong? Thanks in advance,
Philipp Ciechanowicz
- 5
- SQL Server 2000 -> JDBC Date TimeSeems to me that the problems is in the translation. I recommend that you
do a cast in the request. I.E. Cast '15/07/2005 AS DATETIME)
mlb
- 6
- Conditional CompileTor Iver Wilhelmsen <email***@***.com> wrote:
> Graham Matthews <email***@***.com> writes:
>
> > Try compiling the above code on a non OS-X platform. It will complain
> > that it can't find classes referenced in the "use_an_apple_extension"
> > bit.
>
> Unless it's a lot of code, use reflection (though you lose the
> compile-time checks). Or invoke a class you compile once on the Mac
> and ship as a .class for inclusion when building later.
I have been waiting for someone to suggest reflection. The cost of
using reflection is that I lose static typing. Moreover its a heavy
weight way of getting conditional compilation don't you think. To
my mind a simple conditional compilation scheme would be far
more desirable.
graham
- 8
- Distinct ID Number Per Object?I have a case where I'll need distinct and printable names to use in a
reference table. I'd like to make it so each object, whether it's of the
same class as any other object or not, can produce a distinct number. It
looks like if I get the hashcode for any object, the JVM attempts to give
each object a unique hashcode, but it doesn't seem to guarantee it.
Is there any way to get a unique string or number for each object that is
created by a particular JVM?
Thanks!
Hal
- 9
- 9
- does not opening websites: double loading pictures, helpHello
My internet explorer does not explore some websites. It looks like it
download pictures 2 times. In majority it works - j can see website after
double downloading but sometimes it shows me the web for a moment and then
everything dissapeares and j see white surface. J think it is sure it has
opened it.
HELP ME
How to eliminate this double loading and not showing websites?
And how to install java? it is imposible for it too. ?
Maciej
- 13
- SWT&JFaceHi,
is there any method to add WizardDialog to windows taskbar?
In general, dialogs don't appear on taskbar, but maybe anyone knows
some trick.
yarecki
- 14
- "Compiler" variablesHi,
Is there in java a possibility to define "compiler"-variables, for
example to except some code parts from the compilation?
If so, how does it work?
--
Oliver Hirschi
http://www.FamilyHirschi.ch
- 14
- XML tags in JSPHi,
I need to parse and transform xml in a jps. I have un variable that is
an InputStream that contains the XML.
I tried standard library and xtags library with no luck.
<c:out value="${eo.repositoryItem.dataSource.inputStream}" /> show me
that it is an inputStream
anf I tried
<xtags:parse reader="${eo.repositoryItem.dataSource.inputStream}" />
xtags version
<x:parse xml="${eo.repositoryItem.dataSource.inputStream}" /> jstl version
What's wrong ?
thanks
Frederic
- 15
- JTable selectHello,
Can anybody explain me how I can retrieve the value of a certain
clicked cell of a JTable?
thx
pat
- 16
- Message IDsRoedy Green wrote:
> Java mail generates message ids like this:
> <25116828.1067897095828.JavaMail.Administrator@roedy>
>
> Eudora like this:
> <email***@***.com>
>
> Just what are these?
>
> 1. are they a hash?
>
> 2. are they supposed to be globally unique.
>
> 3. are they supposed to be the same if you send the same mail twice?
>
> 4. are they a timestamp?
>
From the RFC822 (http://www.faqs.org/rfcs/rfc822.html) is says that:
1) Message-ID is part of the optional-field.
2) chapter 4.6.1:
>>>
4.6.1. MESSAGE-ID / RESENT-MESSAGE-ID
This field contains a unique identifier (the local-part
address unit) which refers to THIS version of THIS message.
The uniqueness of the message identifier is guaranteed by the
host which generates it. This identifier is intended to be
machine readable and not necessarily meaningful to humans. A
message identifier pertains to exactly one instantiation of a
particular message; subsequent revisions to the message should
each receive new message identifiers.
<<<
And each mail client I have used generate a some what unique version
(content and formatting) of this field. I have only seen it used for
thread display as no one seems to heavily rely on it.
You can look into the JavaMail source (part of J2E source) for the
JavaMail generated one.
Minh Tran-Le.
|
| Author |
Message |
Sean Aitken

|
Posted: 2004-6-3 23:11:00 |
Top |
java-programmer, JSP <jsp:useBean ... /> tag: Difference between 'class' and 'type'
Hello,
I'm trying to gain a better understanding of the included tag libraries
with JSP. The <jsp:useBean tag seems farily straightforward, in that it
sets a page variable from an object in any scope, with a variety of options.
I see examples listed that interchange the 'class' and 'type' attribute,
but to me it's not real clear as to their distinction. Can anyone
explain their difference?
One thing I have noticed is that if I don't yet have a variable declared
in the given scope, using the 'type' attribute causes an exception to be
thrown, whereas the 'class' attribute does not. It seems that when I
specify "class", it actually creates a new instance of the specified
variable / bean.
Thanks!!
-Sean
|
| |
|
| |
 |
John C. Bollinger

|
Posted: 2004-6-4 3:12:00 |
Top |
java-programmer >> JSP <jsp:useBean ... /> tag: Difference between 'class' and 'type'
Sean Aitken wrote:
> Hello,
>
> I'm trying to gain a better understanding of the included tag libraries
> with JSP. The <jsp:useBean tag seems farily straightforward, in that it
> sets a page variable from an object in any scope, with a variety of
> options.
>
> I see examples listed that interchange the 'class' and 'type' attribute,
> but to me it's not real clear as to their distinction. Can anyone
> explain their difference?
The "class" attribute specifies the actual class of the bean instance.
The "type" attribute specifies the Java type by which the instance is
handled, which may be a superclass of the bean's class or an interface
implemented by it.
> One thing I have noticed is that if I don't yet have a variable declared
> in the given scope, using the 'type' attribute causes an exception to be
> thrown, whereas the 'class' attribute does not. It seems that when I
> specify "class", it actually creates a new instance of the specified
> variable / bean.
If there is not already an attribute of the specified id in the
specified scope then useBean attempts to create one. It can only do
that if it knows what class to instantiate. If there _is_ already a
matching attribute then useBean attempts to use it; it will be cast to
the type specified by "type" if that is provided, or to the type
specified by "class" otherwise.
You would benefit from reading the specifications for these behaviors.
The JSP spec is available from Sun as a free download, and it describes
all of this.
--
John Bollinger
email***@***.com
|
| |
|
| |
 |
Sean Aitken

|
Posted: 2004-6-4 3:25:00 |
Top |
java-programmer >> JSP <jsp:useBean ... /> tag: Difference between 'class' and 'type'
Perfect!
That explanation makes sense. I actually spent about 20 minutes reading
through the applicable portions of the JSP spec PDF before making this
post. They seemed dodgy on the issue. Your explanation made perfect
sense. Guess I need to read better next time. :0)
Thanks!
-s-
John C. Bollinger wrote:
> Sean Aitken wrote:
>
>> Hello,
>>
>> I'm trying to gain a better understanding of the included tag
>> libraries with JSP. The <jsp:useBean tag seems farily
>> straightforward, in that it sets a page variable from an object in any
--snip--
|
| |
|
| |
 |
Alex Hunsley

|
Posted: 2004-10-21 19:36:00 |
Top |
java-programmer >> JSP <jsp:useBean ... /> tag: Difference between 'class' and 'type'
Sean Aitken wrote:
> Perfect!
>
> That explanation makes sense. I actually spent about 20 minutes reading
> through the applicable portions of the JSP spec PDF before making this
> post. They seemed dodgy on the issue. Your explanation made perfect
> sense. Guess I need to read better next time. :0)
>
> Thanks!
> -s-
Hi Sean
Could you plase bottom-post, rather than top posting? It makes threads
much more easy to follow.
More info here:
http://www.cs.tut.fi/~jkorpela/usenet/brox.html
alex
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- What's the proper way to use SocketChannel.finishConnect()?What's the proper way to use SocketChannel.finishConnect()?
I've read the documentation but couldn't comprehend what is written for it.
I've seen examples where it is placed:
1a) Right after SocketChannel.connect() (without while loop)
SocketChannel sc = SocketChannel.open();
sc.connect(...);
sc.finishConnect();
sc.configureBlocking(false);
sc.register(selector, SelectionKey.OP_READ);
1b) Right after SocketChannel.connect() (with while loop)
SocketChannel sc = SocketChannel.open();
sc.connect(...);
while (!sc.finishConnect()) {
}
sc.configureBlocking(false);
sc.register(selector, SelectionKey.OP_READ);
2a) When iterating the Selector.select() values (without while loop;
SocketChannel sc = SocketChannel.open();
sc.connect(...);
sc.configureBlocking(false);
sc.register(selector, SelectionKey.OP_CONNECT);
... {
if (sc.isConnectionPending()) {
sc.finishConnect();
}
sc.register(selector, SelectionKey.OP_READ);
}
...
2b) When iterating the Selector.select() values (with while loop)
SocketChannel sc = SocketChannel.open();
sc.connect(...);
sc.configureBlocking(false);
sc.register(selector, SelectionKey.OP_CONNECT);
... {
if (sc.isConnectionPending()) {
while (!sc.finishConnect()) {
}
}
sc.register(selector, SelectionKey.OP_READ);
}
...
- 2
- [ANN] Luxor XUL Standard Widget Toolkit (SWT) Layout Pack Now LiveHi,
I've uploaded the Luxor *Standard* Widget Toolkit (SWT) Layout
package that shows you how to turn SWT layout managers such as
FillLayout, GridLayout and others into easy-to-use XUL tags that you
can use in addition to the built-in XUL box layout system.
This preview includes XUL tags for
* FillLayout
* RowLayout
* GridLayout
* SashForm
Here are some examples to see what's it all about:
FillLayout In Action
--------------------
The FillLayout is mapped to the <fillbox> tag and you can use it like
any other XUL box. Example:
<fillbox>
<label value="Instructions:" />
<label value="1. Fill in your name" />
<label value="2. Fill in your age" />
<label value="3. Fill in your gender" />
<label value="4. Check the box for employment" />
<label value="5. Click on OK" />
</fillbox>
GridLayout In Action
--------------------
The GridLayout is mapped to the <gridbag> tag and the GridData is
mapped to the <griddata> tag. Example:
<gridbag columns="3">
<button label="B1" />
<button label="Wide Button 2" />
<griddata rowspan="2" fill="MAX">
<button label="Button 3" />
</griddata>
<button label="B4" />
<button label="Button 5" />
</gridbag>
SashForm In Action
------------------
The SashForm is mapped to the <splitbox> tag. Example:
<splitbox id="splitbox3">
<button label="One" />
<button label="Two" />
<splitbox orient="vert">
<button label="One" />
<button label="Two" />
<button label="Three" />
</splitbox>
</splitbox>
and so on and so forth
You can grab a copy a the luxor-contrib site @
http://sourceforge.net/project/showfiles.php?group_id=64067 (look for
the swt-layout) package.
Enjoy.
- Gerald
PS: For more info check out the Luxor Website @
http://luxor-xul.sourceforge.net
If you want to discuss the Luxor SWT package please join the
luxor-xul-user mailinglist @
http://lists.sourceforge.net/lists/listinfo/luxor-xul-user
For more info about SWT (Standard Widget Toolkit) check out the
website @ http://www.eclipse.org/swt
- 3
- Beware of disabled ActionHi !
just a note to warn you about some javax.swing.AbstractAction problem
My GUI dispays a JButton.
depending on the user's state, I do a setAction(AAction)
or a setAction(BAction).
AAction and BAction each extend AbstractAction and possess their own icon
(ImageIcon).
Here is a sample scenario :
1) button.setAction(AAction)
2) AAction.setEnabled(false)
3) button.setAction(BAction)
4) BAction.setEnabled(false)
the result of this is : the Action linked to the button is BAction as
expected, and the icon is...AAction's disabled icon (original icon greyed).
The only workaround I've found is to do button.setDisabledIcon(null) before
any new setAction()
It seems that an AbstractAction doesn't possess a disabled icon on its own,
and relies on the JComponent's one.
The first time, 1) and 2) have the consequence of creating a disabled icon
for my button , which doesn't have any at the beginning.
Then, 3) and 4) won't change this disabled icon, because the button now has
one
Regards,
Arnaud
- 4
- [ANN] Excelsior JET 6.0 (AOT compiler) Supports Java SE 6Excelsior JET (http://www.excelsior-usa.com/jet.html) is a complete
Java SE 6 implementation enhanced with an Ahead-Of-Time (AOT)
compiler. It is certified Java Compatible on a number of Windows and
Linux platforms, including Windows Vista and RHEL 5.
http://www.excelsior-usa.com/jetlatest.html provides full information
on new features and improvements.
http://www.excelsior-usa.com/jetdleval.html has free trial downloads
available (registration is optional.)
http://www.excelsior-usa.com/jetfree.html offers a free license
to authors of non-commercial Java software.
- 5
- Packaging/version controlI'm developing a Swing program which I periodically update (change or
add classes or data files), weekly, to currently 2 people. The number of
people will eventually grow but the update frequency should decrease.
Currently, I'm putting the sources, classes, data files and a readme
file into a zip and sending it. The readme tells the users to either
compile or copy the classes over. There are ~25 .java files, ~75 .class
files and ~20 data files. This is time consuming, inconsistent and error
prone. I'm not using package statement or jars (currently). What are
people using and / or what would you recommend. - Thanks - Lou
- 6
- Java 5.0 Flood!Since J2SE 5.0 has just come out, I'd thought I'd post a some links and
highlights as written by the media around the internet.
---
** Sun ships Java upgrade, focuses on ease of use **
The next release is due out by early 2006
Highlights:
- "J2SE 5.0 is an important step for Java in its ongoing battle against
Microsoft Corp.'s .Net development environment", said Stephen O'Grady, an
analyst at RedMonk Inc. in Bath, Maine. "The streamlined start-up times and
a friendlier graphical user interface should be especially welcome additions
to Java users", he said.
"Particularly for Java applications on the client, it has taken a while for
them to start up," O'Grady said. "That has been a problem. Also, from a
user's perspective, [Sun] has updated the look and feel. It looks good. It's
cleaner, and it's more modern."
http://www.computerworld.com/developmenttopics/development/java/story/0,1080
1,96346,00.html?nas=APP-96346
---
** Sun Releases New Version of Java for Servers, Desktops **
Highlights:
- In addition, Austin said J2SE 5.0 will spark the creation of new tools for
developers, particularly new profiling and analysis tools. "We have a cool
technology called byte code insertion, so now you can profile in real-time."
J2SE 5.0 also enables developers to "pre-template" code, "so other analyzing
tools can read the metadata," he said.
http://www.eweek.com/article2/0,1759,1664580,00.asp
---
** A New Direction for Java **
Highlights:
- The result: "Java's beginning to wend its way into some pretty interesting
places," such as automobiles, said Schwartz. "I asked an automobile
manufacturer, 'What's the price at which, if you could sell online services
to the automobile, you could give away the automobile for free?' Without
batting an eye, that auto company's CFO said, '$220,'" Schwartz told his
JavaOne audience. "Now think about that. "Do you know a 17-year old who
would pay $5 to download a custom horn tone to his car? I do," he said.
- "It's not Sun thinking about putting services into an automobile, it's
Siemens and BMW," Schwartz said, returning to center stage after a
presentation in which a new BMW rolled out with an advanced Java-based
navigation and entertainment system.
http://www.eweek.com/article2/0,1759,1624150,00.asp
---
** Screenshots of J2SE 5.0 Look&Feels **
Windows XP File Chooser Dialog (from j5.0 beta)
http://java.sun.com/developer/technicalArticles/releases/j2se15/15art2.jpg
Redhat Linux File Open Dialog (from j5.0 beta)
http://java.sun.com/developer/technicalArticles/releases/j2se15/15art1.jpg
The new Ocean Theme
http://www.dubh.org/jdevimages/jdev_ocean_large.png
---
Comments on Synth
Synth is apparently a 'bare-bones' L&F designed specifically to allow
non-programmers to turn it into a custom L&F using simple XML. The article
"The Synth Look and Feel" in the next section gets more into the details.
An example XML file is also presented below. For an overview of the idea
behind Swing 5.0 see this article:
** Tiger on the Desktop **
http://weblogs.java.net/blog/chet/archive/2004/09/tiger_on_the_de_1.
** The Synth Look and Feel **
Highlights:
For the anxious, here's a quick example. The following XML code, taken from
example1.xml, defines a style named textfield and binds it to all text
fields in Synth. The result is that text fields look like the one in the
Motivation section.
<synth>
<style id="textfield">
<state>
<color value="white" type="BACKGROUND"/>
</state>
<imagePainter method="textFieldBorder" path="textfieldborder.png"
sourceInsets="5 6 6 7" paintCenter="false"/>
<insets top="5" left="6" bottom="6" right="7"/>
</style>
<bind style="textfield" type="region" key="TextField"/>
</synth>
Here's some code that loads the XML file into Synth and sets the current
look and feel to Synth:
SynthLookAndFeel laf = new SynthLookAndFeel();
laf.load(Example1.class.getResourceAsStream("example1.xml"),
Example1.class);
UIManager.setLookAndFeel(laf);
http://www.javadesktop.org/articles/synth/index.html )
---
l8r, Mike N. Christoff
- 7
- eclipse doesn't build?
Eclipse doesn't build right now, these seems to be gnome related...
Script started on Thu Apr 14 06:23:31 2005
bsd# make
===> Vulnerability check disabled, database not found
===> Extracting for eclipse-3.0.1_4
=> Checksum OK for eclipse/eclipse-sourceBuild-srcIncluded-3.0.1.zip.
===> eclipse-3.0.1_4 depends on executable: unzip - found
===> Patching for eclipse-3.0.1_4
===> Applying FreeBSD patches for eclipse-3.0.1_4
===> eclipse-3.0.1_4 depends on executable: ant - found
===> eclipse-3.0.1_4 depends on executable: zip - found
===> eclipse-3.0.1_4 depends on executable: unzip - found
===> eclipse-3.0.1_4 depends on executable: mozilla - found
===> eclipse-3.0.1_4 depends on file: /usr/local/jdk1.4.2/bin/java - found
===> eclipse-3.0.1_4 depends on executable: gmake - found
===> eclipse-3.0.1_4 depends on file: /usr/local/bin/intltool-extract - found
===> eclipse-3.0.1_4 depends on file: /usr/X11R6/libdata/pkgconfig/gnome-mime-data-2.0.pc - found
===> eclipse-3.0.1_4 depends on executable: pkg-config - found
===> eclipse-3.0.1_4 depends on shared library: esd.2 - found
===> eclipse-3.0.1_4 depends on shared library: atk-1.0.901 - found
===> eclipse-3.0.1_4 depends on shared library: gconf-2.5 - found
===> eclipse-3.0.1_4 depends on shared library: glib-2.0.600 - found
===> eclipse-3.0.1_4 depends on shared library: gnomevfs-2.1000 - found
===> eclipse-3.0.1_4 depends on shared library: gtk-x11-2.0.600 - found
===> eclipse-3.0.1_4 depends on shared library: art_lgpl_2.5 - found
===> eclipse-3.0.1_4 depends on shared library: bonobo-2.0 - found
===> eclipse-3.0.1_4 depends on shared library: bonoboui-2.0 - found
===> eclipse-3.0.1_4 depends on shared library: glade-2.0.0 - found
===> eclipse-3.0.1_4 depends on shared library: gnome-2.1000 - found
===> eclipse-3.0.1_4 depends on shared library: gnomecanvas-2.1000 - found
===> eclipse-3.0.1_4 depends on shared library: gnomeui-2.1000 - found
===> eclipse-3.0.1_4 depends on shared library: IDL-2.0 - found
===> eclipse-3.0.1_4 depends on shared library: xml2.5 - found
===> eclipse-3.0.1_4 depends on shared library: xslt.2 - found
===> eclipse-3.0.1_4 depends on shared library: linc.1 - found
===> eclipse-3.0.1_4 depends on shared library: ORBit-2.0 - found
===> eclipse-3.0.1_4 depends on shared library: pango-1.0.800 - found
===> Configuring for eclipse-3.0.1_4
Copying plugins/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_linux.properties into plugins/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_freebsd.properties
Copying plugins/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_linux_gtk.properties into plugins/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_freebsd_gtk.properties
Copying plugins/platform-launcher/library/motif/make_linux.mak into plugins/platform-launcher/library/motif/make_freebsd.mak
Copying assemble.org.eclipse.sdk.linux.motif.x86.xml into assemble.org.eclipse.sdk.freebsd.motif.x86.xml
Copying assemble.org.eclipse.sdk.linux.gtk.x86.xml into assemble.org.eclipse.sdk.freebsd.gtk.x86.xml
Copying plugins/org.eclipse.pde.source.linux.gtk.x86 into plugins/org.eclipse.pde.source.freebsd.gtk.x86
Copying plugins/org.eclipse.pde.source.linux.motif.x86 into plugins/org.eclipse.pde.source.freebsd.motif.x86
Copying plugins/org.eclipse.platform.source.linux.motif.x86 into plugins/org.eclipse.platform.source.freebsd.motif.x86
Copying plugins/org.eclipse.swt.motif/os/linux into plugins/org.eclipse.swt.motif/os/freebsd
Copying plugins/org.eclipse.jdt.source.linux.motif.x86 into plugins/org.eclipse.jdt.source.freebsd.motif.x86
Copying plugins/org.eclipse.platform.source.linux.gtk.x86 into plugins/org.eclipse.platform.source.freebsd.gtk.x86
Copying plugins/org.eclipse.jdt.source.linux.gtk.x86 into plugins/org.eclipse.jdt.source.freebsd.gtk.x86
Copying plugins/org.eclipse.update.core.linux into plugins/org.eclipse.update.core.freebsd
Copying plugins/org.eclipse.update.core.linux/os/linux into plugins/org.eclipse.update.core.freebsd/os/freebsd
Copying plugins/org.eclipse.core.resources.linux into plugins/org.eclipse.core.resources.freebsd
Copying plugins/org.eclipse.core.resources.linux/os/linux into plugins/org.eclipse.core.resources.freebsd/os/freebsd
Copying plugins/org.eclipse.swt.gtk/os/linux into plugins/org.eclipse.swt.gtk/os/freebsd
Copying plugins/platform-launcher/bin/linux into plugins/platform-launcher/bin/freebsd
Copying features/org.eclipse.platform/linux.motif into features/org.eclipse.platform/freebsd.motif
===> Building for eclipse-3.0.1_4
===> Building libswt.
cd "plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library" && \
/bin/sh ./build.sh && \
/bin/cp *.so ../../../../org.eclipse.swt.gtk/os/freebsd/x86/
gmake[1]: Entering directory `/usr/ports/java/eclipse/work/plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library'
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic -c swt.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic -c callback.c
cc -shared -fpic -o libswt-gtk-3063.so swt.o callback.o
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gtk+-2.0` -c os.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gtk+-2.0` -c os_structs.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gtk+-2.0` -c os_custom.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gtk+-2.0` -c os_stats.c
cc -shared -fpic `pkg-config --libs gtk+-2.0 gthread-2.0` -L/usr/X11R6/lib -lXtst -o libswt-pi-gtk-3063.so swt.o os.o os_structs.o os_custom.o os_stats.o
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags atk gtk+-2.0` -c atk.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags atk gtk+-2.0` -c atk_structs.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags atk gtk+-2.0` -c atk_custom.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags atk gtk+-2.0` -c atk_stats.c
cc -shared -fpic `pkg-config --libs atk gtk+-2.0` -o libswt-atk-gtk-3063.so swt.o atk.o atk_structs.o atk_custom.o atk_stats.o
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` -c gnome.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` -c gnome_structs.c
cc -O -Wall -DSWT_VERSION=3063 -DFREEBSD -DGTK -I/usr/local/jdk1.4.2/include -I/usr/local/jdk1.4.2/include/bsd -I/usr/local/jdk1.4.2/include/freebsd -I../../../Eclipse_SWT/common/library -I../../../Eclipse_SWT_PI/gtk/library -I/usr/X11R6/include -fpic `pkg-config --cflags gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` -c gnome_stats.c
cc -shared -fpic `pkg-config --libs gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` -o libswt-gnome-gtk-3063.so swt.o gnome.o gnome_structs.o gnome_stats.o
/usr/bin/ld: cannot find -lpopt
gmake[1]: *** [libswt-gnome-gtk-3063.so] Error 1
gmake[1]: Leaving directory `/usr/ports/java/eclipse/work/plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library'
gmake: *** [libswt] Error 2
*** Error code 2
Stop in /usr/ports/java/eclipse.
- 8
- IBM Java 6 pre-release on LinuxFor those who are interested to try the new IBM Linux JDK 6 (pre-release),
here's a direct link:
https://www14.software.ibm.com/iwm/web/cc/earlyprograms/ibm/java6/
Haven't tried it on FreeBSD myself.
Cheers,
Ernst
- 9
- Component inside JList not painting; now resolvedI have set up a JList to work with its own ListModel and
ListCellRenderer. The symptom, my component does not
display any text. That is the list box is
completely blank. From the debugging, I saw it displayed the desired
text. And, we saw that the list box scrolled when there was more data
than can be displayed.
The problem turned out to be that I defined paint() rather than
paintComponent(). What was strange was that I was able to use other
classes extending Component that I wrote and return them
from the ListCellRenderer. These had the same mistake
of putting the display logic in paint() rather than paintComponent();
Yet those Components worked fine and this error in the class notes from
which
I taught our GUI course since 2001.
One of my students , Mr. Kevin Kraus,
elucidated the solution to this problem -- Thanks!
This was also discussed in this group in
relation to a post from John Creighton on September 2 2001.
Since, this is an easy error to make, it is worthwhile having the
reminder, here.
I did not see anything saying this in the FAQ but section 3.4
told our users not to use Component.getGraphics(). They were told
to override "paint()(AWT)" or "paintComponent()(Swing)"
I am sending a suggestion to Mr. Weidenfeller
of new wording to help people trouble shooting their
programs.
Here is my component definition:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class NumberComponent extends JComponent {
String FontName;
String ToDisplay;
int Size;
boolean Selected;
Font f;
void setSelected (boolean S){
Selected=S;
}
NumberComponent (String S) {
ToDisplay = S;
Size = 12;
FontName="Arial";
}
NumberComponent (String S, String F, int size) {
Size=size; FontName = F; ToDisplay = S;
}
public void paint (Graphics g) {
System.out.println ("font Name " + FontName + " Size " + Size);
if (!Selected) {
f = new Font (FontName,Font.PLAIN,Size);
}
else {
f = new Font (FontName,Font.BOLD,Size);
}
//g.setFont(f);
g.setColor(Color.black);
//g.fillRect(10,10,30,20);
g.drawString (ToDisplay,0,0);
System.out.println (" here " + ToDisplay + " hc " + hashCode());
}
public Dimension getMinimumSize() {
if (!Selected) {
f = new Font (FontName,Font.PLAIN,Size);
}
else {
f = new Font (FontName,Font.BOLD,Size);
}
int Width = getFontMetrics(f).stringWidth(ToDisplay);
int Height = getFontMetrics(f).getHeight();
System.out.println (" Width " + Width + "Height " + Height);
Dimension D = new Dimension (Width,Height);
return D;
}
public Dimension getPreferredSize() {
return getMinimumSize();
}
public Dimension getMaximumSize() {
return getMinimumSize();
}
}
Here is the output from the list box that is using it to display:
@toolman#/home/leffstudent/412/final1 >java LMX Numbers.xml
Number Text 33333333Font is Size NC 7754385
Width 64Height 15
Number Text 433333334Font is Size NC 3541984
Width 72Height 15
Number Text 233333332Font is Size NC 4565111
Width 72Height 15
Number Text 33333333Font is Size NC 16164678
font Name Arial Size 12
here 33333333 hc 16164678
Number Text 433333334Font is Size NC 16795905
font Name Arial Size 12
here 433333334 hc 16795905
Number Text 233333332Font is Size NC 28904249
font Name Arial Size 12
here 233333332 hc 28904249
@toolman#/home/leffstudent/412/final1 >exit
exit
Here is the ListCellRenderer I defined:
import javax.swing.*;
import java.awt.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
class NR implements ListCellRenderer {
public Component getListCellRendererComponent (
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
Element N = (Element)value;
NodeList NL = N.getChildNodes();
Node TextNode = NL.item(0);
String NumberText = TextNode.getNodeValue();
String Font = N.getAttribute("Font");
String SizeText = N.getAttribute("Size");
System.out.print ("Number Text " + NumberText + "Font is " + Font + "
Size " + SizeText);
NumberComponent NC;
if (Font != null && Font.length() != 0 && SizeText!=null &&
SizeText.length()!= 0) {
int Size = Integer.parseInt(SizeText);
NC = new NumberComponent(NumberText,Font,Size);
}
else {
NC = new NumberComponent(NumberText);
}
NC.setSelected(isSelected);
System.out.println ("NC " + NC.hashCode());
return NC;
}
}
- 10
- layouts layouts layouts..Andrew Thompson wrote:
> On Fri, 02 Sep 2005 12:09:47 -0400, Frances wrote:
>
> ..
>
>>>- Your button should occupate SOUTH (Looks like you want button to
>>>occupate all available place)
>>
>>no I don't!! that's just how it's coming out, can't figure out how to
>>control size for it (as I said, setSize() is being ignored..
>
>
> 'size' is often ignored, while prefered/minimum/maximum
> are more likely to be honored. Some layouts will ignore
> even the latter in some circumstances, especially like
> BorderLayout.CENTER.
>
>
>>..(I have been wondering, though, about BorderLayout, I
>>don't see WEST in yr post, I've been wondering if it's ok to use
>>BorderLayout if you don't fill all five "corners".. (NORTH, SOUTH,
>>CENTER, EAST, WEST..)
>
>
> Yes. BorderLayout allows 5 components, but can accept less.
great.. thank you Andrew, I really had been wondering about this...
again many thanks Andrew, to you and to all who responded... I got lots
to chew on here for the weekend now...
:)
- 11
- native method performance puzzleJust to be clear, I'm afraid that I can't do more than sketch my problem out
here, since it's customer-specific, but I'm hoping for some direction.
I'm testing two implementations of a data-processing API, one in pure Java,
one in native methods (windows dll). The process I am testing is disk I/O
intensive.
Running the same performance test over and over again I've found that the
pure Java implementation gives very consistent results, while the native
method version gives results that steadily get better over about a dozen
runs, finally ending up about the same at the pure Java implementation
(probably ultimately limited by disk thruput).
For example, test 1 might look like:
pure Java method : 12 sec
native method: 20 sec
test 5 like:
pure Java method: 11 sec
native method: 15 sec
test 10 like:
pure Java method: 12 sec
native method: 10 sec
What could be going on here? It sure feels like something is being cached,
but I'm not sure what.
Thanks,
--arne
- 12
- a common yet hard-to-resolved problem for Java GUI size!The Java application GUI (setPreferSize to some hardcoded dimension)
gets smaller when it comes to wide screen (Dell 16:9 laptop), and the
users have to resize the GUI every time they are launched (so as to see
the action buttons). This problem seems to happen only for 16:9 wide
screen so far.
Question:
1. What are the factors deciding the swing (awt) GUI size, besides
resolution and font? Is wide screen really an individual factor?
2. How to formulate a universal good GUI size? Or any examples to
define different sizes for different display-cases?
Thought the following functions might be needed, although I heard that
Toolkit.getScreenResolution() cannot really detect screen resolution.
Toolkit.getScreenResolution(), Toolkit.getScreenSize(), getFontSize()
Any example or information will be highly appreciated!
- 13
- [OT] eruditionOn 2008-02-12 03:12 +0100, Lew allegedly wrote:
> Daniele Futtorovic wrote:
>> confer:
>> "About Documents"
>> <http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#document>
>
> etc.
>
> That usage of "confer" is marvelous, simply delightful. I was just
> looking up that usage of the word the other day, coincidentally, in the
> context of the abbreviation "cf.". Sheer poetry to see it spelled out.
> Thank you.
>
You're most welcome.
- 14
- java e-booksPlease suggest a good e-book for a java beginner. Thanks.
- 15
- Differences between C++ and JavaOn 1 Dec 2005 10:25:38 -0800, "AndyRB" <email***@***.com> wrote,
quoted or indirectly quoted someone who said :
>The problem is many newbies (quite possibly
>Roedy's target audience) are ignorant of undefined behaviour and think
>that if their c++ code simply compiles then it must be valid c++.
That is not the issue. The issue is whether there are mechanisms to
detect the error or you simply get undefined results.
Think for example writing C code where you failed to initialise a
variable. This was legal. Most of the time it was initialised to 0.
But sometimes it was not, leading to a need for a timeout in a padded
cell. It STRONGLY matters if the compiler/run time can detect the
error.
It is almost irrelevant if the given code is technically legal.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
|
|