*
* @param e the action event
*/
@Override
public void actionPerformed(ActionEvent e) {
DataContentTopComponent dctc = DataContentTopComponent.findInstance();
int totalTabs = dctc.getTabPanels().getTabCount();
// change the output view to hex view
if (type == 1) {
// find the hex view top component
// TopComponent hexWin = WindowManager.getDefault().findTopComponent("HexViewTopComponent"); // Note: HexViewTopComponent = the preffered ID of that top component
// hexWin.requestActive(); // set it to become the active top component
for (int i = 0; i < totalTabs; i++) {
if (dctc.getTabPanels().getComponentAt(i) instanceof DataContentViewerHex) {
dctc.getTabPanels().setSelectedIndex(i);
}
}
}
// change the output view to string view
if (type == 2) {
// find the string view top component
// TopComponent stringWin = WindowManager.getDefault().findTopComponent("StringViewTopComponent"); // Note: StringViewTopComponent = the preffered ID of that top component
// stringWin.requestActive(); // set it to become the active top component
for (int i = 0; i < totalTabs; i++) {
if (dctc.getTabPanels().getComponentAt(i) instanceof DataContentViewerString) {
dctc.getTabPanels().setSelectedIndex(i);
}
}
}
// else do nothing
}