@Transient public void setSelectedExchangeCurrencyPairs(Set<SelectedExchangeCurrencyPair> selectedExchangeCurrencyPairs) { this.selectedExchangeCurrencyPairs = selectedExchangeCurrencyPairs; for (SelectedExchangeCurrencyPair selectedExchangeCurrencyPair : selectedExchangeCurrencyPairs) { StringJoiner stringJoiner = new StringJoiner(","); for (CurrencyPair currencyPair : selectedExchangeCurrencyPair.getCurrencyPairList()) { stringJoiner.add(currencyPair.toString()); } if (StringUtils.isNotBlank(stringJoiner.toString())) { currencyPairByExchangeMap.put(selectedExchangeCurrencyPair.getExchangeName(), stringJoiner.toString()); } } }
@Transient public void suppressItem(KeyPromoterAction action) { StatisticsItem removed = statistics.remove(action.getDescription()); removed = removed == null ? new StatisticsItem(action) : removed; suppressed.putIfAbsent(action.getDescription(), removed); myChangeSupport.firePropertyChange(SUPPRESS, null, null); myChangeSupport.firePropertyChange(STATISTIC, null, null); }
/** * Puts an item from the suppress list back into the statistics. * @param item Item to unsuppress */ @Transient void unsuppressItem(StatisticsItem item) { final StatisticsItem statisticsItem = suppressed.remove(item.getDescription()); if (statisticsItem != null && statisticsItem.count > 0) { statistics.putIfAbsent(statisticsItem.getDescription(), statisticsItem); } myChangeSupport.firePropertyChange(SUPPRESS, null, null); myChangeSupport.firePropertyChange(STATISTIC, null, null); }
@Transient public void setAuthorsAsString(String[] authors) { this.authors = new ArrayList<>(); for (String name : authors) { final List<String> firstLast = StringUtil.split(name, " "); if (!firstLast.isEmpty()) { final StepicUser stepicUser = StepicUser.createEmptyUser(); stepicUser.setFirstName(firstLast.remove(0)); if (firstLast.size() > 0) { stepicUser.setLastName(StringUtil.join(firstLast, " ")); } this.authors.add(stepicUser); } } }
@Transient @Nullable public PhpInterpreter getPhpInterpreter(@NotNull Project project) { return phpInterpreterId != null ? PhpInterpretersManagerImpl.getInstance(project).findInterpreterById(phpInterpreterId) : PhpProjectConfigurationFacade.getInstance(project).getInterpreter(); }
@Transient public ClassFilter[] getSteppingFilters() { final ClassFilter[] rv = new ClassFilter[mySteppingFilters.length]; for (int idx = 0; idx < rv.length; idx++) { rv[idx] = mySteppingFilters[idx].clone(); } return rv; }
@Transient public void setProjectDictionary(ProjectDictionary projectDictionary) { dictionaryStates.clear(); Set<EditableDictionary> projectDictionaries = projectDictionary.getDictionaries(); if (projectDictionaries != null) { for (EditableDictionary dic : projectDictionary.getDictionaries()) { dictionaryStates.add(new DictionaryState(dic)); } } }
@Transient public ProjectDictionary getProjectDictionary() { if (projectDictionary == null) { projectDictionary = new ProjectDictionary(); } return projectDictionary; }
@Transient @Override public CloudProxySettings getProxySettings() { final HttpConfigurable httpConfigurable = HttpConfigurable.getInstance(); return new CloudProxySettings() { @Override public boolean useHttpProxy() { return httpConfigurable.USE_HTTP_PROXY; } @Override public String getHost() { return httpConfigurable.PROXY_HOST; } @Override public int getPort() { return httpConfigurable.PROXY_PORT; } @Override public boolean useAuthentication() { return httpConfigurable.PROXY_AUTHENTICATION; } @Override public String getLogin() { return httpConfigurable.PROXY_LOGIN; } @Override public String getPassword() { return httpConfigurable.getPlainProxyPassword(); } }; }
@Nullable @Transient public Module getModule() { if (myModuleName != null) { //caching myModule = findModule(myModuleName); } if (myModule != null && myModule.isDisposed()) { myModule = null; } return myModule; }
@Transient public Formatter createFormatter() { if (type == CommitCompletionType.SIMPLE) { return SimpleFormatter.instance; } else if (type == CommitCompletionType.PATTERN) { return RegExpFormatter.create(pattern); } else { throw new IllegalStateException("Unsupported type " + type); } }
@Transient public String getPresentableText() { if (type == CommitCompletionType.SIMPLE) { return "Branch name"; } else if (type == CommitCompletionType.PATTERN) { return pattern; } else { throw new IllegalStateException("Unsupported type " + type); } }
@Transient public void setProjectDictionary(ProjectDictionary projectDictionary) { currentUser = projectDictionary.getActiveName(); dictionaryStates.clear(); Set<EditableDictionary> projectDictionaries = projectDictionary.getDictionaries(); if (projectDictionaries != null) { for (EditableDictionary dic : projectDictionary.getDictionaries()) { dictionaryStates.add(new DictionaryState(dic)); } } }
@Transient public ProjectDictionary getProjectDictionary() { if (projectDictionary==null){ projectDictionary = new ProjectDictionary(); } return projectDictionary; }
@Transient public Color getCurrentRegularDecorationColor() { if (customRegularColor) { return getRegularDecorationColor(); } else { return defaultRegularColor; } }
@Transient public Color getCurrentDarkDecorationColor() { if (customDarkColor) { return getDarkDecorationColor(); } else { return defaultDarkColor; } }
@Transient public ClassFilter[] getSteppingFilters() { final ClassFilter[] rv = new ClassFilter[mySteppingFilters.length]; for(int idx = 0; idx < rv.length; idx++) { rv[idx] = mySteppingFilters[idx].clone(); } return rv; }
@Transient public Set<SelectedExchangeCurrencyPair> getSelectedExchangeCurrencyPairs() { return selectedExchangeCurrencyPairs; }
@Transient public void registerEvent() { count++; }
@Transient public int getCount() { return count; }
/** * Comparator that is used to sort the entries by how often a shortcut was missed * @param o other item * @return result of the comparison */ @Transient @Override public int compareTo(@NotNull StatisticsItem o) { return o.count - count; }
@Transient public String getShortcut() { return shortCut; }
@Transient void registerPropertyChangeSupport(PropertyChangeSupport support) { myChangeSupport = support; }
@Transient public void registerAction(KeyPromoterAction action) { statistics.putIfAbsent(action.getDescription(), new StatisticsItem(action)); statistics.get(action.getDescription()).registerEvent(); myChangeSupport.firePropertyChange(STATISTIC, null, null); }
@Transient public void resetStatistic() { statistics.clear(); myChangeSupport.firePropertyChange(STATISTIC, null, null); }
@Transient public StatisticsItem get(KeyPromoterAction action) { return statistics.get(action.getDescription()); }
@Transient ArrayList<StatisticsItem> getStatisticItems() { final ArrayList<StatisticsItem> items = new ArrayList<>(statistics.values()); Collections.sort(items); return items; }
@Transient ArrayList<StatisticsItem> getSuppressedItems() { return new ArrayList<>(suppressed.values()); }
@Transient public boolean isSuppressed(KeyPromoterAction action) { return suppressed.containsKey(action.getDescription()); }
@Transient public Lesson getLesson() { return myLesson; }
@Transient public void setLesson(Lesson lesson) { myLesson = lesson; }
@Transient public String getPossibleAnswer() { return getActiveSubtaskInfo().getPossibleAnswer(); }
@Transient public void setPossibleAnswer(String possibleAnswer) { getActiveSubtaskInfo().setPossibleAnswer(possibleAnswer); }
@Transient public String getTaskText() { return getActiveSubtaskInfo().getPlaceholderText(); }
@Transient public void setTaskText(String taskText) { getActiveSubtaskInfo().setPlaceholderText(taskText); }
@Transient public TaskFile getTaskFile() { return myTaskFile; }
@Transient public void setTaskFile(TaskFile taskFile) { myTaskFile = taskFile; }
@Transient public StudyStatus getStatus() { AnswerPlaceholderSubtaskInfo info = getActiveSubtaskInfo(); return info != null ? info.getStatus() : StudyStatus.Unchecked; }
@Transient public void setStatus(StudyStatus status) { getActiveSubtaskInfo().setStatus(status); }
@Transient public List<String> getHints() { return getActiveSubtaskInfo().getHints(); }