protected void removeContents(Content notToRemove, final String tabDisplayName) { MessageView messageView = MessageView.SERVICE.getInstance(myProject); Content[] contents = messageView.getContentManager().getContents(); for (Content content : contents) { LOG.assertTrue(content != null); if (content.isPinned()) continue; if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) { ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent(); if (listErrorView != null) { if (messageView.getContentManager().removeContent(content, true)) { content.release(); } } } } }
private static void removeContents(@Nullable final Content notToRemove, @NotNull final Project myProject, @NotNull final String tabDisplayName) { MessageView messageView = ServiceManager.getService(myProject, MessageView.class); Content[] contents = messageView.getContentManager().getContents(); for (Content content : contents) { LOG.assertTrue(content != null); if (content.isPinned()) continue; if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) { ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent(); if (listErrorView != null) { if (messageView.getContentManager().removeContent(content, true)) { content.release(); } } } } }
private static void removeContents(@Nullable final Content notToRemove, @Nonnull final Project myProject, @Nonnull final String tabDisplayName) { MessageView messageView = ServiceManager.getService(myProject, MessageView.class); Content[] contents = messageView.getContentManager().getContents(); for (Content content : contents) { LOG.assertTrue(content != null); if (content.isPinned()) continue; if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) { ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent(); if (listErrorView != null) { if (messageView.getContentManager().removeContent(content, true)) { content.release(); } } } } }
private void addMessage(final ErrorTreeView view, final String[] message, final int type) { ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { final long start = System.currentTimeMillis(); view.addMessage(type, message, null, -1, -1, null); final long duration = System.currentTimeMillis() - start; myMillis += duration; incMessageCount(); } }, ModalityState.NON_MODAL); }
private void removeCompileContents(Content notToRemove) { MessageView messageView = MessageView.SERVICE.getInstance(myProject); for (Content content : messageView.getContentManager().getContents()) { if (content.isPinned()) continue; if (CONTENT_NAME.equals(content.getDisplayName()) && content != notToRemove) { ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent(); if (listErrorView != null) { if (messageView.getContentManager().removeContent(content, true)) { content.release(); } } } } }
private void removeOldContents(Content notToRemove) { MessageView messageView = MessageView.SERVICE.getInstance(myProject); for (Content content : messageView.getContentManager().getContents()) { if (content.isPinned()) continue; if (myContentName.equals(content.getDisplayName()) && content != notToRemove) { ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent(); if (listErrorView != null) { if (messageView.getContentManager().removeContent(content, true)) { content.release(); } } } } }
protected void showErrors(final CvsHandler handler, final CvsTabbedWindow tabbedWindow) { final List<VcsException> errors = handler.getErrorsExceptAborted(); if (!myShowErrors || myIsQuietOperation) return; if (tabbedWindow == null) { if (errors.isEmpty()) return; final List<String> messages = new ArrayList<String>(); for (VcsException error : errors) { if (! StringUtil.isEmptyOrSpaces(error.getMessage())) { messages.add(error.getMessage()); } } final String errorMessage = StringUtil.join(messages, "\n"); Messages.showErrorDialog(errorMessage, "CVS Error"); return; } if (!errors.isEmpty()) { ErrorTreeView errorTreeView = tabbedWindow.getErrorsTreeView(); for (final VcsException exception : errors) { final String groupName = DateFormatUtil.formatDateTime(System.currentTimeMillis()) + ' ' + handler.getTitle(); if (exception.isWarning()) { errorTreeView.addMessage(MessageCategory.WARNING, exception.getMessages(), groupName, NonNavigatable.INSTANCE, null, null, exception); } else { errorTreeView.addMessage(MessageCategory.ERROR, exception.getMessages(), groupName, NonNavigatable.INSTANCE, null, null, exception); } } } }
public ErrorTreeView getErrorsTreeView() { if (myErrorsView == null) { myErrorsView = ErrorViewFactory.SERVICE.getInstance() .createErrorTreeView(myProject, null, true, new AnAction[]{(DefaultActionGroup)ActionManager.getInstance().getAction("CvsActions")}, new AnAction[]{new GlobalCvsSettingsAction(), new ReconfigureCvsRootAction()}, new ContentManagerProvider() { public ContentManager getParentContent() { return getToolWindow().getContentManager(); } }); addTab(CvsBundle.message("tab.title.errors"), myErrorsView.getComponent(), true, false, true, false, null, "cvs.errors"); } getToolWindow().activate(null, false); return myErrorsView; }
protected void showErrors(final CvsHandler handler, final CvsTabbedWindow tabbedWindow) { final List<VcsException> errors = handler.getErrorsExceptAborted(); if (!myShowErrors || myIsQuietOperation) return; if (tabbedWindow == null) { if (errors.isEmpty()) return; final List<String> messages = new ArrayList<String>(); for (VcsException error : errors) { if (! StringUtil.isEmptyOrSpaces(error.getMessage())) { messages.add(error.getMessage()); } } final String errorMessage = StringUtil.join(messages, "\n"); Messages.showErrorDialog(errorMessage, "CVS Error"); return; } if (errors.isEmpty()) { tabbedWindow.hideErrors(); } else { ErrorTreeView errorTreeView = tabbedWindow.getErrorsTreeView(); for (final VcsException exception : errors) { final String groupName = DateFormatUtil.formatDateTime(System.currentTimeMillis()) + ' ' + handler.getTitle(); if (exception.isWarning()) { errorTreeView.addMessage(MessageCategory.WARNING, exception.getMessages(), groupName, DummyNavigatable.INSTANCE, null, null, exception); } else { errorTreeView.addMessage(MessageCategory.ERROR, exception.getMessages(), groupName, DummyNavigatable.INSTANCE, null, null, exception); } } tabbedWindow.ensureVisible(myProject); } }
public ErrorTreeView getErrorsTreeView() { if (myErrorsView == null) { myErrorsView = ErrorViewFactory.SERVICE.getInstance() .createErrorTreeView(myProject, null, true, new AnAction[]{(DefaultActionGroup)ActionManager.getInstance().getAction("CvsActions")}, new AnAction[]{new GlobalCvsSettingsAction(), new ReconfigureCvsRootAction()}, new ContentManagerProvider() { public ContentManager getParentContent() { return getContentManager(); } }); addTab(CvsBundle.message("tab.title.errors"), myErrorsView.getComponent(), true, false, true, false, null, "cvs.errors"); } return myErrorsView; }
ErrorTreeView createErrorTreeView(Project project, @Nullable String helpId, boolean createExitAction, AnAction[] extraPopupMenuActions, AnAction[] extraRightToolbarGroupActions, ContentManagerProvider contentManagerProvider);
protected ErrorTreeView createView(Project project) { return new NewErrorTreeViewPanel(project, null); }
public void update(AnActionEvent e) { super.update(e); Object data = ErrorTreeView.CURRENT_EXCEPTION_DATA_KEY.getData(e.getDataContext()); e.getPresentation().setEnabled(data instanceof CvsException); }
public void actionPerformed(AnActionEvent e) { Object data = ErrorTreeView.CURRENT_EXCEPTION_DATA_KEY.getData(e.getDataContext()); CvsConfigurationsListEditor.reconfigureCvsRoot(((CvsException)data).getCvsRoot(), myProject); }
protected abstract ErrorTreeView createView(Project project);