jar File, But I Get a ClassNotFoundException at Runtime.See the section Migrating Applications to SMC.
See the section Accessing Resources.
If you descend from one of the AWT or Swing top-level windows (for example, Window, Frame, Dialog, JFrame, JDialog), you limit the contexts in which your code will run, which is often not required. Using the VConsoleProperties.DIALOGTYPE property will do the following:
Allows your tool to know the environment it is in, either FRAME or INTERNALFRAME.
Lets you know the type of top level container in which to place your component; for example, JFrame/JDialog or a JinternalFrame.
If the DIALOGTYPE setting is FRAME, (SMC style), you need the parent frame to create dialogs. If the DIALOGTYPE setting is INTERNALFRAME (as in the "desktop" console), you need the Swing desktop pane to add your JInternalFrame.
Sample Code Console Frame Parent for Dialogs
Obtain a handle to the VDisplayModel and call getSelectedNodes().
Sample Code Getting Selections in Results Pane
There several methods for effecting the selection set, depending on the what you want to do. Each require obtaining a handle to the VDisplayModel.
Sample Code Setting Selections in Results Pane
Obtain a handle to the VDisplayModel and call getSelectedNavigationNode().
Sample Code Get Selected Navigation Pane Node
smc J-Dname1=value1 -J-Dname2=value2 ...
This is convenient if you want to dynamically effect application behavior without having to change code. However, your application will by default only have access to the standard properties (or whatever access is permitted by the security policy in effect).
To grant read permission for application-specific properties, you can create a policy file in your home directory (.java.policy).
Sample Code Specify Properties on Command Line
Send an UPDATESCOPE event to the console.
Sample Code ![]()
UPDATESCOPE
You can specify your own menubar and toolbar on a per-navigation-node basis, via the VScopeNode constructor. You should also do this for the root node of each internal-root model. Your menu/toolbar will appear to the right of the console's menu/toolbar.
See the Menu bar section for details on how to integrate your menu items with the console menus.
Extend VOptionPane to create your own dialogs. When you need to display it, create a VDialog or VFrame, place the VOptionPane inside it and then display your VDialog or VFrame.
Sample Code Creating a Dialog
First integrate an About menu item into the Help menu, as discussed in the Menu bar section. When you receive the event (in the ActionListener for the menu item) associated with this menu item, instantiate a VAboutBox dialog, set the title and description information relative to your tool, and display the dialog.
Sample Code About Box
See the section VConsoleProperties.
Your tool is responsible for tracking what the sort attribute (column identifier) and sort order (ascend or descend) are, and saving them as a property. Sort preferences are in [+/-]# format, where:
+ implies ascending sort order- implies descending sort order# is the column number to sort byFor example, +2 means to sort column 2 in ascending order, -1 means to sort column 1 (the first column) in descending order.
Sample Code Manage Sorting Preferences
By default, SMC assigns the title for the first column in details view to be Name. You can use the VConsoleProperties.DEFAULTCOLUMNHEADER property to customize the title.
If your tool is not limitted to the Details view only, then at the same time you customize the first column, you might also want to customize the width of the column grid for the other views using VConsoleProperties.DEFAULTCOLUMNWIDTH. Specifiy the value as a pixel width in String format.
Sample Code Customize first Column Header
See VScopeNode.columnHeaders in the SMC SDK Javadocs for detailed information about how to specify column headers and their widths.
Specifying alignment involves adding fixed values to the desired column widths:
>20000 will be right-aligned.>10000 and <20000 will be center-aligned.<10000 will be left-aligned.
Sample Code Align Column Values
The short answer is no. Depending on user-specific console configuration, your application may be instantiated more than once, and no variable should have scope beyond the instance for which it was originally set, otherwise you may get very strange results. Furthermore, you cannot use
VConsoleProperties for per-application global data because the Properties object is a console-wide shared object.
Newly registered jar files require that the SMC server be restarted. See the Starting Services section for how to do this.
jar File, But I Get a ClassNotFoundException at Runtime.This is a common error during development, typically after you've added a new class or new properties file. It is especially common during GUI development, where named and anonymous inner classes are used quite frequently, and often without the developer even realizing that this results in additional .class files. New classes and properties files require that the SMC server be restarted. See the Starting Services section for how to do this.