tag:blogger.com,1999:blog-81453229225640787412024-03-05T06:21:44.339-08:00Mike SchragMike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-8145322922564078741.post-72428469404395147732010-12-19T05:50:00.000-08:002010-12-19T05:50:26.006-08:00Why The PS3 Drives Me CrazyLet me lead with a compliment. The PS3 is an amazing piece of engineering. The possibilities for this device are huge, which makes its overall sucking that much more sad. The best of the PS3 games clearly surpass its other console competition. Uncharted 2, for instance, is like being inside of a movie -- I can't say enough about it.<br />
<br />
But that brings me to why I can't stand this device:<br />
<br />
* every time you turn it on it requires a system update<br />
<br />
* system updates block the entire UI ... oh you want to play a game? sitting for 10 minutes is pretty fun, too.<br />
<br />
* the store is organized in ridiculous ways. you can't find anything. want to see the highest rated game demos? instead, they give you "A-F" "G-M" categories.<br />
<br />
* buy something from the store. it doesn't download immediately. it brings you to a screen where you can decide to download it. bitch, i just spent $15 -- of course i want it now.<br />
<br />
* the sounds in the store are super annoying. every selection is a really high pitched "ping" and scrolling through a long list will drive you crazy.<br />
<br />
* the grid view in the store (which they use all over the place) has no linear navigation. you have to right, right, right, down, left, left, left, down, right, right ,right, down, left, left, left through it.<br />
<br />
* when you download something from the store, there's no direct way to see that it's actually doing it -- you go all the way back out of the store to the "Download Manager"<br />
<br />
* if you weren't sure it was downloading and clicked "download" more than once? yep .. you got it ... multiple concurrent downloads of the same fucking thing.<br />
<br />
* if you want to remove a download from the download manager, you'd think "select it and then pick delete". instead when you select it, it takes you to a full screen that shows the icon and its file size. no options. if you go back out and instead hit the triangle button, THEN you get a menu of choices to "cancel" it.<br />
<br />
* once you download something, it's not ready to play. you have to select it and then "install" it. are you serious? why in the world would i download something and not want it automatically installed?<br />
<br />
* it's a total ui for nerds ... the FIRST menu item (after the login) is "settings," which has hundreds of advanced settings. why is that front-and-center? presumably after configuring it the first time, I never want to see this again.<br />
<br />
* playing a blu-ray movie is a fun experience, too. you put the disc in ... and you sit ... and nothing happens ... so you start looking around, and the choice to play the movie is labeled something like "Play BD-ROM"<br />
<br />
* the controls INSIDE a blu-ray movie are fantastic. there is no simple, common, controls ui -- it's every button you can possibly press in a tiny grid and you arrow over to the thing you want to press. i was pretty quickly lost in the controls trying to just navigate the menus reliably using the controller<br />
<br />
* speaking of the controller, it took them quite a while top put out a system update that made it so your controller didn't just drain its batteries if you leave it sitting without remember to turn each one off. i'm still not sure that's the default setting even now.<br />
<br />
* if you ever use the apps they provide in the "internet browser," you'll notice they're custom built for the PS3 and look TERRIBLE. them main menu labels on the youtube app don't fit in the buttons and all have ellipsis. it's BUILT for PS3. why would you custom build something that doesn't fit?Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com1tag:blogger.com,1999:blog-8145322922564078741.post-48614587764449780712010-11-10T06:52:00.000-08:002010-11-10T06:52:53.210-08:00Switching from Subversive back to SubclipseIf you switch from Subversive to Subclipse, you will find that projects that were attached to subversive in existing workspaces will not offer you the option to Team=>Share... There are a couple workarounds for this:<br />
<br />
<b>Annoying and Tedious Way</b><br />
<ol><li>Before switching to Subclipse, Team=>Disconnect your subversive projects</li>
<li>Uninstall Subversive</li>
<li>Install Subclipse</li>
<li>Team=>Share away</li>
</ol><br />
<b>Annoying but Simple Way</b><br />
<ol><li>Toss everything and check it back out again with Subclipse</li>
</ol><br />
<b>Atomic but Quick Way</b><br />
<ol><li>Uninstall Subversive</li>
<li>Install Subclipse</li>
<li>Quit eclipse</li>
<li>Go to your workspace folder and run:<br />
find .metadata/.plugins/org.eclipse.core.resources/.projects -name 'properties.index' -delete<br />
</li>
<li>Restart eclipse</li>
</ol>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com3tag:blogger.com,1999:blog-8145322922564078741.post-50189284604456519412010-02-22T06:38:00.000-08:002010-02-22T06:38:41.376-08:00Are Generic Methods evil?<p>
Over the weekend I ran into an interesting design issue inside of ERRest. Java supports declaring generic methods that can perform a simple type inference:
</p>
<pre>
public class NonGenericClass {
public <T> T objectForKey(String key) { ... }
}
</pre>
<p>
What this allows you to do is:
</p>
<pre>
Person p = new NonGenericClass().objectForKey("person")
</pre>
<p>
Notice that we don't have to cast to Person like you would if objectForKey returned Object. So ... is this bad form? The closest examples of Sun using type inference in the core libraries is Collections.emptyList(), which can give you a type-inferred List. The difference, though, is that this is an inherently safe operation. In the example above, that code is inherently unsafe. On the upside, your API becomes easier to use -- your users don't need to think about the cast. On the downside, you might say the API is misleading, implying that this operation is in some way typesafe when it clearly is not.
</p>
<p>
I came to a happy place with it. My decision was that if this API is impossible to make type-safe (think ResultSet.getObject(String)), and if that's fairly obvious to the user of the API, then taking advantage of type inference is OK and will just save your API users time.
</p>
<p>
One catch, by the way, is that javac appears to not like a double indirection of type inference:
</p>
<pre>
public class ClassOne {
public <T> T methodOne() {
return ...;
}
}
public class ClassTwo {
public <T> T methodTwo() {
return new ClassOne().methodOne(); // this is a compile error in javac
}
}
</pre>
<p>
For some reason, javac is not capable of returning an inferred type for a method call to a method that returns and inferred type. You have to cast to T:
</p>
<pre>
public class ClassTwo {
public <T> T methodTwo() {
return (T)new ClassOne().methodOne(); // this makes javac happy
}
}
</pre>
<p>
Incidentally, the Eclipse compiler is fine with the first one and doesn't need the cast. I think this is a javac bug, personally.
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com9tag:blogger.com,1999:blog-8145322922564078741.post-21647276057132068692009-05-17T05:21:00.000-07:002009-05-17T05:26:49.842-07:00Maclipse 3.4.2 Fixed ... More<p>
You may have noticed that Java=>Editor=>Templates throws an exception with Maclipse ... That's because there is some code that presumes there is a non-null vertical scrollbar. With Maclipse, we autohide scrollbars on Leopard, which causes an NPE in that code. I avoided fixing this because it brought in an entirely new plugin that we had to hack, but it's just one line, so .. meh.. at this point, why stop now.
</p>
<p>
So to prevent that exception, you will want to grab the Workbench Texteditor UI plugin provided in the links area.
</p>
<pre>
cd /Developer/Applications/eclipse/plugins && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.swt.carbon.macosx_3.4.1.v3452b.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench.texteditor_3.4.1.r341_v20080827-1100.jar
</pre>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com2tag:blogger.com,1999:blog-8145322922564078741.post-79587721903566876572009-05-17T04:39:00.001-07:002009-05-17T04:39:44.544-07:00Maclipse 3.4.2 FixedThe build from last night was missing a MANIFEST.MF, so it wasn't exporting the plugin info properly. I think this would only be a problem if you do plugin development, but regardless, you should grab the new build.Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-42075779407558531332009-05-16T19:59:00.000-07:002009-05-17T05:27:05.080-07:00Maclipse Eclipse 3.4.2 Updates<p>
Maclipse has been updated with all the changes merged in from Eclipse 3.4.2 finally. Links on the right, same install process applies.
</p>
<pre>
cd /Developer/Applications/eclipse/plugins && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.swt.carbon.macosx_3.4.1.v3452b.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar
</pre>
<p>
You may also need to remove your eclipse configuration/org.eclipse.osgi/bundles folder (which contains the unjar'd SWT jnilibs).
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-68300030802451944482009-01-21T14:40:00.000-08:002009-01-21T14:41:59.186-08:00Never hashCode on a mutable value RevisitedIn the "Never hashCode on a mutable value" post, I talked about the pitfalls of using a mutable value in your hashCode/equals computation. Another subtle variant of this is using a Comparator for a mutable value in a TreeSet (or other similar data structures). Because the set is sorted internally, and optimized based on that sort information, if you change the sorted value of one of your objects in the set, it can "disappear" if you attempt to .contains(..) check it later. I wonder how many more of these stupid mistakes I'll find ...Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-35373346352678742552009-01-19T20:40:00.001-08:002009-01-19T20:41:06.583-08:00Slow PS3 Wireless Connectionprops to <a href = "http://boardsus.playstation.com/playstation/board/message?board.id=psnetwork&thread.id=168428">this guy</a> ... if your PS3 wireless connection is ungodly slow, change your router from Mixed to G-Only. it's stupid, but it was about a 10x speed boost (... back to normal, basically).Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com4tag:blogger.com,1999:blog-8145322922564078741.post-26636197601705223812009-01-19T15:30:00.000-08:002009-01-19T15:32:35.282-08:00Open Type can't find your class?I ran into an annoying case when switching frequently between workspaces and doing some really mean things to a couple of them with swapping out external frameworks repeatedly. Somehow I managed to corrupt my type caches in Eclipse so that the Open Type dialog would just be missing some entries (which is REALLY annoying, I might add). This would also manifest as java type completion not working for the missing classes. Maybe there's a nice way in Eclipse to do this, but I couldn't find it, but you can toss your type caches. Quit Eclipse, go to workspace/.metadata/.plugins/org.eclipse.jdt.core and remove *.index and savedIndexNames.txt. When you restart Eclipse it will rebuild the entire type cache and life should be happy again.Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com25tag:blogger.com,1999:blog-8145322922564078741.post-16752663087321878102008-11-24T14:09:00.000-08:002008-11-24T14:10:44.194-08:00JSEditor is gone, but not reallyJSEditor disappeared from Adobe Labs and is not only available inside of Flex Builder, but it turns out that the install site is still there and is actually the same version included in Flex Builder. You can add the install site:
http://download.macromedia.com/pub/labs/jseclipse/autoinstall/site.xml
and it will install. You will probably need to set JSEditor to be your editor for *.jsMike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com2tag:blogger.com,1999:blog-8145322922564078741.post-7485031433568787382008-11-21T12:27:00.001-08:002008-11-21T12:27:47.877-08:00Maclipse Eclipse 3.4.1 UpdatesMaclipse has been updated with all the changes merged in from Eclipse 3.4.1 finally. Links on the right, same install process applies.Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com3tag:blogger.com,1999:blog-8145322922564078741.post-59176775750247157692008-11-20T13:00:00.003-08:002008-11-20T13:02:19.417-08:00Never hashCode on a mutable value.<pre>
public class Terrible {
public static void main(String[] args) {
HashSet<Person> people = new HashSet<Person>();
Person originallyMike = new Person("Mike");
people.add(originallyMike);
System.out.println("Terrible.main: Contains Mike? " + people.contains(new Person("Mike")));
System.out.println("Terrible.main: Changing stored name from Mike to Adam.");
originallyMike._name = "Adam";
System.out.println("Terrible.main: Contains Mike? " + people.contains(new Person("Mike")));
System.out.println("Terrible.main: Contains Adam? " + people.contains(new Person("Adam")));
}
public static class Person {
public String _name;
public Person(String name) {
_name = name;
}
@Override
public int hashCode() {
return _name.hashCode();
}
@Override
public boolean equals(Object obj) {
return obj instanceof Person && ((Person) obj)._name.equals(_name);
}
}
}
</pre>
prints:
<pre>
Terrible.main: Contains Mike? true
Terrible.main: Changing stored name from Mike to Adam.
Terrible.main: Contains Mike? false
Terrible.main: Contains Adam? false
</pre>
HashSet uses the hashcode of your object to select the bucket for your object. If your hashCode changes, the object effectively disappears from the collection for the purposes of API calls like .contains(..). So do yourself a favor and never use a mutable value in your .hashCode (which also, incidentally, means that you can't use a mutable value in your .equals(..) since those two methods are required to be mutually consistent).Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com1tag:blogger.com,1999:blog-8145322922564078741.post-65824029695951832932008-10-29T11:40:00.000-07:002008-10-29T11:41:09.790-07:00Color is on the app store!Enjoy!
<a href = "http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294562042&mt=8">Color</a>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com3tag:blogger.com,1999:blog-8145322922564078741.post-59250007499851368672008-10-18T07:55:00.000-07:002010-08-07T13:26:48.232-07:00How does WOSwitchComponent actually work again?(from the mailing list, but it really should have been a blog post :) )
<p>
jad WOSwitchComponent and walk through and explain to yourself why WOSwitchComponent doesn't show the same instance of a component for every session in your app, particularly given that there will only be one instance of a WOSwitchComponent on a given parsed page (meaning that if there's a WOSwitchComponent for an element in your Main component, there will only be ONE INSTANCE of WOSwitchComponent servicing that slot on the page for all of your users). Prepare to get a much deeper understanding and appreciation of how WO works and how clever the original authors were.
</p>
<p>
So the magic is WOComponentReference + WOComponentDefinition + WOComponent. What happens is that when your template is parsed, it gets parsed into a bunch of WOComponentReferences. If you understand WOAssociation, WOComponentReference is like the equivalent concept for components. That is, you have a handle that says "I represent an AjaxInPlace with a set of bindings" but it's not a stateful instance, it just describes how you're going to use it.
</p>
<p>
During parsing an entire tree of these is built up. It represents your parsed template without state. The sort of interesting part is that these things actually extend WODynamicElement, so they LOOK like components from the outside.
</p>
<p>
What happens is, and this is the kind of neat and clever part, is that at runtime, you say pageWithName("MyPage"). You get a new instance of the top level component. For each parsed element on the page (a WOComponentReference), the framework will walk down the tree and say "give me a stateful peer for this WOComponentReference for a component of this name, and use this set of bindings". It's here, btw, that it can decide whether subcomponents get new instances or come from the shared pool. Then the part that I DIDN'T know about -- the way these are connected is that the new instance of a child component is pushed into a dictionary in the WOComponent parent keyed off of element ID, so the framework can walk down the parsed tree and say to the parent, "give me your child component with the elementID x". If this component has already been materialized, the component will hand back a subcomponent from its dictionary. If one isn't there, it will make a new one and push it into the dictionary. So this starts to make sense, now, why you always get a new top level component instance -- it's the root of the state tree. There has to be a root node to hang all these stateful components off of. The magic method for all of this is actually WOComponentDefinition._componentInstanceInContext(context), btw.
</p>
<p>
So fundamentally, there's this stateless tree of elements that represents my entire parsed page and there's this stateful tree of WOComponent instances that represent the actual components of the page. So in normal components, the structure of your page is basically predetermined -- you have a bunch of WOConditionals, WOStrings, AjaxInPlace's, etc, all in a tree and page state determines which path through this graph you take. WOSwitchComponent, though, is a crazy twist on this. WOSwitchComponent DYNAMICALLY determines its page structure -- that is, the "parsed side" is indeterminate for a WOSwitchComponent. And if you look at WOSwitchComponent, this is exactly what it's doing. When you ask for a "SomeComponent", the cache doesn't return to you a WOComponent of the class you asked for, but instead a WOComponentReference -- those stateless handles. It's clever as hell. When it needs the component to work on, it looks up the correct instance of WOComponent based on the reference that it has cached (that is shared by everyone!) by asking the context().component() for a child with the current elementID, and will make one if it doesn't exist. So WOSwitchComponent takes advantage of this peer concept and basically builds this structure up itself on-the-fly. When this clicked for me, it was a "woah .. that's really slick" moment.
</p>
<p>
All of this finagling on my part was because I wanted to implement a new type of component that would allow you to, for instance, create a component on your page that would act like an "embedded page," where instead of having the result of invokeAction replace the entire page, it would instead just replace the embedded page component. To do this, you have to muck with page structure on-the-fly, which is pretty similar to what WOSwitchComponent does, but changing over time. So I just pulled up WOSwitchComponent and thought "I'll just base my code on this - -should be pretty easy" except that I looked at WOSwitchComponent and decided that it's impossible that it actually worked right :) But it does, and I began my quest to find out how :)
</p>
<p>
Incidentally, I THINK (haven't verified yet) that the third parameter to the constructor of a WODynamicElement, which I've always sort of wondered its exact purpose, is your stateless-parsed-element-peer. So you're being handed the reference to your stateless equivalent in the parse tree. This is my theory, at least. This gives you access to the structure of your children components, which during the R-R loop can also be used to access the stateful peers, etc.
</p>
<p>
So anyway ... That's the long story that probably nobody else cares about, but I think it's sort of a fascinating aspect of WO, because it's this crazy and clever underpinning that makes the entire framework function that I really had no idea about the inner workings of.
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com3tag:blogger.com,1999:blog-8145322922564078741.post-28532259937089334692008-10-09T22:57:00.000-07:002008-10-09T22:59:43.520-07:00iPhone Layer Edge AntialiasingApply your rotation transform to that layer and look how beautiful it is in the simulator -- nicely antialiased rotated layer edges. Drop it on the phone and you might be surprised to find that it looks like crap. It turns out that layers don't have antialiased edges on the iPhone, so just keep that in mind if you're planning on using layer rotations, especially.Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-57050213132088709472008-10-09T22:22:00.000-07:002008-10-09T23:01:56.946-07:00iPhone Image Benchmarks<p>There are two functions you can call for encoding UIImages on the iPhone -- UIImageJPEGRepresentation and UIImagePNGRepresentation. For my app, I was curious about the performance of the two image formats. I ran some tests on JPEG with various compression qualities, PNG, and Simulator vs iPhone 3G on 2.1.</p>
<p>The image tested was a 320x416 image (about 120k JPG @ max quality) of line drawing, repeated 10 times for each scenario and averaged. For the writing tests, the images were encoded and then written to disk. For the reading tests, the image is read and then drawn to an offscreen bitmap to make sure the bytes were actually read off the drive.</p>
<p>Note that q=0.0 is max compression, min quality; and q=1.0 is min compression, max quality.</p>
<p>
<span style="font-weight:bold;">Simulator Writing</span>
<br/>
jpg, q=0.000000, 0.018185 seconds avg
<br/>
jpg, q=1.000000, 0.017662 seconds avg
<br/>
png, 0.034456 seconds avg
</p>
<p>
<span style="font-weight:bold;">Simulator Reading</span>
<br/>
jpg @ q=0.000000, 0.005052 seconds avg
<br/>
jpg @ q=1.000000, 0.000838 seconds avg
<br/>
png, 0.021330 seconds avg
</p>
<p>
<span style="font-weight:bold;">iPhone 3G 2.1 Writing</span>
<br/>
jpg, q=0.000000, 0.255950 seconds avg
<br/>
jpg, q=1.000000, 0.265089 seconds avg
<br/>
png, 0.592170 seconds avg
</p>
<p>
<span style="font-weight:bold;">iPhone 3G 2.1 Reading</span>
<br/>
jpg @ q=0.000000, 0.138772 seconds avg
<br/>
jpg @ q=1.000000, 0.049013 seconds avg
<br/>
png, 0.065347 seconds avg
</p>
<p>
<span style="font-weight:bold;">Conclusion</span>
<br/>
In this test scenario, JPG writing is about 2.3 times faster than PNG writing on the 3G regardless of quality. On the flip side, JPG reading at max quality is 1.3x faster than PNG, but 2.1x SLOWER than PNG at max compression.
</p>
<p>So if we take the best quality comparison, JPG is 2x faster to write and 1.3x faster to read. You'll have to compare image quality in your particular case, but JPG seems to win hands-down for me.</p>
<p>You can also look at the comparisons between iPhone and Simulator and prove to yourself that you should definitely not use the simulator to judge anything about runtime performance of your app on the real device, which I don't guess anyone REALLY had to tell you.</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com2tag:blogger.com,1999:blog-8145322922564078741.post-70511785658442122682008-07-30T08:51:00.001-07:002008-07-30T08:54:38.954-07:00Note for the New Version<p>
There is a new Maclipse build that incorporates the disappearing cursor patch from the SWT guys (<a href = "https://bugs.eclipse.org/bugs/show_bug.cgi?id=241671">https://bugs.eclipse.org/bugs/show_bug.cgi?id=241671</a>) that will be in 3.4.1.
</p>
<p>
The catch, though, is that it requires a patch to the jnilibs, which might break when you launch eclipse because the jnilibs are already "cached" in your bundles folder. <b>If your Eclipse crashes right on startup, toss your "eclipse/configuration/org.eclipse.osgi/bundles" folder</b>, which will cause it to unpack the jnilibs from the jar again at startup. I may be able to set a custom version number in our SWT build to force this to happen, but at the moment, I didn't want to mess with it.
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com2tag:blogger.com,1999:blog-8145322922564078741.post-41118519933456036872008-07-07T07:41:00.000-07:002008-07-07T07:43:05.459-07:00SWT issue<p>
If you grabbed the SWT plugin after I switched to github, grab it one more time. When I imported into github, I rooted my branch at the R3_4_maintenance branch of SWT, but apparently that has all kinds of other commits in it (in particular some broken ones :) ). I have since switched back to my original baseline of the v3448f version of SWT (which is what ships in 3.4):
</p>
<p>
If you're following along at home, the new github link to my branch is:
</p>
<a href = "https://github.com/mschrag/maclipse_swt/commits/mschrag_v3448f">https://github.com/mschrag/maclipse_swt/commits/mschrag_v3448f</a>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-83661554652962502072008-07-07T05:46:00.000-07:002008-07-07T05:47:34.869-07:00Easy Jar Updating<p>
From Anjo:
</p>
<p>
cd /Applications/Eclipse/plugins && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.swt.carbon.macosx_3.4.0.v3448f.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench_3.4.0.I20080606-1300.jar
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-83251104021306871242008-07-06T16:02:00.001-07:002008-07-06T16:03:43.304-07:00All of Maclipse is on GitHub<p>
The Equinox Executable plugin (which adds support for double-clickable eomodels opening in Entity Modeler, for instance)
</p>
<p>
<a href = "http://github.com/mschrag/maclipse_equinox_executable/commits/mschrag_R3_4_maintenance">http://github.com/mschrag/maclipse_equinox_executable/commits/mschrag_R3_4_maintenance</a>
</p>
<p>
The Workbench UI plugin:
</p>
<p>
<a href = "http://github.com/mschrag/maclipse_ui_workbench/commits/mschrag_R3_4_maintenance">http://github.com/mschrag/maclipse_ui_workbench/commits/mschrag_R3_4_maintenance</a>
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-19114113978977382502008-07-06T08:15:00.000-07:002008-07-06T08:19:40.097-07:00Maclipse SWT on GitHub<p>
I've imported the SWT CVS plugin history into GitHub and created a new branch "mschrag_R3_4_maintenance" where I'll be doing my Maclipse work.
</p>
<p>
<a href = "https://github.com/mschrag/maclipse_swt/commits/mschrag_R3_4_maintenance">https://github.com/mschrag/maclipse_swt/commits/mschrag_R3_4_maintenance</a>
</p>
<p>I'm running a git cvsimport on the Eclipse workbench plugin now, then I will need to put up the Equinox plugin, and we'll be good to go.
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-46112268866586741222008-07-05T13:17:00.000-07:002008-11-13T11:00:40.737-08:00Who said "Scroll Bar Autohiding?"<p>
The new build has a more mac-ish looking view menu that uses the standard Apple gear drop-down, and it has replacements for the maximize and minimize buttons that fit a little better with the new style.
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv1mqtvHGyyc9Evz9XtZeiRoak1bRvSAmYspYg1cl5S3T734lrmRUUEoHE7V5lfmiyURN1X4xdd4gD-JbocVC80OPYccsNfbtJgVgtcxPNbt947-Wqrrcfdnhg3_IXEuZy892T-4SO-Ds/s1600-h/Picture+2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv1mqtvHGyyc9Evz9XtZeiRoak1bRvSAmYspYg1cl5S3T734lrmRUUEoHE7V5lfmiyURN1X4xdd4gD-JbocVC80OPYccsNfbtJgVgtcxPNbt947-Wqrrcfdnhg3_IXEuZy892T-4SO-Ds/s320/Picture+2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5219627044312418066" /></a>
<p>
And more importantly, thanks to Greg Hulands via an Apple friend, we have scrollbar auto-hiding in the Carbon controls if you use Leopard! This <i>really</i> cleans up the look of the various views in Eclipse, I think.
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8x9ii12HM93sqcHPC2vr-ZVyUWxu7oCzO-XF-TFmgmIygcFfa0AqfcBmrUVHsx65UTugDiAXsC4ajwnr_SvyIr7ifNDxSF8KOJDUd5AmTRz5MEfxh5FNi5vsApnuu8xXrBjNlLam4fc8/s1600-h/Picture+1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8x9ii12HM93sqcHPC2vr-ZVyUWxu7oCzO-XF-TFmgmIygcFfa0AqfcBmrUVHsx65UTugDiAXsC4ajwnr_SvyIr7ifNDxSF8KOJDUd5AmTRz5MEfxh5FNi5vsApnuu8xXrBjNlLam4fc8/s320/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5219626882357512066" /></a>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com0tag:blogger.com,1999:blog-8145322922564078741.post-11155765064491936492008-06-30T06:40:00.000-07:002008-11-13T11:00:41.330-08:00CCombo. My arch nemesis.<p>
CCombo is the emulated combo box that appears in Eclipse in, for instance, combos in table cell editors. This widget constantly causes me problems throughout WOLips because it's one of the most glaringly non-native components in the SWT family. Here are some pictures to illustrate:
</p>
<p>
CCombo Closed:
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnzCLx2btcRwOwqzt4ts94qDUB-d9-73c7uDLgq4LwXR8hYOluzXtoQPy4OPHJfkbQQ9UgEFHppB81-3DPnPz1DRwoIqD_6CxPPb7bsRVLl3AF144p4nCt3oRKEIbykwStA9ZcD_gi5t4/s1600-h/Picture+3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnzCLx2btcRwOwqzt4ts94qDUB-d9-73c7uDLgq4LwXR8hYOluzXtoQPy4OPHJfkbQQ9UgEFHppB81-3DPnPz1DRwoIqD_6CxPPb7bsRVLl3AF144p4nCt3oRKEIbykwStA9ZcD_gi5t4/s320/Picture+3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217669549483869058" /></a>
<p>
CCombo Opened:
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOwgcbCokV1BxFCb7nHACNEWUolz2RgzcqJSO02Zg8B5xnKnRC4YmMKRxQRbKcgLV4zPyZQTcdD5xV0UpyfnU9Dhyc8xJzCjEkYp60_fXMTPdx2SLg3RgHHrFgh5cgY8WK0NjId3r7sBo/s1600-h/Picture+2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOwgcbCokV1BxFCb7nHACNEWUolz2RgzcqJSO02Zg8B5xnKnRC4YmMKRxQRbKcgLV4zPyZQTcdD5xV0UpyfnU9Dhyc8xJzCjEkYp60_fXMTPdx2SLg3RgHHrFgh5cgY8WK0NjId3r7sBo/s320/Picture+2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217669547517715858" /></a>
<p>
Native (Leopard) Closed:
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5BOqcVDO2NV8RsXz5s1Zla_waVA7iAiUS5xJHn-54Pt-PoPrgvHA6J7X5LHCw_h8d_s7CWtTd7GPEImkTtx9-u0uatr8_e9fmICCnkeN-RE_02yLzhIQL1UGq01axAbZ1qOIhs0wbDpA/s1600-h/Picture+4.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5BOqcVDO2NV8RsXz5s1Zla_waVA7iAiUS5xJHn-54Pt-PoPrgvHA6J7X5LHCw_h8d_s7CWtTd7GPEImkTtx9-u0uatr8_e9fmICCnkeN-RE_02yLzhIQL1UGq01axAbZ1qOIhs0wbDpA/s320/Picture+4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217669553434737938" /></a>
<p>
Native (Leopard) Opened:
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv_ntSiT3NlUIEzKp76LCXyUhDXNCcfSuqdh4NGY1_Ssfmmpr6pLBA67knlbFRs4KBmXEufVTXk2D_GoELzrSLnD0Wyl_tRz0CezO6Hk4OFJH5SEb-FlPh4jFAaVL9GbW7GOxN1XkJGZI/s1600-h/Picture+5.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv_ntSiT3NlUIEzKp76LCXyUhDXNCcfSuqdh4NGY1_Ssfmmpr6pLBA67knlbFRs4KBmXEufVTXk2D_GoELzrSLnD0Wyl_tRz0CezO6Hk4OFJH5SEb-FlPh4jFAaVL9GbW7GOxN1XkJGZI/s320/Picture+5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217669551688962146" /></a>
<p>
Notice that in the closed form, there's no designator that shows that it is a combo (the up/down arrow icon). Currently there's not enough API in tables to add icons like this. I haven't looked at what i would take to fix that. In the open form, it's just all-sorts-a'-wrong. It's not the Leopard window style, it doesn't have proper keyboard navigation like native. Entity Modeler fixes some of this. In fact, if you were to look at this control outside of Entity Modeler, the focus ring is offset incorrectly by several pixels as well (it hangs outside of its table cell by about 3 pixels). Unfortunately, emulating is just never going to be right here. We can get away with it for tabs, because there is no native tab widget (yet), but for combo's, there are just too many expectations. I think the correct fix for this is to make CCombo a native widget on OS X, but currently C* widgets don't have native replacements (they are in the .custom instead of the .carbon package).
</p>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com5tag:blogger.com,1999:blog-8145322922564078741.post-54498091026534014182008-06-29T17:20:00.000-07:002008-11-13T11:00:42.271-08:00Maclipse<p>
I've been working on custom SWT and Workbench plugins that look more Macish than the defaults. After some discussion on the wolips list, I decided that ripping off Aperture would be a good way to go, because it comes the closest to showing samples of the layout widgets we need in Eclipse.
</p>
<p>
Here are some screenshots (and links to an early preview download at the end):
</p>
<p>
This screenshot shows the new CTabFolder/CTabItem. The design is nearly pixel-for-pixel ripped off of Aperture. Getting the view toolbars to layout properly in here took some hackery to ToolBar (because it doesn't, by default, support transparent backgrounds).
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8eym4Vtv73T-1Uv3gfa3CCc9XkUOUGOOLx0CaI9LUTItUfIDd1sXc5IrHNME-0kI0rB7YX5XF0R-3NEjKi3dfRAQkXmOR6VaVeeSxGnR9fn9Ew0h9l421Fcx2OZ2E5lgI8XgNUFcfUQ/s1600-h/Picture+2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8eym4Vtv73T-1Uv3gfa3CCc9XkUOUGOOLx0CaI9LUTItUfIDd1sXc5IrHNME-0kI0rB7YX5XF0R-3NEjKi3dfRAQkXmOR6VaVeeSxGnR9fn9Ew0h9l421Fcx2OZ2E5lgI8XgNUFcfUQ/s320/Picture+2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217463717890678578" /></a>
<p>
Here's the same screenshot, but with a middle tab selected.
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS5qyYkn8bYpvTqkpFUxGwtrem6DCNzDiaLXyb_L3rH-_jNvolnvNVSZIdnDU6O3Y7yBm9-ro_hez84w-RAMjlojblNs7cc-dnIHR2GJDCOtx1vvQ16hkDSvUjTjqWog96lNvhXEIjZiU/s1600-h/Picture+1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS5qyYkn8bYpvTqkpFUxGwtrem6DCNzDiaLXyb_L3rH-_jNvolnvNVSZIdnDU6O3Y7yBm9-ro_hez84w-RAMjlojblNs7cc-dnIHR2GJDCOtx1vvQ16hkDSvUjTjqWog96lNvhXEIjZiU/s320/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217463643924320930" /></a>
<p>
The close icon appears when you rollover the tab image. This is nice because it keeps the layout fixed compared to Eclipse's default style, which shuffles around the left margin of tabs as you select and deselect them (to hide the close icon on unselected tabs). I think this is the way FireFox works, as well.
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw82z8nI45ablU8dz5ruD9v0LIqjCLaQXm7eLXSFARg8NS12tAuDZjzYp1TzqGG3dhnamydtz6C1AUtoHbzttKmGDJ6KpBnajbEGu2L8uEARtjYMsa87bTcZl7fFTuQhMvFQ6IdcYkLAI/s1600-h/Picture+7.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw82z8nI45ablU8dz5ruD9v0LIqjCLaQXm7eLXSFARg8NS12tAuDZjzYp1TzqGG3dhnamydtz6C1AUtoHbzttKmGDJ6KpBnajbEGu2L8uEARtjYMsa87bTcZl7fFTuQhMvFQ6IdcYkLAI/s320/Picture+7.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217465753003585138" /></a>
<p>
The Sashes on Eclipse don't draw any drag handles. Here we're showing that we now draw a drag handle (based on Aperture's style rather than the OS X standard "dot" drag handle). If the Sash is less than 3 pixels, no handle is drawn. If it's 3 or more, one is drawn, and if it's 5 or more, 2 are drawn.
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZTh6gNGwA8m60_KiNBnO7asAK4KsH1eGlnvdbOTNAZCDV5a55sCRMXtGvoYtefaBA897AQhn7jBK3pfAxdtxDAHeFpXpyS5nMh3FVD4ur8na1dVH6ut45y0xIObQiw53a6pTRDKO-UbA/s1600-h/Picture+3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZTh6gNGwA8m60_KiNBnO7asAK4KsH1eGlnvdbOTNAZCDV5a55sCRMXtGvoYtefaBA897AQhn7jBK3pfAxdtxDAHeFpXpyS5nMh3FVD4ur8na1dVH6ut45y0xIObQiw53a6pTRDKO-UbA/s320/Picture+3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217463807953763746" /></a>
<p>
The CoolBar grabber has been changed from a rectangle to an Aperturish dotted line.
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoE2NaRYzYJMFdImcImPqDDt2pupS9MVmhM_CkRq9P2_GMkb_bM5r7UA71sZ1CAE1vWgKCT5AVv2lpoWQ2ay6R9YvYQGLspnZhPYmPOSluZEiwl7bq4pMEVi0H5e8TF29m4A9smEX3f_0/s1600-h/Picture+4.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoE2NaRYzYJMFdImcImPqDDt2pupS9MVmhM_CkRq9P2_GMkb_bM5r7UA71sZ1CAE1vWgKCT5AVv2lpoWQ2ay6R9YvYQGLspnZhPYmPOSluZEiwl7bq4pMEVi0H5e8TF29m4A9smEX3f_0/s320/Picture+4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217463924737360274" /></a>
<p>
And here's the full monty screenshot (toolbar hidden) ...
</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGGpaqfDvRIA3jREKo8RRbYwyO334N4Wyi1Lszjm-zWp6KgrYacrWM2iTiL7T-lBjRBLH_wqQjYMujaKOvMHTGVBiysrMf83TsvmJbguFUBLJYUiksgN8f5yh02JOp0V7CuVkkApHpBWw/s1600-h/Picture+5.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGGpaqfDvRIA3jREKo8RRbYwyO334N4Wyi1Lszjm-zWp6KgrYacrWM2iTiL7T-lBjRBLH_wqQjYMujaKOvMHTGVBiysrMf83TsvmJbguFUBLJYUiksgN8f5yh02JOp0V7CuVkkApHpBWw/s320/Picture+5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217464553256437746" /></a>
<p>
There's still plenty more to do. Most of the emulated widgets are very unmacish (CCombo being an egregious example that is very high on my hit list). I'd like to get Eclipse using the unified toolbar window style as well, but just setting the flag doesn't cause it to render the unified look. I'm guessing because top toolbar isn't registered as the window's actual toolbar (and instead is just a regular view inside the window).
</p>
<p>
If you want to try this out, you can grab the binary build of the SWT and Workbench plugins from the WOLips build server and simply replace the corresponding jars in your plugins folder. Note that these ONLY work on Eclipse 3.4 and they are <b>ALPHA QUALITY</b> so make backups of your original plugin jars before replacing them!
</p>
<ul>
<li><a href = "http://webobjects.mdimension.com/wolips/preview/org.eclipse.swt.carbon.macosx_3.4.0.v3448f.jar">Maclipse SWT Plugin</a></li>
<li><a href = "http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench_3.4.0.I20080606-1300.jar">Maclipse Workbench Plugin</a></li>
</ul>Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com16tag:blogger.com,1999:blog-8145322922564078741.post-20697336555383542302008-06-27T17:19:00.000-07:002008-06-29T17:20:43.637-07:00WALL•EGo see it. That is all.Mike Schraghttp://www.blogger.com/profile/07185879942719846837noreply@blogger.com1