Unix Tips

To find out if processor is 32 bit or 64 bit on Unix :

$ getconf -a | grep KERN
KERNEL_BITMODE: 64

http://www.stata.com/support/faqs/win/64bit.html

eclipse ui activity to hide everything except for a view in a plugin

If you want to hide a view (or any other UI component in a plugin) from user, you can write a ui.activities extension as below :

<extension point="org.eclipse.ui.activities">
<activity description="Turn off My View"
id="com.myapp.myactivity" name="MyViewActivity">
</activity>
<activityPatternBinding activityId="com.myapp.myactivity"
pattern="com\.myapp\.mypluginid/com\.myapp\.myviewid">
</activityPatternBinding>
</extension>

This activity is by default disabled, so it hides the view by default. Now if you want to show the view programatically, you can do so by enabling this activity as below :


IWorkbenchActivitySupport workbenchActivitySupport =
PlatformUI.getWorkbench().getActivitySupport();

IActivityManager activityManager =
workbenchActivitySupport.getActivityManager();

Set<String> enabledActivityIds =
new HashSet<String>( activityManager.getEnabledActivityIds() );

enabledActivityIds.add( "MyViewActivity" ) );


.
So far so good. if you want to hide everything except a particular UI component, you can do so by specifying negative lookbehind ("?<!") regular expression in your activity pattern.
Lets say you want to hide all the ui components in your plugin execpt for 2 views in your plugin :

Plugin ID : com.myapp.myappid
View1 ID : com.myapp.myviewid1
View2 ID : com.myapp.myviewid2

Here is the snippet to Hide everything in plugin com.myapp.myappid except for view1 (com.myapp.myviewid1) & view2 (com.myapp.myviewid2).
Note that you have to use "?&lt;!" instead of "?<!" as in xthml '<' character is not allowed.

<extension point="org.eclipse.ui.activities">
<activity description="Turn off My View"
id="com.myapp.myactivity" name="MyViewActivity">
</activity>
<activityPatternBinding activityId="com.myapp.myactivity"
pattern="com\.myapp\.mypluginid/.*(?&lt;!myviewid1|myviewid2)">
</activityPatternBinding>
</extension>