/** * Closes the dialog and sets the return code to the integer parameter. * * @param code The return code. */ protected void close(int code) { returnCode = code; for (Component card : cardPanel.getComponents()) { String id = card.getName(); JPage page = model.get(id); if (page != null) { try { page.dispose(); } catch (Throwable t) { LOGGER.info(id + " close: " + t); } } } dispose(); }
if ("CONSOLE_BINARY_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.BINARY_VISIBLE, true); } else if ("CONSOLE_CHUNK_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.CHUNK_VISIBLE, true); } else if ("CONSOLE_NETWORK_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.NETWORK_VISIBLE, true); } else if ("CONSOLE_JAVA_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.JAVA_VISIBLE, true);
LOGGER.fatal("MageCard name:" + mageCard.getName() + " toolTiptext:" + mageCard.getToolTipText()); } else { LOGGER.fatal("Unknown object:" + comp.getName() + " className:" + comp.getClass().getName());
if (id.equals(card.getName())) { panel = (JPanel) card; break;
@Override public final String getLinkId() { return c.getName(); }
public String getMessage(ComponentTreeNode componentTree) { Component userObject = componentTree.getUserObject(); return userObject.getClass().getSimpleName() + "::" + userObject.getName(); } }
public void installUI(Component comp, String helpId) { CSH.setHelpIDString(comp, helpId); if (log.isDebugEnabled()) { log.debug(helpId + " : " + comp.getName()); } cache.put(comp, helpId); }
private void obtainSubComponentBounds( Hashtable<String, Rectangle> subcomponentBounds, Component component) { if (component.getName() != null) subcomponentBounds.put(component.getName(), component.getBounds()); if (component instanceof Container) { Container componentPanel = (Container) component; for (Component subcomp : componentPanel.getComponents()) { obtainSubComponentBounds(subcomponentBounds, subcomp); } } }
String panelName = c.getName();
@Override public void focusLost(FocusEvent e) { System.out.println("Lost Focus"); dialog.setVisible(false); if (getText().trim().equals("") && e.getOppositeComponent() != null && e.getOppositeComponent().getName() != null) { if (!e.getOppositeComponent().getName().equals("suggestFieldDropdownButton")) { setText(defaultText); } } else if (getText().trim().equals("")) { setText(defaultText); } }
/** * Adds a Component to the end of the JTabbedPane. * * @param comp */ private void appendTab(Component comp) { String title = comp.getName(); int insertAt = findInsertPosition(title); tabs.insertTab(title,null,comp,title,insertAt); }
/** @return whether the given component has been explicitly assigned the name given in the constructor. */ public boolean matches(Component c) { String cname = c.getName(); if (name == null) return cname == null || AWT.hasDefaultName(c); return stringsMatch(name, cname); } public String toString() {
public Component getComponentAt(int x, int y) { getLayout().layoutContainer(this); Component result = super.getComponentAt(x, y); System.err.println("getComponentAt " + x + "," + y + " returning " + result.getName()); return result; }
@Override public boolean isEnableForComponent(Component invoker) { if (SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME.equals(invoker.getName())) { Context ctx = View.getSingleton().getSiteTreePanel().getSelectedContext(); if (ctx != null) { return true; } } return false; }
@Override public void doAction(ActionEvent e) { String name = ((Component) e.getSource()).getName(); GuiPackage guiPackage = GuiPackage.getInstance(); try { guiPackage.updateCurrentNode(); TestElement controller = guiPackage.createTestElement(name); addParentToTree(controller); } catch (Exception err) { log.error("Exception while adding a TestElement.", err); } }
private void viewSelectionChanged(final Component mapView) { if (!mPaneSelectionUpdate) { return; } Controller controller = Controller.getCurrentController(); if (mapView != controller.getMapViewManager().getMapViewComponent()) { controller.getMapViewManager().changeToMapView(mapView.getName()); } }
public boolean matches(Component c) { return super.matches(c) && (c.isShowing() || !mustBeShowing) && (stringsMatch(id, c.getName()) || (c instanceof Frame && stringsMatch(id, ((Frame)c).getTitle())) || (c instanceof Dialog && stringsMatch(id, ((Dialog)c).getTitle()))); } public String toString() {