mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -131,7 +131,7 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
|
||||
protected MasterDetailsComponent(MasterDetailsState state) {
|
||||
myState = state;
|
||||
|
||||
mySplitter = Registry.is("ide.new.project.settings") ? new OnePixelSplitter(false, .2f) : new JBSplitter(false, .2f);
|
||||
mySplitter = isNewProjectSettings() ? new OnePixelSplitter(false, .2f) : new JBSplitter(false, .2f);
|
||||
mySplitter.setSplitterProportionKey("ProjectStructure.SecondLevelElements");
|
||||
mySplitter.setHonorComponentsMinimumSize(true);
|
||||
|
||||
@@ -139,6 +139,20 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
|
||||
reInitWholePanelIfNeeded();
|
||||
}
|
||||
|
||||
private boolean isNewProjectSettings() {
|
||||
if (!Registry.is("ide.new.project.settings")) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
// assume that only project structure dialog uses the following base class for details:
|
||||
String name = "com.intellij.openapi.roots.ui.configuration.projectRoot.BaseStructureConfigurable";
|
||||
return Class.forName(name).isAssignableFrom(getClass());
|
||||
}
|
||||
catch (ClassNotFoundException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void reInitWholePanelIfNeeded() {
|
||||
if (!myToReInitWholePanel) return;
|
||||
|
||||
@@ -170,7 +184,7 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
|
||||
}
|
||||
};
|
||||
|
||||
if (Registry.is("ide.new.project.settings")) {
|
||||
if (isNewProjectSettings()) {
|
||||
ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTree);
|
||||
DefaultActionGroup group = createToolbarActionGroup();
|
||||
if (group != null) {
|
||||
@@ -281,7 +295,7 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
|
||||
}
|
||||
|
||||
private void initToolbar() {
|
||||
if (Registry.is("ide.new.project.settings")) return;
|
||||
if (isNewProjectSettings()) return;
|
||||
DefaultActionGroup group = createToolbarActionGroup();
|
||||
if (group != null) {
|
||||
final JComponent component = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true).getComponent();
|
||||
|
||||
@@ -58,7 +58,6 @@ public class HyperlinkLabel extends HighlightableComponent {
|
||||
private HighlightedText myHighlightedText;
|
||||
private final List<HyperlinkListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private boolean myUseIconAsLink;
|
||||
private final Color myTextEffectColor;
|
||||
private final TextAttributes myAnchorAttributes;
|
||||
private HyperlinkListener myHyperlinkListener = null;
|
||||
|
||||
@@ -80,8 +79,8 @@ public class HyperlinkLabel extends HighlightableComponent {
|
||||
}
|
||||
|
||||
public HyperlinkLabel(String text, final Color textForegroundColor, final Color textBackgroundColor, final Color textEffectColor) {
|
||||
myTextEffectColor = textEffectColor;
|
||||
myAnchorAttributes = new TextAttributes(textForegroundColor, textBackgroundColor, null, null, Font.PLAIN);
|
||||
myAnchorAttributes =
|
||||
new TextAttributes(textForegroundColor, textBackgroundColor, textEffectColor, EffectType.LINE_UNDERSCORE, Font.PLAIN);
|
||||
enforceBackgroundOutsideText(textBackgroundColor);
|
||||
setHyperlinkText(text);
|
||||
enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
|
||||
@@ -116,7 +115,6 @@ public class HyperlinkLabel extends HighlightableComponent {
|
||||
protected void processMouseEvent(MouseEvent e) {
|
||||
if (e.getID() == MouseEvent.MOUSE_EXITED) {
|
||||
setCursor(Cursor.getDefaultCursor());
|
||||
updateLinkUnderlining(e);
|
||||
}
|
||||
else if (UIUtil.isActionClick(e, MouseEvent.MOUSE_PRESSED) && isOnLink(e.getX())) {
|
||||
fireHyperlinkEvent();
|
||||
@@ -128,32 +126,10 @@ public class HyperlinkLabel extends HighlightableComponent {
|
||||
protected void processMouseMotionEvent(MouseEvent e) {
|
||||
if (e.getID() == MouseEvent.MOUSE_MOVED) {
|
||||
setCursor(isOnLink(e.getX()) ? Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) : Cursor.getDefaultCursor());
|
||||
updateLinkUnderlining(e);
|
||||
}
|
||||
super.processMouseMotionEvent(e);
|
||||
}
|
||||
|
||||
private void updateLinkUnderlining(MouseEvent e) {
|
||||
boolean wasUnderlined = myAnchorAttributes.getEffectType() == EffectType.LINE_UNDERSCORE;
|
||||
if (e.getID() == MouseEvent.MOUSE_EXITED) {
|
||||
if (wasUnderlined) {
|
||||
myAnchorAttributes.setEffectColor(null);
|
||||
myAnchorAttributes.setEffectType(null);
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
else if (e.getID() == MouseEvent.MOUSE_MOVED) {
|
||||
if (!wasUnderlined) {
|
||||
HighlightedRegion region = findRegionByX(e.getX());
|
||||
if (region != null && region.textAttributes == myAnchorAttributes) {
|
||||
myAnchorAttributes.setEffectColor(myTextEffectColor);
|
||||
myAnchorAttributes.setEffectType(EffectType.LINE_UNDERSCORE);
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isOnLink(int x) {
|
||||
if (myUseIconAsLink && myIcon != null && x < myIcon.getIconWidth()) {
|
||||
return true;
|
||||
|
||||
@@ -1016,6 +1016,7 @@ public class GitUtil {
|
||||
@NotNull
|
||||
public static String cleanupErrorPrefixes(@NotNull String msg) {
|
||||
final String[] PREFIXES = { "fatal:", "error:" };
|
||||
msg = msg.trim();
|
||||
for (String prefix : PREFIXES) {
|
||||
if (msg.startsWith(prefix)) {
|
||||
return msg.substring(prefix.length()).trim();
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package git4idea.reset;
|
||||
|
||||
import com.intellij.dvcs.ui.VcsLogOneCommitPerRepoAction;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -25,18 +24,19 @@ import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.vcs.log.VcsFullCommitDetails;
|
||||
import git4idea.config.GitVcsSettings;
|
||||
import git4idea.repo.GitRepository;
|
||||
import git4idea.repo.GitRepositoryManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static git4idea.GitUtil.getRepositoryManager;
|
||||
|
||||
public class GitResetAction extends VcsLogOneCommitPerRepoAction<GitRepository> {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected GitRepository getRepositoryForRoot(@NotNull Project project, @NotNull VirtualFile root) {
|
||||
return getRepoManager(project).getRepositoryForRoot(root);
|
||||
return getRepositoryManager(project).getRepositoryForRoot(root);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,9 +57,4 @@ public class GitResetAction extends VcsLogOneCommitPerRepoAction<GitRepository>
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static GitRepositoryManager getRepoManager(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, GitRepositoryManager.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public layoutEducational(String classesPath, Set usedJars) {
|
||||
|
||||
def appInfo = appInfoFile()
|
||||
if (!dryRun) {
|
||||
wireBuildDate("PE-${buildNumber}", appInfo)
|
||||
wireBuildDate(${buildNumber}, appInfo)
|
||||
}
|
||||
|
||||
Map args = [
|
||||
@@ -223,7 +223,7 @@ private layoutPlugins(layouts) {
|
||||
}
|
||||
|
||||
private String appInfoFile() {
|
||||
return "$pythonEduHome/out/pycharm/classes/production/python-educational/idea/PyCharmEduApplicationInfo.xml"
|
||||
return "${paths.sandbox}/classes/production/python-educational/idea/PyCharmEduApplicationInfo.xml"
|
||||
}
|
||||
|
||||
private layoutFull(Map args, String target, Set usedJars) {
|
||||
|
||||
Reference in New Issue
Block a user