Esempio n. 1
2
 /**
  * This function is used to re-run the analyser, and re-create the rows corresponding the its
  * results.
  */
 private void refreshReviewTable() {
   reviewPanel.removeAll();
   rows.clear();
   GridBagLayout gbl = new GridBagLayout();
   reviewPanel.setLayout(gbl);
   GridBagConstraints gbc = new GridBagConstraints();
   gbc.fill = GridBagConstraints.HORIZONTAL;
   gbc.gridy = 0;
   try {
     Map<String, Long> sums =
         analyser.processLogFile(config.getLogFilename(), fromDate.getDate(), toDate.getDate());
     for (Entry<String, Long> entry : sums.entrySet()) {
       String project = entry.getKey();
       double hours = 1.0 * entry.getValue() / (1000 * 3600);
       addRow(gbl, gbc, project, hours);
     }
     for (String project : main.getProjectsTree().getTopLevelProjects())
       if (!rows.containsKey(project)) addRow(gbl, gbc, project, 0);
     gbc.insets = new Insets(10, 0, 0, 0);
     addLeftLabel(gbl, gbc, "TOTAL");
     gbc.gridx = 1;
     gbc.weightx = 1;
     totalLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 3));
     gbl.setConstraints(totalLabel, gbc);
     reviewPanel.add(totalLabel);
     gbc.weightx = 0;
     addRightLabel(gbl, gbc);
   } catch (IOException e) {
     e.printStackTrace();
   }
   recomputeTotal();
   pack();
 }
  @Override
  public void disconnected(boolean onError) {
    final XMPPConnection connection = myFacade.getConnection();

    LOG.info("Jabber disconnected: " + connection.getUser());
    connection.removePacketListener(mySubscribeListener);
    mySubscribeListener = null;
    connection.removePacketListener(myMessageListener);
    myMessageListener = null;

    final Roster roster = connection.getRoster();
    if (roster != null) {
      roster.removeRosterListener(myRosterListener);
    }
    myRosterListener = null;

    myIDEtalkUsers.clear();
    myUser2Presence.clear();
    myUser2Thread.clear();

    if (onError && reconnectEnabledAndNotStarted()) {
      LOG.warn(getMsg("jabber.server.was.disconnected", myReconnectTimeout / 1000));
      myReconnectProcess = myIdeFacade.runOnPooledThread(new MyReconnectRunnable());
    }
  }
Esempio n. 3
0
  @Override
  public void readExternal(Element element) throws InvalidDataException {
    myMap.clear();
    myRendererColors.clear();
    final List children = element.getChildren(INFO_TAG);
    for (Object child : children) {
      final Element infoElement = (Element) child;

      final SeverityBasedTextAttributes highlightInfo =
          new SeverityBasedTextAttributes(infoElement);

      Color color = null;
      final String colorStr = infoElement.getAttributeValue(COLOR_ATTRIBUTE);
      if (colorStr != null) {
        color = new Color(Integer.parseInt(colorStr, 16));
      }
      registerSeverity(highlightInfo, color);
    }
    myReadOrder = new JDOMExternalizableStringList();
    myReadOrder.readExternal(element);
    List<HighlightSeverity> read = new ArrayList<HighlightSeverity>(myReadOrder.size());
    final List<HighlightSeverity> knownSeverities = getDefaultOrder();
    for (String name : myReadOrder) {
      HighlightSeverity severity = getSeverity(name);
      if (severity == null || !knownSeverities.contains(severity)) continue;
      read.add(severity);
    }
    OrderMap orderMap = fromList(read);
    if (orderMap.isEmpty()) {
      orderMap = fromList(knownSeverities);
    } else {
      // enforce include all known
      List<HighlightSeverity> list = getOrderAsList(orderMap);
      for (int i = 0; i < knownSeverities.size(); i++) {
        HighlightSeverity stdSeverity = knownSeverities.get(i);
        if (!list.contains(stdSeverity)) {
          for (int oIdx = 0; oIdx < list.size(); oIdx++) {
            HighlightSeverity orderSeverity = list.get(oIdx);
            HighlightInfoType type = STANDARD_SEVERITIES.get(orderSeverity.getName());
            if (type != null && knownSeverities.indexOf(type.getSeverity(null)) > i) {
              list.add(oIdx, stdSeverity);
              myReadOrder = null;
              break;
            }
          }
        }
      }
      orderMap = fromList(list);
    }
    myOrderMap = orderMap;
    severitiesChanged();
  }
 @TestOnly
 public void clearCodeStyleSettings() {
   CodeStyleSettings cleanSettings = new CodeStyleSettings();
   copyFrom(cleanSettings);
   myAdditionalIndentOptions.clear(); // hack
   myLoadedAdditionalIndentOptions = false;
 }
 private void releaseAllEditors() {
   for (final Editor editor : myEditors.values()) {
     if (!editor.isDisposed()) {
       EditorFactory.getInstance().releaseEditor(editor);
     }
   }
   myEditors.clear();
 }
Esempio n. 6
0
 /** Clear all contents */
 public void clear() {
   if (gr == null) return;
   gr.clearRect(0, 0, getSize().width, getSize().height);
   repaint();
   if (state != null) {
     synchronized (state) {
       state.clear();
     }
   }
 }
  /** ***************************************************************************** */
  @Override
  public void handleHistoryStarted() {
    synchronized (this) {
      update_needed = true;
      restart_needed = true;
      thread_colors.clear();
    }

    draw_area.repaint();
  }
  /** @throws BasicException */
  @Override
  public void loadCatalog() throws BasicException {
    m_jProducts.removeAll();
    m_productsset.clear();
    m_categoriesset.clear();

    // Load the taxes logic
    taxeslogic = new TaxesLogic(m_dlSales.getTaxList().list());

    buildProductPanel();
  }
Esempio n. 9
0
 @Override
 public void dispose() {
   setRefreshVisible(false);
   InlineProgressIndicator[] indicators =
       getCurrentInlineIndicators().toArray(new InlineProgressIndicator[0]);
   for (InlineProgressIndicator indicator : indicators) {
     Disposer.dispose(indicator);
   }
   myInline2Original.clear();
   myOriginal2Inlines.clear();
 }
 public void updateRepositoryPlugins() {
   myPlugin2host.clear();
   final JDOMExternalizableStringList pluginHosts = UpdateSettings.getInstance().myPluginHosts;
   for (String host : pluginHosts) {
     try {
       final ArrayList<PluginDownloader> downloaded = new ArrayList<PluginDownloader>();
       UpdateChecker.checkPluginsHost(host, downloaded, false, null);
       for (PluginDownloader downloader : downloaded) {
         myPlugin2host.put(downloader.getPluginId(), host);
       }
     } catch (Exception ignored) {
     }
   }
 }
Esempio n. 11
0
    /**
     * Read State (color dots) from input stream
     *
     * @param instream
     * @throws IOException
     */
    public void readState(InputStream instream) throws IOException {
      DataInputStream in = new DataInputStream(new BufferedInputStream(instream));
      Map<Point, Color> new_state = new LinkedHashMap<Point, Color>();
      int num = in.readInt();
      for (int i = 0; i < num; i++) {
        Point point = new Point(in.readInt(), in.readInt());
        Color col = new Color(in.readInt());
        new_state.put(point, col);
      }

      synchronized (state) {
        state.clear();
        state.putAll(new_state);
        System.out.println("read " + state.size() + " elements");
        createOffscreenImage(true);
      }
    }
 private void rebuildTree() {
   final TreeStateSnapshot treeStateSnapshot = new TreeStateSnapshot(this);
   myRootNode.removeAllChildren();
   myDescriptorToNodeMap.clear();
   myDescriptorToNodeMap.put((TreeDescriptor) myRootNode.getUserObject(), myRootNode);
   // build tree
   for (final Breakpoint breakpoint : myBreakpoints) {
     CheckedTreeNode node = createNode(new BreakpointDescriptor(breakpoint));
     node.setChecked(breakpoint.ENABLED);
     addNode(node);
   }
   // remove all package nodes with one child
   final int count = myRootNode.getChildCount();
   final List<CheckedTreeNode> children = new ArrayList<CheckedTreeNode>();
   for (int idx = 0; idx < count; idx++) {
     CheckedTreeNode child = (CheckedTreeNode) myRootNode.getChildAt(idx);
     if (!(child.getUserObject() instanceof PackageDescriptor)) {
       children.add(child);
       continue;
     }
     while (child.getUserObject() instanceof PackageDescriptor && child.getChildCount() <= 1) {
       child = (CheckedTreeNode) child.getChildAt(0);
     }
     if (!(child.getUserObject() instanceof PackageDescriptor)) {
       child = (CheckedTreeNode) child.getParent();
     }
     for (CheckedTreeNode childToRemove = (CheckedTreeNode) child.getParent();
         !childToRemove.equals(myRootNode);
         childToRemove = (CheckedTreeNode) childToRemove.getParent()) {
       myDescriptorToNodeMap.remove(childToRemove.getUserObject());
     }
     children.add(child);
   }
   for (final CheckedTreeNode aChildren : children) {
     aChildren.removeFromParent();
   }
   myRootNode.removeAllChildren();
   for (final CheckedTreeNode child : children) {
     myRootNode.add(child);
   }
   sortChildren(myRootNode);
   ((DefaultTreeModel) getModel()).nodeStructureChanged(myRootNode);
   treeStateSnapshot.restore(this);
   expandPath(new TreePath(myRootNode));
 }
 public void apply() throws ConfigurationException {
   if (!myModifiedModificators.isEmpty()) {
     mySdkSettingsWereModified.run();
   }
   for (SdkModificator modificator : myModifiedModificators) {
     /* This should always be true barring bug elsewhere, log error on else? */
     if (modificator.isWritable()) {
       modificator.commitChanges();
     }
   }
   myModificators.clear();
   myModifiedModificators.clear();
   mySdkListChanged = false;
   final Sdk sdk = getSelectedSdk();
   myShowMoreCallback.consume(sdk);
   PyPackageManagers.getInstance().clearCache(sdk);
   Disposer.dispose(getDisposable());
 }
  private void reset() {
    ApplicationManager.getApplication().assertIsDispatchThread();

    myUsageNodes.clear();
    myIsFirstVisibleUsageFound = false;

    myModel.reset();
    if (!myPresentation.isDetachedMode()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            @Override
            public void run() {
              if (isDisposed) return;
              TreeUtil.expand(myTree, 2);
            }
          });
    }
  }
Esempio n. 15
0
    public static void makeGroupsAndAlignments(
        View dup, View original, WordCollection collection, boolean copy) throws DatabaseException {
      // loop through entries
      Map groups = new HashMap();
      List entries = collection.getEntries();
      for (Iterator it = entries.iterator(); it.hasNext(); ) {
        // groups are unique to each entry
        groups.clear();
        Entry entry = (Entry) it.next();

        // loop through alignments
        List alignments = original.getAlignments(entry);
        for (Iterator it2 = alignments.iterator(); it2.hasNext(); ) {
          Alignment alignment = (Alignment) it2.next();
          Group group = (copy) ? alignment.getGroup() : null;

          // get or create duplicate group
          String name = (group == null) ? "?" : group.getName();
          Group dupGroup = (Group) groups.get(name);
          if (dupGroup == null) {
            dupGroup = dup.makeGroup(entry);
            dupGroup.setName(name);
            dupGroup.setDone(false);
            dupGroup.save();
            groups.put(dupGroup.getName(), dupGroup);
          }

          // create duplicate alignment
          Alignment dupAlignment = dup.makeAlignment(alignment.getDatum());
          dupAlignment.setName(alignment.getName());
          dupAlignment.setGroup(dupGroup);
          if (copy) {
            dupAlignment.setVector(alignment.getVector());
            dupAlignment.setMetathesis1(alignment.getMetathesis1());
            dupAlignment.setLength1(alignment.getLength1());
            dupAlignment.setMetathesis2(alignment.getMetathesis2());
            dupAlignment.setLength2(alignment.getLength2());
            dupAlignment.setObservations(alignment.getObservations());
          }
          dupAlignment.save();
        }
      }
    }
Esempio n. 16
0
 /**
  * Deselects the specified objects from the list and keep all previous selections.
  *
  * @param objects the objects to be selected
  */
 public void removeCheckBoxListSelectedValues(Object[] objects) {
   if (objects != null) {
     Map<Object, String> map = new HashMap<Object, String>();
     for (Object o : objects) {
       map.put(o, "");
     }
     int i, c;
     ListModel model = getModel();
     boolean changed = false;
     for (i = 0, c = model.getSize(); i < c; i++)
       if (map.get(model.getElementAt(i)) != null) {
         removeCheckBoxListSelectedIndex(i);
         changed = true;
       }
     if (changed) {
       repaint();
     }
     map.clear();
   }
 }
Esempio n. 17
0
 public void discoveryItemResult(JID jid, DiscoveryItem item) {
   // System.out.println(browse);
   if (!item.hasItems())
     nu.fw.jeti.util.Popups.errorPopup(
         I18N.gettext("main.error.No_services"), I18N.gettext("main.error.Register_Services"));
   else {
     numberOfServices = 0;
     DefaultListModel model = (DefaultListModel) jList1.getModel();
     services.clear();
     model.clear();
     for (Iterator i = item.getItems(); i.hasNext(); ) {
       DiscoveryItem di = (DiscoveryItem) i.next();
       String name = di.getName();
       if (name == null) name = di.getJID().toStringNoResource();
       // put in services so errors do not prevent register
       services.put(name, di.getJID());
       model.addElement(name);
       backend.getInfo(di.getJID(), this);
       numberOfServices++;
     }
   }
   pack();
   setLocationRelativeTo(null);
 }
 public void clear() {
   myElements.clear();
   myMarkedMap.clear();
   fireTableDataChanged();
 }
 public void disposeUIResources() {
   myPathToFileMap.clear();
 }
 public void clear() {
   myTableModel.clear();
   myElementToPropertiesMap.clear();
 }
Esempio n. 21
0
 void initStyles(Font defaultFont) {
   this.defaultFont = defaultFont;
   stylesCache.clear();
 }
  private void recreateEditorsPanel() {
    myValuesPanel.removeAll();
    myValuesPanel.setLayout(new CardLayout());

    if (!myProject.isOpen()) return;
    JPanel valuesPanelComponent = new MyJPanel(new GridBagLayout());
    myValuesPanel.add(
        new JBScrollPane(valuesPanelComponent) {
          @Override
          public void updateUI() {
            super.updateUI();
            getViewport().setBackground(UIUtil.getPanelBackground());
          }
        },
        VALUES);
    myValuesPanel.add(myNoPropertySelectedPanel, NO_PROPERTY_SELECTED);

    List<PropertiesFile> propertiesFiles = myResourceBundle.getPropertiesFiles();

    GridBagConstraints gc =
        new GridBagConstraints(
            0,
            0,
            0,
            0,
            0,
            0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH,
            new Insets(5, 5, 5, 5),
            0,
            0);
    releaseAllEditors();
    myTitledPanels.clear();
    int y = 0;
    Editor previousEditor = null;
    Editor firstEditor = null;
    for (final PropertiesFile propertiesFile : propertiesFiles) {
      final Editor editor = createEditor();
      final Editor oldEditor = myEditors.put(propertiesFile, editor);
      if (firstEditor == null) {
        firstEditor = editor;
      }
      if (previousEditor != null) {
        editor.putUserData(
            ChooseSubsequentPropertyValueEditorAction.PREV_EDITOR_KEY, previousEditor);
        previousEditor.putUserData(
            ChooseSubsequentPropertyValueEditorAction.NEXT_EDITOR_KEY, editor);
      }
      previousEditor = editor;
      if (oldEditor != null) {
        EditorFactory.getInstance().releaseEditor(oldEditor);
      }
      ((EditorEx) editor)
          .addFocusListener(
              new FocusChangeListener() {
                @Override
                public void focusGained(final Editor editor) {
                  mySelectedEditor = editor;
                }

                @Override
                public void focusLost(final Editor eventEditor) {
                  writeEditorPropertyValue(editor, propertiesFile, null);
                }
              });
      gc.gridx = 0;
      gc.gridy = y++;
      gc.gridheight = 1;
      gc.gridwidth = GridBagConstraints.REMAINDER;
      gc.weightx = 1;
      gc.weighty = 1;
      gc.anchor = GridBagConstraints.CENTER;

      Locale locale = propertiesFile.getLocale();
      List<String> names = new ArrayList<String>();
      if (!Comparing.strEqual(locale.getDisplayLanguage(), null)) {
        names.add(locale.getDisplayLanguage());
      }
      if (!Comparing.strEqual(locale.getDisplayCountry(), null)) {
        names.add(locale.getDisplayCountry());
      }
      if (!Comparing.strEqual(locale.getDisplayVariant(), null)) {
        names.add(locale.getDisplayVariant());
      }

      String title = propertiesFile.getName();
      if (!names.isEmpty()) {
        title += " (" + StringUtil.join(names, "/") + ")";
      }
      JComponent comp =
          new JPanel(new BorderLayout()) {
            @Override
            public Dimension getPreferredSize() {
              Insets insets = getBorder().getBorderInsets(this);
              return new Dimension(100, editor.getLineHeight() * 4 + insets.top + insets.bottom);
            }
          };
      comp.add(editor.getComponent(), BorderLayout.CENTER);
      comp.setBorder(IdeBorderFactory.createTitledBorder(title, true));
      myTitledPanels.put(propertiesFile, (JPanel) comp);

      valuesPanelComponent.add(comp, gc);
    }
    if (previousEditor != null) {
      previousEditor.putUserData(
          ChooseSubsequentPropertyValueEditorAction.NEXT_EDITOR_KEY, firstEditor);
      firstEditor.putUserData(
          ChooseSubsequentPropertyValueEditorAction.PREV_EDITOR_KEY, previousEditor);
    }

    gc.gridx = 0;
    gc.gridy = y;
    gc.gridheight = GridBagConstraints.REMAINDER;
    gc.gridwidth = GridBagConstraints.REMAINDER;
    gc.weightx = 10;
    gc.weighty = 1;

    valuesPanelComponent.add(new JPanel(), gc);
    selectionChanged();
    myValuesPanel.repaint();
    UIUtil.invokeAndWaitIfNeeded(
        new Runnable() {
          @Override
          public void run() {
            updateEditorsFromProperties();
          }
        });
  }
    public String setup(
        final String[] texts,
        final EnumSet<ParameterInfoUIContextEx.Flag>[] flags,
        final Color background) {
      StringBuilder buf = new StringBuilder();
      removeAll();
      final String[] lines =
          UIUtil.splitText(StringUtil.join(texts), getFontMetrics(BOLD_FONT), myWidthLimit, ',');

      int index = 0;
      int curOffset = 0;

      myOneLineComponents = new OneLineComponent[lines.length];

      Map<TextRange, ParameterInfoUIContextEx.Flag> flagsMap =
          new TreeMap<TextRange, ParameterInfoUIContextEx.Flag>(TEXT_RANGE_COMPARATOR);

      int added = 0;
      for (int i = 0; i < texts.length; i++) {
        String line = escapeString(texts[i]);
        if (lines.length <= index) break;
        String text = lines[index];
        final int paramCount = StringUtil.split(text, ", ").size();
        final EnumSet<ParameterInfoUIContextEx.Flag> flag = flags[i];
        if (flag.contains(ParameterInfoUIContextEx.Flag.HIGHLIGHT)) {
          flagsMap.put(
              TextRange.create(curOffset, curOffset + line.trim().length()),
              ParameterInfoUIContextEx.Flag.HIGHLIGHT);
        }

        if (flag.contains(ParameterInfoUIContextEx.Flag.DISABLE)) {
          flagsMap.put(
              TextRange.create(curOffset, curOffset + line.trim().length()),
              ParameterInfoUIContextEx.Flag.DISABLE);
        }

        if (flag.contains(ParameterInfoUIContextEx.Flag.STRIKEOUT)) {
          flagsMap.put(
              TextRange.create(curOffset, curOffset + line.trim().length()),
              ParameterInfoUIContextEx.Flag.STRIKEOUT);
        }

        curOffset += line.length();
        if (i == paramCount + added - 1) {
          myOneLineComponents[index] = new OneLineComponent();
          setBackground(background);
          buf.append(myOneLineComponents[index].setup(escapeString(text), flagsMap, background));
          add(
              myOneLineComponents[index],
              new GridBagConstraints(
                  0,
                  index,
                  1,
                  1,
                  1,
                  0,
                  GridBagConstraints.WEST,
                  GridBagConstraints.NONE,
                  new Insets(0, 0, 0, 0),
                  0,
                  0));
          index += 1;
          flagsMap.clear();
          curOffset = 1;
          added += paramCount;
        }
      }
      return buf.toString();
    }
 public void clear() {
   myElements.clear();
   myDirNameMap.clear();
   fireTableDataChanged();
 }
Esempio n. 25
0
  private boolean subtaskPlanning(Problem problem, EvaluationAlgorithm algorithm) {

    if (isSubtaskLoggingOn())
      logger.debug("!!!--------- Starting Planning With Subtasks ---------!!!");

    final int maxDepthBackup = maxDepth;
    if (isSubtaskLoggingOn())
      logger.debug(
          "maxDepthBackup:" + maxDepthBackup + " sbt: " + problem.getRelsWithSubtasks().size());
    PlanningContext context = problem.getCurrentContext();

    try {

      Set<Rel> relsWithSubtasks = new LinkedHashSet<Rel>(problem.getRelsWithSubtasks());

      if (isIncremental) {
        int incrementalDepth = 0;

        while (incrementalDepth
            <= (isSubtaskRepetitionAllowed
                ? maxDepthBackup
                : problem.getRelsWithSubtasks().size() - 1)) {
          if (isSubtaskLoggingOn())
            logger.debug(
                "Incremental dfs, with max depth "
                    + (incrementalDepth + 1)
                    + " and "
                    + problem.getRelsWithSubtasks().size()
                    + " subtasks to solve");

          maxDepth = incrementalDepth++;

          // if we need to compute some specific goals, after reaching a certain depth, but not the
          // maximal depth,
          // the problem may be solved and there is no need to go any deeper.
          if (subtaskPlanningImpl(context, relsWithSubtasks, algorithm, new LinkedList<Rel>(), 0)) {
            if (isSubtaskLoggingOn())
              logger.debug("The problem was solved during idfs after some intermediate MLB");
            return true;
          }

          if (isSubtaskLoggingOn())
            logger.debug("Unsolved subtask left: " + problem.getRelsWithSubtasks().size());
        }

        if (isSubtaskLoggingOn()) logger.debug("Fininshed incremental dfs");

      } else {
        if (!isSubtaskRepetitionAllowed) {
          maxDepth = problem.getRelsWithSubtasks().size() - 1;
        }

        if (isSubtaskLoggingOn())
          logger.debug("Starting subtask dfs with maxDepth: " + (maxDepth + 1));

        if (subtaskPlanningImpl(context, relsWithSubtasks, algorithm, new LinkedList<Rel>(), 0)) {
          if (isSubtaskLoggingOn())
            logger.debug("The problem was solved during dfs after some intermediate MLB");
          return true;
        }
      }

    } finally {
      if (isSubtaskLoggingOn()) logger.debug("Fininshed dfs");

      maxDepth = maxDepthBackup;
      indSubtasks.clear();
    }

    if (isSubtaskLoggingOn()) logger.debug("Invoking final linear planning");

    return linearForwardSearch(context, algorithm, computeAll);
  }
  private void doRead(@NotNull final Element parentNode) {
    ApplicationManager.getApplication()
        .runReadAction(
            new Runnable() {
              @Override
              @SuppressWarnings({"HardCodedStringLiteral"})
              public void run() {
                final Map<String, Breakpoint> nameToBreakpointMap =
                    new THashMap<String, Breakpoint>();
                try {
                  final List groups = parentNode.getChildren();
                  for (final Object group1 : groups) {
                    final Element group = (Element) group1;
                    if (group.getName().equals(RULES_GROUP_NAME)) {
                      continue;
                    }
                    // skip already converted
                    if (group.getAttribute(CONVERTED_PARAM) != null) {
                      continue;
                    }
                    final String categoryName = group.getName();
                    final Key<Breakpoint> breakpointCategory =
                        BreakpointCategory.lookup(categoryName);
                    final String defaultPolicy =
                        group.getAttributeValue(DEFAULT_SUSPEND_POLICY_ATTRIBUTE_NAME);
                    final boolean conditionEnabled =
                        Boolean.parseBoolean(
                            group.getAttributeValue(
                                DEFAULT_CONDITION_STATE_ATTRIBUTE_NAME, "true"));
                    setBreakpointDefaults(
                        breakpointCategory,
                        new BreakpointDefaults(defaultPolicy, conditionEnabled));
                    Element anyExceptionBreakpointGroup;
                    if (!AnyExceptionBreakpoint.ANY_EXCEPTION_BREAKPOINT.equals(
                        breakpointCategory)) {
                      // for compatibility with previous format
                      anyExceptionBreakpointGroup =
                          group.getChild(
                              AnyExceptionBreakpoint.ANY_EXCEPTION_BREAKPOINT.toString());
                      // final BreakpointFactory factory =
                      // BreakpointFactory.getInstance(breakpointCategory);
                      // if (factory != null) {
                      for (Element breakpointNode : group.getChildren("breakpoint")) {
                        // Breakpoint breakpoint = factory.createBreakpoint(myProject,
                        // breakpointNode);
                        Breakpoint breakpoint = createBreakpoint(categoryName, breakpointNode);
                        breakpoint.readExternal(breakpointNode);
                        nameToBreakpointMap.put(breakpoint.getDisplayName(), breakpoint);
                      }
                      // }
                    } else {
                      anyExceptionBreakpointGroup = group;
                    }

                    if (anyExceptionBreakpointGroup != null) {
                      final Element breakpointElement = group.getChild("breakpoint");
                      if (breakpointElement != null) {
                        XBreakpointManager manager =
                            XDebuggerManager.getInstance(myProject).getBreakpointManager();
                        JavaExceptionBreakpointType type =
                            (JavaExceptionBreakpointType)
                                XDebuggerUtil.getInstance()
                                    .findBreakpointType(JavaExceptionBreakpointType.class);
                        XBreakpoint<JavaExceptionBreakpointProperties> xBreakpoint =
                            manager.getDefaultBreakpoint(type);
                        Breakpoint breakpoint = createJavaBreakpoint(xBreakpoint);
                        breakpoint.readExternal(breakpointElement);
                        addBreakpoint(breakpoint);
                      }
                    }
                  }
                } catch (InvalidDataException ignored) {
                }

                final Element rulesGroup = parentNode.getChild(RULES_GROUP_NAME);
                if (rulesGroup != null) {
                  final List<Element> rules = rulesGroup.getChildren("rule");
                  for (Element rule : rules) {
                    // skip already converted
                    if (rule.getAttribute(CONVERTED_PARAM) != null) {
                      continue;
                    }
                    final Element master = rule.getChild(MASTER_BREAKPOINT_TAGNAME);
                    if (master == null) {
                      continue;
                    }
                    final Element slave = rule.getChild(SLAVE_BREAKPOINT_TAGNAME);
                    if (slave == null) {
                      continue;
                    }
                    final Breakpoint masterBreakpoint =
                        nameToBreakpointMap.get(master.getAttributeValue("name"));
                    if (masterBreakpoint == null) {
                      continue;
                    }
                    final Breakpoint slaveBreakpoint =
                        nameToBreakpointMap.get(slave.getAttributeValue("name"));
                    if (slaveBreakpoint == null) {
                      continue;
                    }

                    boolean leaveEnabled =
                        "true".equalsIgnoreCase(rule.getAttributeValue("leaveEnabled"));
                    XDependentBreakpointManager dependentBreakpointManager =
                        ((XBreakpointManagerImpl) getXBreakpointManager())
                            .getDependentBreakpointManager();
                    dependentBreakpointManager.setMasterBreakpoint(
                        slaveBreakpoint.myXBreakpoint,
                        masterBreakpoint.myXBreakpoint,
                        leaveEnabled);
                    // addBreakpointRule(new EnableBreakpointRule(BreakpointManager.this,
                    // masterBreakpoint, slaveBreakpoint, leaveEnabled));
                  }
                }

                DebuggerInvocationUtil.invokeLater(
                    myProject,
                    new Runnable() {
                      @Override
                      public void run() {
                        updateBreakpointsUI();
                      }
                    });
              }
            });

    myUIProperties.clear();
    final Element props = parentNode.getChild("ui_properties");
    if (props != null) {
      final List children = props.getChildren("property");
      for (Object child : children) {
        Element property = (Element) child;
        final String name = property.getAttributeValue("name");
        final String value = property.getAttributeValue("value");
        if (name != null && value != null) {
          myUIProperties.put(name, value);
        }
      }
    }
  }
 @Override
 protected void resetDefaultNames() {
   myRenamedFields.clear();
 }
    public String setup(
        final String[] texts,
        Function<String, String> escapeFunction,
        final EnumSet<ParameterInfoUIContextEx.Flag>[] flags,
        final Color background) {
      StringBuilder buf = new StringBuilder();
      removeAll();
      setBackground(background);
      int index = 0;
      int curOffset = 0;
      final ArrayList<OneLineComponent> components = new ArrayList<>();

      Map<TextRange, ParameterInfoUIContextEx.Flag> flagsMap = new TreeMap<>(TEXT_RANGE_COMPARATOR);

      String line = "";
      for (int i = 0; i < texts.length; i++) {
        String paramText = escapeString(texts[i], escapeFunction);
        if (paramText == null) break;
        line += texts[i];
        final EnumSet<ParameterInfoUIContextEx.Flag> flag = flags[i];
        if (flag.contains(ParameterInfoUIContextEx.Flag.HIGHLIGHT)) {
          flagsMap.put(
              TextRange.create(curOffset, curOffset + paramText.trim().length()),
              ParameterInfoUIContextEx.Flag.HIGHLIGHT);
        }

        if (flag.contains(ParameterInfoUIContextEx.Flag.DISABLE)) {
          flagsMap.put(
              TextRange.create(curOffset, curOffset + paramText.trim().length()),
              ParameterInfoUIContextEx.Flag.DISABLE);
        }

        if (flag.contains(ParameterInfoUIContextEx.Flag.STRIKEOUT)) {
          flagsMap.put(
              TextRange.create(curOffset, curOffset + paramText.trim().length()),
              ParameterInfoUIContextEx.Flag.STRIKEOUT);
        }

        curOffset += paramText.length();
        if (line.length() >= 50) {
          final OneLineComponent component = new OneLineComponent();
          buf.append(component.setup(escapeString(line, escapeFunction), flagsMap, background));
          add(
              component,
              new GridBagConstraints(
                  0,
                  index,
                  1,
                  1,
                  1,
                  0,
                  GridBagConstraints.WEST,
                  GridBagConstraints.NONE,
                  new Insets(0, 0, 0, 0),
                  0,
                  0));
          index += 1;
          flagsMap.clear();
          curOffset = 0;
          line = "";
          components.add(component);
        }
      }
      final OneLineComponent component = new OneLineComponent();
      buf.append(component.setup(escapeString(line, escapeFunction), flagsMap, background));
      add(
          component,
          new GridBagConstraints(
              0,
              index,
              1,
              1,
              1,
              0,
              GridBagConstraints.WEST,
              GridBagConstraints.NONE,
              new Insets(0, 0, 0, 0),
              0,
              0));
      components.add(component);
      myOneLineComponents = components.toArray(new OneLineComponent[components.size()]);
      return buf.toString();
    }