import java.io.IOException;
import java.util.List;
+import static com.intellij.util.ObjectUtils.notNull;
+
public class JavaExportsStatementElementType extends JavaStubElementType<PsiExportsStatementStub, PsiExportsStatement> {
public JavaExportsStatementElementType() {
super("EXPORTS_STATEMENT");
else if (type == JavaElementType.MODULE_REFERENCE) to.add(JavaSourceUtil.getReferenceText(tree, child));
}
- return new PsiExportsStatementStubImpl(parentStub, refText, to);
+ return new PsiExportsStatementStubImpl(parentStub, notNull(refText, ""), to);
}
@Override
import java.io.IOException;
+import static com.intellij.util.ObjectUtils.notNull;
+
public class JavaRequiresStatementElementType extends JavaStubElementType<PsiRequiresStatementStub, PsiRequiresStatement> {
public JavaRequiresStatementElementType() {
super("REQUIRES_STATEMENT");
else if (type == JavaTokenType.STATIC_KEYWORD) isStatic = true;
}
- return new PsiRequiresStatementStubImpl(parentStub, refText, isPublic, isStatic);
+ return new PsiRequiresStatementStubImpl(parentStub, notNull(refText, ""), isPublic, isStatic);
}
@Override
public void testModuleInfo() {
doTest("module M. /*ignore me*/ N {\n" +
" requires A.B;\n" +
+ " exports m.n;\n" +
"}",
"PsiJavaFileStub []\n" +
- " MODULE:PsiJavaModuleStub:M.N\n");
+ " MODULE:PsiJavaModuleStub:M.N\n" +
+ " REQUIRES_STATEMENT:PsiRequiresStatementStub:0:A.B\n" +
+ " EXPORTS_STATEMENT:PsiExportsStatementStub:m.n\n");
}
public void testSOEProof() {
@Override
@Attribute("nameIsGenerated")
public boolean isGeneratedName() {
- return suggestedName() != null && myNameIsGenerated;
+ return myNameIsGenerated && suggestedName() != null;
}
/**
import com.intellij.openapi.ui.SplitterProportionsData;
import com.intellij.openapi.ui.popup.PopupChooserBuilder;
import com.intellij.openapi.util.*;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.LocalFileSystem;
}
}
+ boolean isGlobalOptions() {
+ return Registry.is("ide.projectView.globalOptions");
+ }
+
+ ProjectViewSharedSettings getGlobalOptions() {
+ return ProjectViewSharedSettings.Companion.getInstance();
+ }
+
@Override
public boolean isAutoscrollToSource(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getAutoscrollToSource();
+ }
+
return getPaneOptionValue(myAutoscrollToSource, paneId, UISettings.getInstance().DEFAULT_AUTOSCROLL_TO_SOURCE);
}
public void setAutoscrollToSource(boolean autoscrollMode, String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setAutoscrollToSource(autoscrollMode);
+ }
myAutoscrollToSource.put(paneId, autoscrollMode);
}
@Override
public boolean isAutoscrollFromSource(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getAutoscrollFromSource();
+ }
+
return getPaneOptionValue(myAutoscrollFromSource, paneId, ourAutoscrollFromSourceDefaults);
}
public void setAutoscrollFromSource(boolean autoscrollMode, String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setAutoscrollFromSource(autoscrollMode);
+ }
setPaneOption(myAutoscrollFromSource, autoscrollMode, paneId, false);
}
@Override
public boolean isFlattenPackages(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getFlattenPackages();
+ }
+
return getPaneOptionValue(myFlattenPackages, paneId, ourFlattenPackagesDefaults);
}
public void setFlattenPackages(boolean flattenPackages, String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setFlattenPackages(flattenPackages);
+ }
setPaneOption(myFlattenPackages, flattenPackages, paneId, true);
}
public boolean isFoldersAlwaysOnTop() {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getFoldersAlwaysOnTop();
+ }
+
return myFoldersAlwaysOnTop;
}
public void setFoldersAlwaysOnTop(boolean foldersAlwaysOnTop) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setFoldersAlwaysOnTop(foldersAlwaysOnTop);
+ }
+
if (myFoldersAlwaysOnTop != foldersAlwaysOnTop) {
myFoldersAlwaysOnTop = foldersAlwaysOnTop;
for (AbstractProjectViewPane pane : myId2Pane.values()) {
@Override
public boolean isShowMembers(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getShowMembers();
+ }
+
return getPaneOptionValue(myShowMembers, paneId, ourShowMembersDefaults);
}
@Override
public boolean isHideEmptyMiddlePackages(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getHideEmptyPackages();
+ }
+
return getPaneOptionValue(myHideEmptyPackages, paneId, ourHideEmptyPackagesDefaults);
}
@Override
public boolean isAbbreviatePackageNames(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getAbbreviatePackages();
+ }
+
return getPaneOptionValue(myAbbreviatePackageNames, paneId, ourAbbreviatePackagesDefaults);
}
@Override
public boolean isShowLibraryContents(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getShowLibraryContents();
+ }
+
return getPaneOptionValue(myShowLibraryContents, paneId, ourShowLibraryContentsDefaults);
}
@Override
public void setShowLibraryContents(boolean showLibraryContents, @NotNull String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setShowLibraryContents(showLibraryContents);
+ }
setPaneOption(myShowLibraryContents, showLibraryContents, paneId, true);
}
@Override
public boolean isShowModules(String paneId) {
+ if (isGlobalOptions()) {
+ return getGlobalOptions().getShowModules();
+ }
+
return getPaneOptionValue(myShowModules, paneId, ourShowModulesDefaults);
}
@Override
public void setShowModules(boolean showModules, @NotNull String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setShowModules(showModules);
+ }
setPaneOption(myShowModules, showModules, paneId, true);
}
@Override
public void setHideEmptyPackages(boolean hideEmptyPackages, @NotNull String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setHideEmptyPackages(hideEmptyPackages);
+ }
setPaneOption(myHideEmptyPackages, hideEmptyPackages, paneId, true);
}
@Override
public void setAbbreviatePackageNames(boolean abbreviatePackageNames, @NotNull String paneId) {
+ if (isGlobalOptions()) {
+ getGlobalOptions().setAbbreviatePackages(abbreviatePackageNames);
+ }
setPaneOption(myAbbreviatePackageNames, abbreviatePackageNames, paneId, true);
}
--- /dev/null
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.projectView.impl
+
+import com.intellij.openapi.components.*
+import com.intellij.util.xmlb.XmlSerializerUtil
+
+/**
+ * @author Konstantin Bulenkov
+ */
+@State(name = "ProjectViewSharedSettings",
+ storages = arrayOf(Storage(value = "projectView.xml", roamingType = RoamingType.PER_OS)))
+
+class ProjectViewSharedSettings : PersistentStateComponent<ProjectViewSharedSettings> {
+ var flattenPackages = false
+ var showMembers = false
+ var sortByType = false
+ var showModules = true
+ var showLibraryContents = true
+ var hideEmptyPackages = true
+ var abbreviatePackages = false
+ var autoscrollFromSource = false
+ var autoscrollToSource = false
+ var foldersAlwaysOnTop = true
+
+ override fun getState(): ProjectViewSharedSettings? {
+ return this
+ }
+
+ override fun loadState(state: ProjectViewSharedSettings) {
+ XmlSerializerUtil.copyBean(state, this)
+ }
+
+ companion object {
+ val instance: ProjectViewSharedSettings
+ get() = ServiceManager.getService(ProjectViewSharedSettings::class.java)
+ }
+}
--- /dev/null
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.structureView.customRegions;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.lang.folding.CustomFoldingProvider;
+import com.intellij.psi.PsiComment;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.StubBasedPsiElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Rustam Vishnyakov
+ */
+public class CustomRegionStructureUtil {
+
+ public static Collection<StructureViewTreeElement> groupByCustomRegions(@NotNull PsiElement rootElement,
+ @NotNull Collection<StructureViewTreeElement> originalElements) {
+ if (rootElement instanceof StubBasedPsiElement &&
+ ((StubBasedPsiElement)rootElement).getStub() != null) {
+ return originalElements;
+ }
+ Collection<CustomRegionTreeElement> customRegions = collectCustomRegions(rootElement);
+ if (customRegions.size() > 0) {
+ List<StructureViewTreeElement> result = new ArrayList<>();
+ result.addAll(customRegions);
+ for (StructureViewTreeElement element : originalElements) {
+ boolean isInCustomRegion = false;
+ for (CustomRegionTreeElement customRegion : customRegions) {
+ if (customRegion.containsElement(element)) {
+ customRegion.addChild(element);
+ isInCustomRegion = true;
+ break;
+ }
+ }
+ if (!isInCustomRegion) result.add(element);
+ }
+ return result;
+ }
+ return originalElements;
+ }
+
+ private static Collection<CustomRegionTreeElement> collectCustomRegions(@NotNull PsiElement rootElement) {
+ List<CustomRegionTreeElement> customRegions = new ArrayList<>();
+ PsiElement child = rootElement.getFirstChild();
+ CustomRegionTreeElement currRegionElement = null;
+ CustomFoldingProvider provider = null;
+ while (child != null) {
+ if (child instanceof PsiComment && !child.textContains('\n')) {
+ if (provider == null) provider = getProvider(child);
+ if (provider != null) {
+ String commentText = child.getText();
+ if (provider.isCustomRegionStart(commentText)) {
+ if (currRegionElement == null) {
+ currRegionElement = new CustomRegionTreeElement(child, provider);
+ customRegions.add(currRegionElement);
+ }
+ else {
+ currRegionElement = currRegionElement.createNestedRegion(child);
+ }
+ }
+ else if (provider.isCustomRegionEnd(commentText) && currRegionElement != null) {
+ currRegionElement = currRegionElement.endRegion(child);
+ }
+ }
+ }
+ child = child.getNextSibling();
+ }
+ return customRegions;
+ }
+
+ @Nullable
+ static CustomFoldingProvider getProvider(@NotNull PsiElement element) {
+ for (CustomFoldingProvider provider : CustomFoldingProvider.getAllProviders()) {
+ if (provider.isCustomRegionStart(element.getNode().getText())) {
+ return provider;
+ }
+ }
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.structureView.customRegions;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.util.treeView.smartTree.TreeElement;
+import com.intellij.lang.folding.CustomFoldingProvider;
+import com.intellij.navigation.ItemPresentation;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Rustam Vishnyakov
+ */
+public class CustomRegionTreeElement implements StructureViewTreeElement {
+
+ private final PsiElement myStartElement;
+ private int myEndOffset = Integer.MAX_VALUE;
+ private Collection<StructureViewTreeElement> myChildElements = new ArrayList<>();
+ private final CustomFoldingProvider myProvider;
+ private CustomRegionTreeElement myParent;
+ private List<CustomRegionTreeElement> mySubRegions;
+
+ public CustomRegionTreeElement(@NotNull PsiElement startElement,
+ @NotNull CustomFoldingProvider provider,
+ @Nullable CustomRegionTreeElement parent) {
+ myStartElement = startElement;
+ myProvider = provider;
+ myParent = parent;
+ }
+
+ public CustomRegionTreeElement(@NotNull PsiElement startElement,
+ @NotNull CustomFoldingProvider provider) {
+ this(startElement, provider, null);
+ }
+
+ @Override
+ public Object getValue() {
+ return this;
+ }
+
+ @Override
+ public void navigate(boolean requestFocus) {
+ ((Navigatable)myStartElement).navigate(requestFocus);
+ }
+
+ @Override
+ public boolean canNavigate() {
+ return myStartElement instanceof Navigatable && ((Navigatable)myStartElement).canNavigate();
+ }
+
+ @Override
+ public boolean canNavigateToSource() {
+ return canNavigate();
+ }
+
+ @NotNull
+ @Override
+ public ItemPresentation getPresentation() {
+ return new ItemPresentation() {
+ @Nullable
+ @Override
+ public String getPresentableText() {
+ return myProvider.getPlaceholderText(myStartElement.getText());
+ }
+
+ @Nullable
+ @Override
+ public String getLocationString() {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public Icon getIcon(boolean unused) {
+ return AllIcons.Nodes.CustomRegion;
+ }
+ };
+ }
+
+ public void addChild(@NotNull StructureViewTreeElement childElement) {
+ if (mySubRegions != null) {
+ for (CustomRegionTreeElement subRegion : mySubRegions) {
+ if (subRegion.containsElement(childElement)) {
+ subRegion.addChild(childElement);
+ return;
+ }
+ }
+ }
+ myChildElements.add(childElement);
+ }
+
+ @NotNull
+ @Override
+ public TreeElement[] getChildren() {
+ if (mySubRegions == null || mySubRegions.isEmpty()) {
+ return myChildElements.toArray(new StructureViewTreeElement[myChildElements.size()]);
+ }
+ StructureViewTreeElement[] allElements = new StructureViewTreeElement[myChildElements.size() + mySubRegions.size()];
+ int index = 0;
+ for (StructureViewTreeElement child : myChildElements) {
+ allElements[index++] = child;
+ }
+ for (StructureViewTreeElement subRegion : mySubRegions) {
+ allElements[index++] = subRegion;
+ }
+ return allElements;
+ }
+
+ public boolean containsElement(StructureViewTreeElement element) {
+ Object o = element.getValue();
+ if (o instanceof PsiElement) {
+ TextRange elementRange = ((PsiElement)o).getTextRange();
+ if(elementRange.getStartOffset() > myStartElement.getTextRange().getStartOffset() && elementRange.getEndOffset() < myEndOffset) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public CustomRegionTreeElement createNestedRegion(@NotNull PsiElement element) {
+ if (mySubRegions == null) mySubRegions = new ArrayList<>();
+ CustomRegionTreeElement currSubRegion = new CustomRegionTreeElement(element, myProvider, this);
+ mySubRegions.add(currSubRegion);
+ return currSubRegion;
+ }
+
+ public CustomRegionTreeElement endRegion(@NotNull PsiElement element) {
+ myEndOffset = element.getTextRange().getEndOffset();
+ return myParent;
+ }
+
+}
/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
-import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
return null;
}
- final VirtualFile baseDir = ApplicationManager.getApplication().runWriteAction(new Computable<VirtualFile>() {
- public VirtualFile compute() {
- return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(location);
- }
- });
+ final VirtualFile baseDir = ApplicationManager.getApplication().runWriteAction((Computable<VirtualFile>)() -> LocalFileSystem.getInstance().refreshAndFindFileByIoFile(location));
if (baseDir == null) {
LOG.error("Couldn't find '" + location + "' in VFS");
return null;
((TemplateProjectDirectoryGenerator)generator).generateProject(baseDir.getName(), locationString);
} else {
final Object finalSettings = settings;
- callback = new ProjectOpenedCallback() {
- @Override
- public void projectOpened(Project project, Module module) {
- if (generator != null) {
- generator.generateProject(project, baseDir, finalSettings, module);
- }
+ callback = (p, module) -> {
+ if (generator != null) {
+ generator.generateProject(p, baseDir, finalSettings, module);
}
};
}
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return LabeledComponent.create(myLocationField, BundleBase.replaceMnemonicAmpersand("&Location"), BorderLayout.WEST);
}
- private static File findSequentNonExistingUntitled() {
+ @NotNull
+ protected File findSequentNonExistingUntitled() {
return FileUtil.findSequentNonexistentFile(new File(ProjectUtil.getBaseDir()), "untitled", "");
}
}
return myParentEnvironmentType != ParentEnvironmentType.NONE;
}
- /** @deprecated use {@link #withParentEnvironmentType(ParentEnvironmentType)} (to be removed in IDEA 17) */
+ /** @deprecated use {@link #withParentEnvironmentType(ParentEnvironmentType)} */
public GeneralCommandLine withPassParentEnvironment(boolean passParentEnvironment) {
return withParentEnvironmentType(passParentEnvironment ? ParentEnvironmentType.CONSOLE : ParentEnvironmentType.NONE);
}
- /** @deprecated use {@link #withParentEnvironmentType(ParentEnvironmentType)} (to be removed in IDEA 17) */
+ /** @deprecated use {@link #withParentEnvironmentType(ParentEnvironmentType)} */
public void setPassParentEnvironment(boolean passParentEnvironment) {
withParentEnvironmentType(passParentEnvironment ? ParentEnvironmentType.CONSOLE : ParentEnvironmentType.NONE);
}
environment.putAll(getParentEnvironment());
}
+ if (SystemInfo.isUnix) {
+ File workDirectory = getWorkDirectory();
+ if (workDirectory != null) {
+ environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
+ }
+ }
+
if (!myEnvParams.isEmpty()) {
if (SystemInfo.isWindows) {
THashMap<String, String> envVars = new THashMap<>(CaseInsensitiveStringHashingStrategy.INSTANCE);
environment.putAll(myEnvParams);
}
}
-
- if (SystemInfo.isUnix) {
- File workDirectory = getWorkDirectory();
- if (workDirectory != null) {
- environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
- }
- }
}
/**
return myExePath + " " + myProgramParams;
}
+ @Nullable
@Override
public <T> T getUserData(@NotNull Key<T> key) {
if (myUserData != null) {
@Override
public <T> void putUserData(@NotNull Key<T> key, @Nullable T value) {
if (myUserData == null) {
+ if (value == null) return;
myUserData = ContainerUtil.newHashMap();
}
myUserData.put(key, value);
}
protected static boolean isMoveHelpButtonLeft() {
- return UIUtil.isUnderAquaBasedLookAndFeel() || (SystemInfo.isWindows && Registry.is("ide.intellij.laf.win10.ui"));
+ return UIUtil.isUnderAquaBasedLookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderWin10LookAndFeel();
}
/**
}
if (hasHelpToMoveToLeftSide) {
- if (!(SystemInfo.isWindows && UIUtil.isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.win10.ui"))) {
+ if (!(SystemInfo.isWindows && (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) && Registry.is("ide.win.frame.decoration"))) {
JButton helpButton = createHelpButton(insets);
panel.add(helpButton, BorderLayout.WEST);
}
@NotNull
protected JButton createHelpButton(Insets insets) {
final JButton helpButton;
- if ((SystemInfo.isWindows && UIUtil.isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.win10.ui"))) {
+ if ((UIUtil.isUnderWin10LookAndFeel())) {
helpButton = new JButton(getHelpAction()) {
@Override
public void paint(Graphics g) {
private static final Key<Boolean> MEDIATOR_KEY = Key.create("KillableColoredProcessHandler.Mediator.Process");
private boolean myShouldKillProcessSoftly = true;
- private boolean myMediatedProcess = false;
+ private final boolean myMediatedProcess;
public KillableColoredProcessHandler(@NotNull GeneralCommandLine commandLine) throws ExecutionException {
- super(commandLine);
+ this(commandLine, false);
}
/**
*/
public KillableColoredProcessHandler(@NotNull Process process, /*@NotNull*/ String commandLine) {
super(process, commandLine);
+ myMediatedProcess = false;
}
/**
*/
public KillableColoredProcessHandler(@NotNull Process process, /*@NotNull*/ String commandLine, @NotNull Charset charset) {
super(process, commandLine, charset);
+ myMediatedProcess = false;
}
- private static GeneralCommandLine mediate(GeneralCommandLine commandLine, boolean withMediator) {
+ @NotNull
+ private static GeneralCommandLine mediate(@NotNull GeneralCommandLine commandLine, boolean withMediator) {
if (withMediator && SystemInfo.isWindows) {
boolean mediatorInjected = RunnerMediator.injectRunnerCommand(commandLine);
MEDIATOR_KEY.set(commandLine, mediatorInjected);
/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if (focused) key+= "Focused";
else if (!enabled) key+="Disabled";
if (IntelliJLaf.isGraphite()) key= "graphite/" + key;
+ if (IntelliJLaf.isWindowsNativeLook()) key = "win10/" + key;
Icon icon = cache.get(key);
if (icon == null) {
icon = IconLoader.findIcon("/com/intellij/ide/ui/laf/icons/" + key + ".png", MacIntelliJIconCache.class, true);
protected void drawCheckIcon(JComponent c, Graphics2D g, JCheckBox b, Rectangle iconRect, boolean selected, boolean enabled) {
final Color color = enabled ? b.getForeground() : getBorderColor1(false, false);
g.setColor(color);
-
+ final Icon icon = MacIntelliJIconCache.getIcon("checkBox", selected, false, enabled);
Rectangle r = new Rectangle(iconRect.x + JBUI.scale(2), iconRect.y + JBUI.scale(2), iconRect.width - JBUI.scale(4), iconRect.height - JBUI.scale(4));
- g.drawRect(r.x, r.y, r.width, r.height);
-
- if (selected) {
- final int x1 = r.x + JBUI.scale(3);
- final int y1 = r.y + r.height / 2 + JBUI.scale(1);
- final int x2 = r.x + r.height / 2 - JBUI.scale(1);
- final int y2 = r.y + r.height - JBUI.scale(4);
-
- final Graphics2D iconGraphics = (Graphics2D)g.create(0, 0, c.getWidth(), c.getHeight());
- iconGraphics.setColor(color);
- iconGraphics.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
- iconGraphics.setStroke(new BasicStroke(JBUI.scale(1.5f), BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
-
- if (enabled) {
- iconGraphics.drawLine(x1, y1, x2, y2);
- iconGraphics.drawLine(x2, y2, r.x + r.width - JBUI.scale(2), r.y + JBUI.scale(4));
- }
- iconGraphics.dispose();
- }
+ icon.paintIcon(c, g, r.x, r.y);
}
@Override
final JButton button = new BasicArrowButton(SwingConstants.SOUTH) {
@Override
public Dimension getPreferredSize() {
- return JBUI.size(14, 6);
+ return JBUI.size(14, 10);
}
@Override
public void paint(Graphics g) {
g.setColor(getComboBackground());
g.fillRect(0, 0, getWidth(), getHeight());
- IconUtil.paintInCenterOf(this, g, MacIntelliJIconCache.getIcon("winCheckSign"));
+ IconUtil.paintInCenterOf(this, g, MacIntelliJIconCache.getIcon("comboDropTriangle", false, false, isEnabled()));
}
};
button.setOpaque(false);
package com.intellij.ide.ui.laf.intellij;
import com.intellij.ide.ui.laf.darcula.ui.DarculaRadioButtonUI;
-import com.intellij.openapi.ui.GraphicsConfig;
-import com.intellij.ui.Gray;
-import com.intellij.util.ui.GraphicsUtil;
-import com.intellij.util.ui.JBUI;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
@Override
protected void paintIcon(JComponent c, Graphics2D g, Rectangle viewRect, Rectangle iconRect) {
- int rad = JBUI.scale(4);
-
- // Paint the radio button
- final int x = iconRect.x + (rad - (rad % 2 == 1?1:0))/2;
- final int y = iconRect.y + (rad - (rad % 2 == 1?1:0))/2;
- final int w = iconRect.width - rad;
- final int h = iconRect.height - rad;
- final boolean enabled = c.isEnabled();
- Color color = enabled ? Gray.x50 : Gray.xD3;
- g.translate(x, y);
- //setup AA for lines
- final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
- g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
final boolean selected = ((AbstractButton)c).isSelected();
- g.setPaint(color);
- g.drawOval(0, 0, w , h );
-
- if (selected) {
- g.setColor(color);
- g.fillOval(JBUI.scale(3), JBUI.scale(3), w - 2*JBUI.scale(3), h - 2*JBUI.scale(3));
- }
- config.restore();
- g.translate(-x, -y);
-
+ final boolean enabled = c.isEnabled();
+ final Icon icon = MacIntelliJIconCache.getIcon("radio", selected, false, enabled);
+ // Paint the radio button
+ final int x = (iconRect.width - icon.getIconWidth()) / 2;
+ final int y = (viewRect.height - icon.getIconHeight()) / 2;
+ icon.paintIcon(c, g, x, y);
}
}
--- /dev/null
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.ui.laf.intellij;
+
+import com.intellij.ui.Gray;
+
+import javax.swing.border.Border;
+import javax.swing.plaf.UIResource;
+import java.awt.*;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class WinMenuBarBorder implements Border, UIResource {
+ @Override
+ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+ g.setColor(Gray.xCD);
+ g.drawLine(x, y + height - 1, x + width, y + height - 1);
+ }
+
+ @Override
+ public Insets getBorderInsets(Component c) {
+ //noinspection UseDPIAwareInsets
+ return new Insets(0, 0, 1, 0);
+ }
+
+ @Override
+ public boolean isBorderOpaque() {
+ return true;
+ }
+}
intellijlaf_native.selectionBackground=1a7dc4
intellijlaf_native.textBackground=cccccc
intellijlaf_native.foreground=000000
+intellijlaf_native.disabledForeground=8a8a8a
intellijlaf_native.textForeground=000000
intellijlaf_native.caretForeground=000000
intellijlaf_native.inactiveBackground=f2f2f2
-intellijlaf_native.inactiveForeground=777777
+intellijlaf_native.inactiveForeground=8a8a8a
intellijlaf_native.selectionForeground=ffffff
intellijlaf_native.acceleratorSelectionForeground=ffffff
intellijlaf_native.selectionBackgroundInactive=27384C
control=ffffff
link.foreground=589df6
ScrollBarUI=com.intellij.ui.components.JBScrollBar
-
-Label.disabledForeground=777777
-
TableHeaderUI=com.intellij.ide.ui.laf.darcula.DarculaTableHeaderUI
Table.gridColor=dddddd
Table.ascendingSortIcon=AllIcons.General.SplitUp
ComboBoxUI=com.intellij.ide.ui.laf.intellij.WinIntelliJComboBoxUI
ComboBox.disabledBackground=e1e1e1
-ComboBox.disabledForeground=777777
ComboBox.squareButton=false
ComboBox.borderColor=adadad
ComboBox.activeBorderColor=0078d7
ComboBox.darcula.arrowFocusedFillColor=2d82ed
RadioButtonUI=com.intellij.ide.ui.laf.intellij.WinIntelliJRadioButtonUI
+RadioButton.disabledText=8a8a8a
StatusBar.topColor=2c2c2c
StatusBar.top2Color=2c2c2c
PopupMenu.border=com.intellij.ide.ui.laf.darcula.ui.DarculaPopupMenuBorder
-MenuBar.border=com.intellij.ide.ui.laf.darcula.ui.DarculaMenuBarBorder
+MenuBar.border=com.intellij.ide.ui.laf.intellij.WinMenuBarBorder
TabbedPaneUI=com.intellij.ide.ui.laf.darcula.ui.DarculaTabbedPaneUI
TabbedPane.tabInsets=0,4,0,4
import com.intellij.openapi.ui.impl.FocusTrackbackProvider;
import com.intellij.openapi.ui.impl.GlassPaneDialogWrapperPeer;
import com.intellij.openapi.util.SystemInfo;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.ex.WindowManagerEx;
import com.intellij.ui.FocusTrackback;
super.init();
setUndecorated(true);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
- if (! (SystemInfo.isWindows && UIUtil.isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.win10.ui"))) {
+ if (! UIUtil.isUnderWin10LookAndFeel()) {
myPanel.setBorder(PopupBorder.Factory.create(true, true));
}
}
serviceImplementation="com.intellij.codeInspection.ex.InspectionManagerEx"/>
<projectService serviceInterface="com.intellij.usageView.UsageViewManager"
serviceImplementation="com.intellij.usageView.impl.UsageViewManagerImpl"/>
+ <applicationService serviceInterface="com.intellij.ide.projectView.impl.ProjectViewSharedSettings"
+ serviceImplementation="com.intellij.ide.projectView.impl.ProjectViewSharedSettings"/>
<projectService serviceInterface="com.intellij.ide.projectView.ProjectView"
serviceImplementation="com.intellij.ide.projectView.impl.ProjectViewImpl"/>
<projectService serviceInterface="com.intellij.execution.ui.RunnerLayoutUi$Factory"
<action id="ChangesView.CreatePatch" class="com.intellij.openapi.vcs.changes.actions.CreatePatchAction"/>
<action id="ChangesView.ApplyPatch" class="com.intellij.openapi.vcs.changes.patch.ApplyPatchAction"/>
<action id="ChangesView.ApplyPatchFromClipboard" class="com.intellij.openapi.vcs.changes.patch.ApplyPatchFromClipboardAction"/>
- <action id="ChangesView.Shelve" class="com.intellij.openapi.vcs.changes.shelf.ShelveChangesAction"/>
+ <action id="ChangesView.Shelve" class="com.intellij.openapi.vcs.changes.shelf.ShelveChangesAction" icon="AllIcons.Vcs.Shelve"/>
</group>
<separator/>
icon="AllIcons.Actions.Submit1"/>
<action id="ChangesView.Move" class="com.intellij.openapi.vcs.changes.actions.MoveChangesToAnotherListAction"
icon="AllIcons.Actions.MoveToAnotherChangelist"/>
+ <action id="ChangesView.ShelveSilently" class="com.intellij.openapi.vcs.changes.actions.ShelveSilentlyAction"
+ text="Shelve Silently" description="Shelve changes to appropriate shelved changelists" icon="AllIcons.Vcs.SilentShelve">
+ <keyboard-shortcut first-keystroke="control alt H" keymap="$default"/>
+ </action>
<action id="ChangesView.Diff" class="com.intellij.openapi.vcs.changes.actions.diff.ShowDiffAction"
icon="AllIcons.Actions.Diff" use-shortcut-of="Diff.ShowDiff"/>
</group>
- <action id="ChangesView.ShelveSilently" class="com.intellij.openapi.vcs.changes.actions.ShelveSilentlyAction"
- text="Shelve Silently" description="Shelve changes to appropriate shelved changelists">
- <keyboard-shortcut first-keystroke="control alt H" keymap="$default"/>
- </action>
- <action id="ChangesView.UnshelveSilently" class="com.intellij.openapi.vcs.changes.actions.UnshelveSilentlyAction"
- text="Unshelve Silently" description="Unshelve changes to appropriate changelists">
- <keyboard-shortcut first-keystroke="control alt U" keymap="$default"/>
- </action>
-
-
<group id="AlienCommitChangesDialog.AdditionalActions"/>
<group id="ChangesViewPopupMenu">
<action id="ChangesView.Rename" class="com.intellij.openapi.vcs.changes.actions.RenameChangeListAction"/>
<reference ref="ChangesView.CreatePatch"/>
<reference ref="ChangesView.Shelve"/>
- <reference ref="ChangesView.ShelveSilently"/>
<separator/>
<reference ref="ChangesView.Refresh"/>
<separator/>
<group id="ShelvedChangesPopupMenu" popup="true">
<action id="ShelveChanges.UnshelveWithDialog" class="com.intellij.openapi.vcs.changes.shelf.UnshelveWithDialogAction"
- text="Unshelve..." description="Correct paths where to apply patches and unshelve"/>
- <reference id="ChangesView.UnshelveSilently"/>
+ text="Unshelve..." description="Correct paths where to apply patches and unshelve" icon="AllIcons.Vcs.Unshelve"/>
<action id="ShelvedChanges.Restore" class="com.intellij.openapi.vcs.changes.shelf.RestoreShelvedChange"/>
<action id="ShelvedChanges.Diff" class="com.intellij.openapi.vcs.changes.shelf.DiffShelvedChangesAction"
icon="AllIcons.Actions.Diff" use-shortcut-of="Diff.ShowDiff"/>
<group id="ShelvedChangesToolbar">
<reference ref="ShelvedChanges.Diff"/>
+ <action id="ChangesView.UnshelveSilently" class="com.intellij.openapi.vcs.changes.actions.UnshelveSilentlyAction"
+ text="Unshelve Silently" description="Unshelve changes to appropriate changelists" icon="AllIcons.Vcs.SilentUnshelve">
+ <keyboard-shortcut first-keystroke="control alt U" keymap="$default"/>
+ </action>
<reference ref="ChangesView.CreatePatchFromChanges"/>
<reference ref="ShelvedChanges.ShowHideDeleted" />
<reference ref="ShelvedChanges.CleanMarkedToDelete"/>
<group id="ShelvedChangesToolbarGear" popup="true" icon="AllIcons.General.SecondaryGroup">
<reference ref="ShelveChanges.UnshelveWithDialog"/>
- <reference ref="ChangesView.UnshelveSilently"/>
<reference ref="ShelvedChanges.Restore"/>
<reference ref="ShelvedChanges.ImportPatches"/>
<separator/>
debugger.show.values.inplace.description=Show primitive values near variables inside current execution line
show.configurables.ids.in.settings=false
show.configurables.ids.in.settings.description=Show configurables ids in settings when user holds Shift. Works in Keymap and Settings trees
+
+ide.projectView.globalOptions=true
+ide.projectView.globalOptions.description=Make Project View options such as autoscroll to/from source, etc global per panes and per projects. For details see https://youtrack.jetbrains.com/issue/IDEA-85255
public static final Icon Not_equal = IconLoader.getIcon("/vcs/not_equal.png"); // 16x16
public static final Icon Remove = IconLoader.getIcon("/vcs/remove.png"); // 16x16
public static final Icon ResetStrip = IconLoader.getIcon("/vcs/resetStrip.png"); // 16x16
+ public static final Icon Shelve = IconLoader.getIcon("/vcs/Shelve.png"); // 16x16
+ public static final Icon SilentShelve = IconLoader.getIcon("/vcs/SilentShelve.png"); // 16x16
+ public static final Icon SilentUnshelve = IconLoader.getIcon("/vcs/SilentUnshelve.png"); // 16x16
public static final Icon StripDown = IconLoader.getIcon("/vcs/stripDown.png"); // 16x16
public static final Icon StripNull = IconLoader.getIcon("/vcs/stripNull.png"); // 16x16
public static final Icon StripUp = IconLoader.getIcon("/vcs/stripUp.png"); // 16x16
+ public static final Icon Unshelve = IconLoader.getIcon("/vcs/Unshelve.png"); // 16x16
}
return findSequentNonexistentFile(aParentFolder, aFilePrefix, aExtension).getName();
}
+ @NotNull
public static File findSequentNonexistentFile(@NotNull File parentFolder, @NotNull String filePrefix, @NotNull String extension) {
int postfix = 0;
String ext = extension.isEmpty() ? "" : '.' + extension;
return UIManager.getLookAndFeel().getName().contains("Darcula");
}
+ public static boolean isUnderWin10LookAndFeel() {
+ return SystemInfo.isWindows && isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.win10.ui");
+ }
+
@SuppressWarnings({"HardCodedStringLiteral"})
public static boolean isUnderIntelliJLaF() {
return UIManager.getLookAndFeel().getName().contains("IntelliJ");
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.intellij.ide.util.projectWizard.WebProjectTemplate;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.jetbrains.python.configuration.PyConfigurableInterpreterList;
import com.jetbrains.python.newProject.PyNewProjectSettings;
import com.jetbrains.python.newProject.PythonProjectGenerator;
-import com.jetbrains.python.packaging.PyPackageManager;
-import com.jetbrains.python.packaging.PyPackageManagerUI;
-import com.jetbrains.python.packaging.PyRequirement;
-import com.jetbrains.python.sdk.*;
+import com.jetbrains.python.sdk.PyDetectedSdk;
+import com.jetbrains.python.sdk.PythonSdkAdditionalData;
+import com.jetbrains.python.sdk.PythonSdkType;
+import com.jetbrains.python.sdk.PythonSdkUpdater;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.util.Collections;
import java.util.List;
public class PythonGenerateProjectCallback implements NullableConsumer<ProjectSettingsStepBase> {
}
}
- private static void installRequirements(@NotNull Project project) {
- final Module module = ModuleManager.getInstance(project).getModules()[0];
- final Sdk sdk = PythonSdkType.findPythonSdk(module);
- if (sdk == null) return;
- final PyPackageManager manager = PyPackageManager.getInstance(sdk);
- List<PyRequirement> requirements = manager.getRequirements(module);
- if (requirements != null) {
- final PyPackageManagerUI ui = new PyPackageManagerUI(project, sdk, null);
- ui.install(requirements, Collections.emptyList());
- }
- }
-
-
private static Sdk addDetectedSdk(ProjectSpecificSettingsStep settingsStep, Sdk sdk) {
final Project project = ProjectManager.getInstance().getDefaultProject();
final ProjectSdksModel model = PyConfigurableInterpreterList.getInstance(project).getModel();
final String name = sdk.getName();
- VirtualFile sdkHome = ApplicationManager.getApplication().runWriteAction(new Computable<VirtualFile>() {
- @Override
- public VirtualFile compute() {
- return LocalFileSystem.getInstance().refreshAndFindFileByPath(name);
- }
- });
+ VirtualFile sdkHome = ApplicationManager.getApplication().runWriteAction((Computable<VirtualFile>)() -> LocalFileSystem.getInstance().refreshAndFindFileByPath(name));
sdk = SdkConfigurationUtil.createAndAddSDK(sdkHome.getPath(), PythonSdkType.getInstance());
if (sdk != null) {
PythonSdkUpdater.updateOrShowError(sdk, null, project, null);
import java.util.List;
public interface PyStringLiteralExpression extends PyLiteralExpression, StringLiteralExpression, PsiLanguageInjectionHost {
- List<TextRange> getStringValueTextRanges();
-
+ @NotNull
List<ASTNode> getStringNodes();
int valueOffsetToTextOffset(int valueOffset);
+ /**
+ * Returns unescaped fragments of string's value together with their respective text ranges <i>relative to the element's start offset</i>.
+ * For most escape sequences the decoded character is returned and the text range that spans the sequence itself.
+ * Other "literal" fragments of the string are returned as is so that {@code pair.getFirst().length() == pair.getSecond().getLength()}.
+ * <p>
+ * For example, for the next "glued" string literal:
+ * <p>
+ * <pre><code>
+ * u"\u0066\x6F\157" '\bar' r'\baz'
+ * </code></pre>
+ * <p>
+ * this method returns:
+ * <p>
+ * <code><pre>
+ * [
+ * ([2,8),"f"),
+ * ([8,12),"o"),
+ * ([12,16),"o"),
+ * ([16,16),""),
+ * ([19,21),"\b"),
+ * ([21,23),"ar"),
+ * ([27,29),"\\b"),
+ * ([29,31),"az"),
+ * ]
+ * </code></pre>
+ */
@NotNull
List<Pair<TextRange, String>> getDecodedFragments();
+ /**
+ * Returns value ranges for all nodes that form this string literal expression <i>relative to its start offset</i>.
+ * Such range doesn't include neither node's prefix like "ur", nor its quotes.
+ * <p>
+ * For example, for the next "glued" string literal:
+ * <pre><code>
+ * u"\u0066\x6F\157" ur'' '''\t'''
+ * </code></pre>
+ * <p>
+ * this method returns:
+ * <p>
+ * <code><pre>
+ * [
+ * [2,16),
+ * [21,21),
+ * [26,28),
+ * ]
+ * </code></pre>
+ */
+ @NotNull
+ List<TextRange> getStringValueTextRanges();
+
/**
* @return true if this element has single string node and its type is {@link com.jetbrains.python.PyTokenTypes#DOCSTRING}
*/
import com.google.common.collect.Lists;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.RunCanceledByUserException;
-import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.CatchingConsumer;
+import com.intellij.util.concurrency.AppExecutorUtil;
import com.intellij.webcore.packaging.InstalledPackage;
import com.intellij.webcore.packaging.PackageManagementServiceEx;
import com.intellij.webcore.packaging.RepoPackage;
import java.io.IOException;
import java.util.*;
+import java.util.concurrent.ExecutorService;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
private final Project myProject;
protected final Sdk mySdk;
+ protected final ExecutorService myExecutorService;
public PyPackageManagementService(@NotNull Project project, @NotNull Sdk sdk) {
myProject = project;
mySdk = sdk;
+ // Dumb heuristic for the size of IO-bound tasks pool: safer than unlimited, snappier than a single thread
+ myExecutorService = AppExecutorUtil.createBoundedApplicationPoolExecutor("PyPackageManagementService pool", 4);
}
@NotNull
installPackage(new RepoPackage(installedPackage.getName(), null), null, true, null, listener, false);
}
+ /**
+ * @return whether the latest version should be requested independently for each package
+ */
@Override
public boolean shouldFetchLatestVersionsForOnlyInstalledPackages() {
- /*
- final List<String> repositories = PyPackageService.getInstance().additionalRepositories;
- return repositories.size() > 1 || (repositories.size() == 1 && !repositories.get(0).equals(PyPIPackageUtil.PYPI_LIST_URL));
- */
return true;
}
@Override
public void fetchLatestVersion(@NotNull InstalledPackage pkg, @NotNull CatchingConsumer<String, Exception> consumer) {
- ApplicationManager.getApplication().executeOnPooledThread(() -> {
+ myExecutorService.submit(() -> {
try {
PyPIPackageUtil.INSTANCE.loadAndGetPackages();
final String version = PyPIPackageUtil.INSTANCE.fetchLatestPackageVersion(pkg.getName());
myDecodedFragments = null;
}
+ @NotNull
public List<TextRange> getStringValueTextRanges() {
if (valueTextRanges == null) {
int elStart = getTextRange().getStartOffset();
return matcher.group(group.ordinal());
}
+ @NotNull
public List<ASTNode> getStringNodes() {
return Arrays.asList(getNode().getChildren(PyTokenTypes.STRING_NODES));
}