Creates the panel menu for this view widget.  If no point is supplied,\
        then the current cursor position will be used.
        
        :param      panel   | <XViewPanel>
                    point   | <QPoint> || None
972560
def showTabMenu(self, panel, point=None):
        
        if not self._tabMenu:
            self._tabMenu = XViewTabMenu(self)

        if point is None:
            point = QtGui.QCursor.pos()

        self._tabMenu.setCurrentPanel(panel)
        self._tabMenu.exec_(point)
300810
function getPanelByPoint(controller, e, localCursorPoint) {
    var panels = controller._panels;
    if (!panels) {
        return true; // Global panel
    }
    var panel;
    var transform = controller._transform;
    each(panels, function (pn) {
        pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);
    });
    return panel;
}
503086
private void buildTargetPanel() {
		setUpUtilBar();
		panel.add(utilBar);
		panel.add(heading);
		panel.add(panelContentRO);
		panel.add(menu);
	}
302065
def showMenu(self, point=None):
        
        menu = self.createMenu(self)
        menu.exec_(QtGui.QCursor.pos())
        menu.deleteLater()
1003246
public void setControlledPanel (final JComponent panel)
    {
        panel.addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged (HierarchyEvent e) {
                boolean nowShowing = panel.isDisplayable();
                //System.err.println("Controller." + Controller.this +
                //    "  nowShowing=" + nowShowing +
                //    ", wasShowing=" + _showing);
                if (_showing != nowShowing) {
                    _showing = nowShowing;
                    if (_showing) {
                        wasAdded();
                    } else {
                        wasRemoved();
                    }
                }
            }

            boolean _showing = false;
        });
    }
693193
def showProfileMenu(self, point):
        
        if not self.isEditingEnabled():
            return
        
        trigger = self.actionAt(point)
        if (isinstance(trigger, XViewProfileAction)):
            prof = trigger.profile()
        else:
            prof = None
        
        # define the menu
        menu = QMenu(self)
        acts = {}
        text = self.profileText()
        
        # user right clicked on a profile
        if prof:
            acts['edit'] = menu.addAction('Edit {0}...'.format(text))
            acts['save'] = menu.addAction('Save Layout')
            
            menu.addSeparator()
            
            acts['copy'] = menu.addAction('Copy {0}'.format(text))
            acts['export'] = menu.addAction('Export {0}...'.format(text))
            
            menu.addSeparator()
            
            acts['remove'] = menu.addAction('Delete {0}'.format(text))
        
        # show toolbar options
        else:
            acts['new'] = menu.addAction('New Layout'.format(text))
            
            menu.addSeparator()
            
            acts['save_as'] = menu.addAction('Save Layout as...')
            
            if QApplication.clipboard().text():
                acts['paste'] = menu.addAction('Paste {0}'.format(text))
            acts['import'] = menu.addAction('Import {0}...'.format(text))
        
        for key, act in acts.items():
            act.setIcon(QIcon(resources.find('img/{0}.png'.format(key))))
        
        # run the menu
        act = menu.exec_(QCursor.pos())
        
        # create a new profile
        if act is None:
            return
        
        elif act == acts.get('new'):
            self.clearActive()
        
        # create a new clear profile
        elif act == acts.get('save_as'):
            self.saveProfileAs()
        
        # edit an existing profile
        elif act == acts.get('edit'):
            self.editProfile(prof)
        
        # save or create a new profile
        elif act == acts.get('save'):
            self.saveProfileLayout(prof)
            
        # copy profile
        elif act == acts.get('copy'):
            QApplication.clipboard().setText(prof.toString())
        
        # export
        elif act == acts.get('export'):
            self.exportProfile(prof)
        
        # export
        elif act == acts.get('import'):
            self.importProfile()
        
        # paste profile
        elif act == acts.get('paste'):
            text = QApplication.clipboard().text()
            try:
                prof = XViewProfile.fromString(text)
            except:
                prof = None
                QMessageBox.information(self.window(),
                                        'Invalid {0}'.format(text),
                                        'The clipboard text does not contain '\
                                        'a properly formated {0}'.format(text))
                
            if prof and not prof.isEmpty():
                self.createProfile(profile=prof)
        
        # paste as profile
        elif act == acts.get('paste_as'):
            text = QApplication.clipboard().text()
            prof = XViewProfile.fromString(text)
            if not prof.isEmpty():
                if XViewProfileDialog.edit(self, prof):
                    self.createProfile(profile=prof)
        
        # remove the profile
        elif act == acts.get('remove'):
            self.removeProfile(prof)
750449
def insertTab(self, index, tab):
        
        if not isinstance(tab, XViewPanelItem):
            tab = XViewPanelItem(tab, self)
            tab.setFixedHeight(self.height())

        # remove it from the layout first
        self.layout().insertWidget(index, tab)
        self.setCurrentIndex(index)
        return tab
1268372
def create_toolbutton(entries, parent=None):
    
    btn = QtGui.QToolButton(parent)
    menu = QtGui.QMenu()
    actions = []

    for label, slot in entries:
        action = add_menu_action(menu, label, slot)
        actions.append(action)

    btn.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
    btn.setDefaultAction(actions[0])
    btn.setMenu(menu)
    return btn, actions
854174
def plot(self,x,y,panel=None,**kws):
        
        if panel is None:
            panel = self.current_panel
        opts = {}
        opts.update(self.default_panelopts)
        opts.update(kws)
        self.panels[panel].plot(x ,y, **opts)
333818
def create_widget(self):
        
        d = self.declaration
        self.widget = DrawerLayout(self.get_context(),  None, d.style)
1057237
def create_widget(self):
        
        d = self.declaration
        self.widget = FrameLayout(self.get_context(), None, d.style)
214443
void setResponsePanelPosition(ResponsePanelPosition position) {
		validateNotNull(position, "position");

		requestTabIndex = getCurrentRequestTabIndex();

		responsePanelPosition = position;
		if (layout == Layout.FULL) {
			updateFullLayout();
			return;
		}

		Component currentTabbedPanel = componentMaximiser.getMaximisedComponent();
		if (componentMaximiser.isComponentMaximised()) {
			componentMaximiser.unmaximiseComponent();
		}

		boolean selectRequest = removeSplitRequestAndResponsePanel(tabbedWork);

		switch (position) {
		case PANEL_ABOVE:
			splitResponsePanelWithWorkTabbedPanel(JSplitPane.VERTICAL_SPLIT);
			break;
		case PANELS_SIDE_BY_SIDE:
			splitResponsePanelWithWorkTabbedPanel(JSplitPane.HORIZONTAL_SPLIT);
			break;
		case TAB_SIDE_BY_SIDE:
			splitResponsePanelWithRequestPanel(JSplitPane.HORIZONTAL_SPLIT, tabbedWork);

			getPaneWork().removeAll();
			getPaneWork().add(getTabbedWork());
			getPaneWork().validate();
			break;
		case TABS_SIDE_BY_SIDE:
		default:
			if (currentTabbedPanel == responseTabbedPanel) {
				currentTabbedPanel = tabbedWork;
			}
			insertResponseTab(tabbedWork);

			getPaneWork().removeAll();
			getPaneWork().add(getTabbedWork());
			getPaneWork().validate();
		}

		if (selectRequest || getTabbedWork().getSelectedComponent() == null) {
			getTabbedWork().setSelectedComponent(
					responsePanelPosition == ResponsePanelPosition.TAB_SIDE_BY_SIDE
							? splitRequestAndResponsePanel
							: requestPanel);
		}

		if (currentTabbedPanel != null) {
			componentMaximiser.maximiseComponent(currentTabbedPanel);
		}
	}
714173
def create_widget(self):
        
        d = self.declaration
        self.widget = RelativeLayout(self.get_context(), None, d.style)
135150
public static void showPanel(final View panelLayout) {
        final Activity activity = (Activity) panelLayout.getContext();
        panelLayout.setVisibility(View.VISIBLE);
        if (activity.getCurrentFocus() != null) {
            KeyboardUtil.hideKeyboard(activity.getCurrentFocus());
        }
    }
1084966
def setup_options_button(self):
        """"""
        if not self.options_button:
            self.options_button = create_toolbutton(
                self, text=_('Options'), icon=ima.icon('tooloptions'))

            actions = self.actions + [MENU_SEPARATOR] + self.plugin_actions
            self.options_menu = QMenu(self)
            add_actions(self.options_menu, actions)
            self.options_button.setMenu(self.options_menu)

        if self.tools_layout.itemAt(self.tools_layout.count() - 1) is None:
            self.tools_layout.insertWidget(
                self.tools_layout.count() - 1, self.options_button)
        else:
            self.tools_layout.addWidget(self.options_button)
442826
def oplot(self,x,y,panel=None,**kw):
        
        if panel is None:
            panel = self.current_panel
        opts = {}
        opts.update(self.default_panelopts)
        opts.update(kws)
        self.panels[panel].oplot(x, y, **opts)
1281000
def SetFocus(self, **kwargs):
        
        if self._focus is not None:
            self._focus.SetFocus()
        else:
            # fall back on the default behaviour
            super(_FocusablePanel, self).SetFocus()