mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-84856 Incoming changes doesn't work anymore in 117.222
This commit is contained in:
@@ -47,6 +47,7 @@ setProperty("paths", paths)
|
||||
|
||||
target(compile: "Compile project") {
|
||||
loadProject()
|
||||
project.builder.arrangeModuleCyclesOutputs = true
|
||||
|
||||
project.stage("Cleaning up sandbox folder")
|
||||
forceDelete(paths.sandbox)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package com.intellij.psi.stubs;
|
||||
|
||||
import com.intellij.util.io.UnsyncByteArrayInputStream;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
@@ -28,9 +29,9 @@ import java.io.IOException;
|
||||
public class SerializedStubTree {
|
||||
private final byte[] myBytes;
|
||||
private final int myLength;
|
||||
private final StubElement myStubElement;
|
||||
private StubElement myStubElement;
|
||||
|
||||
public SerializedStubTree(final byte[] bytes, int length, StubElement stubElement) {
|
||||
public SerializedStubTree(final byte[] bytes, int length, @Nullable StubElement stubElement) {
|
||||
myBytes = bytes;
|
||||
myLength = length;
|
||||
myStubElement = stubElement;
|
||||
@@ -48,9 +49,16 @@ public class SerializedStubTree {
|
||||
out.write(myBytes, 0, myLength);
|
||||
}
|
||||
|
||||
public StubElement getStub() {
|
||||
return myStubElement != null ?
|
||||
myStubElement : SerializationManager.getInstance().deserialize(new UnsyncByteArrayInputStream(myBytes));
|
||||
// willIndexStub is one time optimization hint, once can safely pass false
|
||||
public StubElement getStub(boolean willIndexStub) {
|
||||
StubElement stubElement = myStubElement;
|
||||
if (stubElement != null) {
|
||||
// not null myStubElement means we just built SerializedStubTree for indexing,
|
||||
// if we request stub for indexing we can safely use it
|
||||
myStubElement = null;
|
||||
if (willIndexStub) return stubElement;
|
||||
}
|
||||
return SerializationManager.getInstance().deserialize(new UnsyncByteArrayInputStream(myBytes));
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
|
||||
@@ -77,7 +77,7 @@ public class StubTreeLoaderImpl extends StubTreeLoader {
|
||||
final int size = datas.size();
|
||||
|
||||
if (size == 1) {
|
||||
StubElement stub = datas.get(0).getStub();
|
||||
StubElement stub = datas.get(0).getStub(false);
|
||||
return new StubTree((PsiFileStub)stub);
|
||||
}
|
||||
else if (size != 0) {
|
||||
|
||||
@@ -306,7 +306,7 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi
|
||||
final Map<StubIndexKey, Map<Object, TIntArrayList>> stubTree;
|
||||
if (!data.isEmpty()) {
|
||||
final SerializedStubTree stub = data.values().iterator().next();
|
||||
stubTree = new StubTree((PsiFileStub)stub.getStub(), false).indexStubTree();
|
||||
stubTree = new StubTree((PsiFileStub)stub.getStub(true), false).indexStubTree();
|
||||
}
|
||||
else {
|
||||
stubTree = Collections.emptyMap();
|
||||
|
||||
+1
-1
@@ -935,7 +935,7 @@ public class ChangesCacheFile {
|
||||
// a previous incoming changes refresh. So we try to search for the deletion of this file through all
|
||||
// subsequent committed changelists, regardless of whether they are in "incoming" status.
|
||||
private boolean wasSubsequentlyDeleted(final FilePath file, long indexOffset) {
|
||||
try { // todo should be fixed here
|
||||
try {
|
||||
indexOffset += INDEX_ENTRY_SIZE;
|
||||
while(indexOffset < myIndexStream.length()) {
|
||||
IndexEntry e = getIndexEntryAtOffset(indexOffset);
|
||||
|
||||
+6
-1
@@ -269,7 +269,12 @@ public class PropertyParser {
|
||||
property = new AttributePropertyWithDefault(name, definition, "wrap_content");
|
||||
}
|
||||
else if (formats.contains(AttributeFormat.Flag)) {
|
||||
property = new FlagProperty(name, definition);
|
||||
if ("layout:gravity".equals(name)) {
|
||||
property = new GravityProperty(name, definition);
|
||||
}
|
||||
else {
|
||||
property = new FlagProperty(name, definition);
|
||||
}
|
||||
}
|
||||
else {
|
||||
property = new AttributeProperty(name, definition);
|
||||
|
||||
+3
-3
@@ -1044,7 +1044,7 @@
|
||||
tooltip="A Layout that arranges its children in a single column or a single row."/>
|
||||
|
||||
<properties important="orientation gravity baselineAligned measureWithLargestChild showDividers"
|
||||
expert="layout:gravity.fill layout:gravity.fill_horizontal layout:gravity.fill_vertical layout:gravity.clip_vertical layout:gravity.clip_horizontal"
|
||||
expert="layout:gravity.fill layout:gravity.clip"
|
||||
top="gravity orientation"
|
||||
/>
|
||||
|
||||
@@ -1068,7 +1068,7 @@
|
||||
tooltip="FrameLayout is designed to block out an area on the screen to display a single item."/>
|
||||
|
||||
<properties important="foreground foregroundGravity"
|
||||
expert="layout:gravity.fill layout:gravity.fill_horizontal layout:gravity.fill_vertical layout:gravity.clip_vertical layout:gravity.clip_horizontal"
|
||||
expert="layout:gravity.fill layout:gravity.clip"
|
||||
/>
|
||||
|
||||
<creation>
|
||||
@@ -1144,7 +1144,7 @@
|
||||
|
||||
<properties important="orientation rowCount columnCount"
|
||||
top="rowCount columnCount orientation"
|
||||
expert="layout:gravity.clip_vertical layout:gravity.clip_horizontal"
|
||||
expert="layout:gravity.clip"
|
||||
/>
|
||||
|
||||
<palette title="GridLayout" icon="/com/intellij/android/designer/icons/GridLayout.png"
|
||||
|
||||
+7
-7
@@ -38,8 +38,8 @@ import java.util.*;
|
||||
*/
|
||||
public class FlagProperty extends Property<RadViewComponent> implements IPropertyDecorator {
|
||||
private final PropertyRenderer myRenderer = new LabelPropertyRenderer(null);
|
||||
private final AttributeDefinition myDefinition;
|
||||
private final List<Property<RadViewComponent>> myOptions = new ArrayList<Property<RadViewComponent>>();
|
||||
protected final AttributeDefinition myDefinition;
|
||||
protected final List<Property<RadViewComponent>> myOptions = new ArrayList<Property<RadViewComponent>>();
|
||||
|
||||
public FlagProperty(@NotNull String name, @NotNull AttributeDefinition definition) {
|
||||
super(null, name);
|
||||
@@ -114,11 +114,11 @@ public class FlagProperty extends Property<RadViewComponent> implements IPropert
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private XmlAttribute getAttribute(RadViewComponent component) {
|
||||
protected XmlAttribute getAttribute(RadViewComponent component) {
|
||||
return component.getTag().getAttribute("android:" + myDefinition.getName());
|
||||
}
|
||||
|
||||
private Set<String> getOptions(RadViewComponent component) throws Exception {
|
||||
protected Set<String> getOptions(RadViewComponent component) throws Exception {
|
||||
String value = component.getTag().getAttributeValue("android:" + myDefinition.getName());
|
||||
if (value == null) {
|
||||
return Collections.emptySet();
|
||||
@@ -167,9 +167,9 @@ public class FlagProperty extends Property<RadViewComponent> implements IPropert
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private class OptionProperty extends Property<RadViewComponent> {
|
||||
private PropertyRenderer myRenderer = new BooleanRenderer();
|
||||
private PropertyEditor myEditor = new BooleanEditor();
|
||||
protected class OptionProperty extends Property<RadViewComponent> {
|
||||
private final PropertyRenderer myRenderer = new BooleanRenderer();
|
||||
private final PropertyEditor myEditor = new BooleanEditor();
|
||||
private final String myValueName;
|
||||
|
||||
public OptionProperty(@Nullable Property parent, @NotNull String name, @NotNull String valueName) {
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
/*
|
||||
* Copyright 2000-2012 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.android.designer.propertyTable;
|
||||
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.android.designer.propertyTable.editors.StringsComboEditor;
|
||||
import com.intellij.designer.propertyTable.Property;
|
||||
import com.intellij.designer.propertyTable.PropertyEditor;
|
||||
import com.intellij.designer.propertyTable.PropertyRenderer;
|
||||
import com.intellij.designer.propertyTable.renderers.LabelPropertyRenderer;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.android.dom.attrs.AttributeDefinition;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class GravityProperty extends FlagProperty {
|
||||
private static final String[] CENTER = {"center_horizontal", "center_vertical", "center"};
|
||||
private static final String[] FILL = {"fill_horizontal", "fill_vertical", "fill"};
|
||||
private static final String[] CLIP = {"clip_horizontal", "clip_vertical"};
|
||||
|
||||
private static final String[] COMBO_ITEMS = {"horizontal", "vertical", "both"};
|
||||
|
||||
public GravityProperty(@NotNull String name, @NotNull AttributeDefinition definition) {
|
||||
super(name, definition);
|
||||
|
||||
myOptions.remove(getProperty("center_horizontal"));
|
||||
myOptions.remove(getProperty("center_vertical"));
|
||||
myOptions.set(getProperty("center"), new ComboOptionProperty(this, "center", CENTER) {
|
||||
@Override
|
||||
protected void setValue(RadViewComponent component, int index) throws Exception {
|
||||
if (index == 0) {
|
||||
setOptions(component, new String[]{"center_horizontal"}, new String[]{"center_vertical", "center"});
|
||||
}
|
||||
else if (index == 1) {
|
||||
setOptions(component, new String[]{"center_vertical"}, new String[]{"center_horizontal", "center"});
|
||||
}
|
||||
else {
|
||||
setOptions(component, new String[]{"center"}, new String[]{"center_horizontal", "center_vertical"});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
myOptions.remove(getProperty("fill_horizontal"));
|
||||
myOptions.remove(getProperty("fill_vertical"));
|
||||
myOptions.set(getProperty("fill"), new ComboOptionProperty(this, "fill", FILL) {
|
||||
@Override
|
||||
protected void setValue(RadViewComponent component, int index) throws Exception {
|
||||
if (index == 0) {
|
||||
setOptions(component, new String[]{"fill_horizontal"}, new String[]{"fill_vertical", "fill"});
|
||||
}
|
||||
else if (index == 1) {
|
||||
setOptions(component, new String[]{"fill_vertical"}, new String[]{"fill_horizontal", "fill"});
|
||||
}
|
||||
else {
|
||||
setOptions(component, new String[]{"fill"}, new String[]{"fill_horizontal", "fill_vertical"});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
myOptions.remove(getProperty("clip_vertical"));
|
||||
myOptions.set(getProperty("clip_horizontal"), new ComboOptionProperty(this, "clip", CLIP) {
|
||||
@Override
|
||||
protected void setValue(RadViewComponent component, int index) throws Exception {
|
||||
if (index == 0) {
|
||||
setOptions(component, new String[]{"clip_horizontal"}, new String[]{"clip_vertical"});
|
||||
}
|
||||
else if (index == 1) {
|
||||
setOptions(component, new String[]{"clip_vertical"}, new String[]{"clip_horizontal"});
|
||||
}
|
||||
else {
|
||||
setOptions(component, CLIP, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int getProperty(String name) {
|
||||
int size = myOptions.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (name.equals(myOptions.get(i).getName())) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
StringBuilder value = new StringBuilder("[");
|
||||
Set<String> options = getOptions(component);
|
||||
int index = 0;
|
||||
for (Property option : myOptions) {
|
||||
String name = null;
|
||||
|
||||
if (option instanceof OptionProperty) {
|
||||
if (options.contains(((OptionProperty)option).getValueName())) {
|
||||
name = option.getName();
|
||||
}
|
||||
}
|
||||
else {
|
||||
name = ((ComboOptionProperty)option).getValue(options);
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
if (index++ > 0) {
|
||||
value.append(", ");
|
||||
}
|
||||
value.append(name);
|
||||
}
|
||||
}
|
||||
return value.append("]").toString();
|
||||
}
|
||||
|
||||
private void setOptions(final RadViewComponent component, @Nullable String[] setNames, @Nullable String[] unsetNames) throws Exception {
|
||||
final Set<String> options = new HashSet<String>(getOptions(component));
|
||||
if (unsetNames != null) {
|
||||
for (String name : unsetNames) {
|
||||
options.remove(name);
|
||||
}
|
||||
}
|
||||
if (setNames != null) {
|
||||
Collections.addAll(options, setNames);
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (options.isEmpty()) {
|
||||
XmlAttribute attribute = getAttribute(component);
|
||||
if (attribute != null) {
|
||||
attribute.delete();
|
||||
}
|
||||
}
|
||||
else {
|
||||
component.getTag().setAttribute("android:" + myDefinition.getName(), StringUtil.join(options, "|"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private abstract class ComboOptionProperty extends Property<RadViewComponent> {
|
||||
private final PropertyRenderer myRenderer = new LabelPropertyRenderer(null);
|
||||
private final PropertyEditor myEditor = new StringsComboEditor(COMBO_ITEMS);
|
||||
private final String[] myValues;
|
||||
|
||||
public ComboOptionProperty(@Nullable Property parent, @NotNull String name, String[] values) {
|
||||
super(parent, name);
|
||||
myValues = values;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getValue(Set<String> options) {
|
||||
StringBuilder values = new StringBuilder();
|
||||
int index = 0;
|
||||
for (String value : myValues) {
|
||||
if (options.contains(value)) {
|
||||
if (index++ > 0) {
|
||||
values.append(", ");
|
||||
}
|
||||
values.append(value);
|
||||
}
|
||||
}
|
||||
return index == 0 ? null : values.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
Set<String> options = getOptions(component);
|
||||
int lastIndex = -1;
|
||||
for (int i = 0; i < myValues.length; i++) {
|
||||
if (options.contains(myValues[i])) {
|
||||
lastIndex = i;
|
||||
}
|
||||
}
|
||||
return lastIndex == -1 ? null : COMBO_ITEMS[lastIndex];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(RadViewComponent component, Object value) throws Exception {
|
||||
int index = ArrayUtil.indexOf(COMBO_ITEMS, value);
|
||||
if (index == -1) {
|
||||
setOptions(component, null, myValues);
|
||||
}
|
||||
else {
|
||||
setValue(component, index);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void setValue(RadViewComponent component, int index) throws Exception;
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
Set<String> options = getOptions(component);
|
||||
for (String value : myValues) {
|
||||
if (options.contains(value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
setValue(component, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property<RadViewComponent> createForNewPresentation(@Nullable Property parent, @NotNull String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PropertyRenderer getRenderer() {
|
||||
return myRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyEditor getEditor() {
|
||||
return myEditor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needRefreshPropertyList() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package com.intellij.android.designer.propertyTable.renderers;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class AttributePropertyWithDefault {
|
||||
}
|
||||
+2
-12
@@ -17,13 +17,13 @@ package com.intellij.android.designer.propertyTable.renderers;
|
||||
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.designer.propertyTable.PropertyRenderer;
|
||||
import com.intellij.designer.propertyTable.PropertyTable;
|
||||
import com.intellij.designer.propertyTable.renderers.BooleanRenderer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.SimpleColoredComponent;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.ui.EmptyIcon;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.android.dom.attrs.AttributeFormat;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -65,17 +65,7 @@ public class ResourceRenderer implements PropertyRenderer {
|
||||
}
|
||||
|
||||
myColoredComponent.clear();
|
||||
|
||||
if (selected) {
|
||||
myColoredComponent.setForeground(UIUtil.getTableSelectionForeground());
|
||||
Color background = UIUtil.getTableSelectionBackground();
|
||||
myColoredComponent.setBackground(background);
|
||||
}
|
||||
else {
|
||||
myColoredComponent.setForeground(UIUtil.getTableForeground());
|
||||
myColoredComponent.setBackground(UIUtil.getTableBackground());
|
||||
}
|
||||
|
||||
PropertyTable.updateRenderer(myColoredComponent, selected);
|
||||
formatValue(value);
|
||||
|
||||
return myColoredComponent;
|
||||
|
||||
@@ -127,7 +127,6 @@ public class GitVcs extends AbstractVcs<CommittedChangeList> {
|
||||
|
||||
private GitVFSListener myVFSListener; // a VFS listener that tracks file addition, deletion, and renaming.
|
||||
|
||||
private final BackgroundTaskQueue myTaskQueue; // The queue that is used to schedule background task from actions
|
||||
private final ReadWriteLock myCommandLock = new ReentrantReadWriteLock(true); // The command read/write lock
|
||||
private final TreeDiffProvider myTreeDiffProvider;
|
||||
private final GitCommitAndPushExecutor myCommitAndPushExecutor;
|
||||
@@ -172,7 +171,6 @@ public class GitVcs extends AbstractVcs<CommittedChangeList> {
|
||||
myOutgoingChangesProvider = new GitOutgoingChangesProvider(myProject);
|
||||
myTreeDiffProvider = new GitTreeDiffProvider(myProject);
|
||||
myCommitAndPushExecutor = new GitCommitAndPushExecutor(myCheckinEnvironment);
|
||||
myTaskQueue = new BackgroundTaskQueue(myProject, GitBundle.getString("task.queue.title"));
|
||||
myExecutableValidator = new GitExecutableValidator(myProject, this);
|
||||
myPlatformFacade = ServiceManager.getService(myProject, PlatformFacade.class);
|
||||
}
|
||||
@@ -187,10 +185,7 @@ public class GitVcs extends AbstractVcs<CommittedChangeList> {
|
||||
* @param task the task to run
|
||||
*/
|
||||
public static void runInBackground(Task.Backgroundable task) {
|
||||
GitVcs vcs = getInstance(task.getProject());
|
||||
if (vcs != null) {
|
||||
vcs.myTaskQueue.run(task);
|
||||
}
|
||||
task.queue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,7 +68,7 @@ public class GitPull extends GitRepositoryAction {
|
||||
final Label beforeLabel = LocalHistory.getInstance().putSystemLabel(project, "Before update");
|
||||
|
||||
final AtomicReference<GitLineHandler> handlerReference = new AtomicReference<GitLineHandler>();
|
||||
new Task.Modal(project, GitBundle.message("pulling.title", dialog.getRemote()), true) {
|
||||
new Task.Backgroundable(project, GitBundle.message("pulling.title", dialog.getRemote()), true) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
final GitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(myProject);
|
||||
|
||||
@@ -129,9 +129,13 @@ public class GitRootScanner implements BulkFileListener, ModuleRootListener, Dis
|
||||
return;
|
||||
}
|
||||
myScanning = true;
|
||||
myRootProblemNotifier.rescanAndNotifyIfNeeded();
|
||||
myExecuteAfterScan.run();
|
||||
myScanning = false;
|
||||
try {
|
||||
myRootProblemNotifier.rescanAndNotifyIfNeeded();
|
||||
myExecuteAfterScan.run();
|
||||
}
|
||||
finally {
|
||||
myScanning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
@@ -898,6 +898,17 @@ public final class PropertyTable extends JBTable implements ComponentSelectionLi
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateRenderer(JComponent component, boolean selected) {
|
||||
if (selected) {
|
||||
component.setForeground(UIUtil.getTableSelectionForeground());
|
||||
component.setBackground(UIUtil.getTableSelectionBackground());
|
||||
}
|
||||
else {
|
||||
component.setForeground(UIUtil.getTableForeground());
|
||||
component.setBackground(UIUtil.getTableBackground());
|
||||
}
|
||||
}
|
||||
|
||||
private class PropertyCellRenderer implements TableCellRenderer {
|
||||
private final ColoredTableCellRenderer myPropertyNameRenderer;
|
||||
private final ColoredTableCellRenderer myErrorRenderer;
|
||||
|
||||
+2
-10
@@ -17,7 +17,7 @@ package com.intellij.designer.propertyTable.renderers;
|
||||
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.designer.propertyTable.PropertyRenderer;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.designer.propertyTable.PropertyTable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -30,15 +30,7 @@ import javax.swing.*;
|
||||
public class BooleanRenderer extends JCheckBox implements PropertyRenderer {
|
||||
@NotNull
|
||||
public JComponent getComponent(@Nullable RadComponent component, @Nullable Object value, boolean selected, boolean hasFocus) {
|
||||
if (selected) {
|
||||
setForeground(UIUtil.getTableSelectionForeground());
|
||||
setBackground(UIUtil.getTableSelectionBackground());
|
||||
}
|
||||
else {
|
||||
setForeground(UIUtil.getTableForeground());
|
||||
setBackground(UIUtil.getTableBackground());
|
||||
}
|
||||
|
||||
PropertyTable.updateRenderer(this, selected);
|
||||
setSelected(value != null && (Boolean)value);
|
||||
return this;
|
||||
}
|
||||
|
||||
+2
-9
@@ -17,7 +17,7 @@ package com.intellij.designer.propertyTable.renderers;
|
||||
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.designer.propertyTable.PropertyRenderer;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.designer.propertyTable.PropertyTable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -47,14 +47,7 @@ public class LabelPropertyRenderer extends JLabel implements PropertyRenderer {
|
||||
setIcon(null);
|
||||
|
||||
// Background and foreground
|
||||
if (selected) {
|
||||
setForeground(UIUtil.getTableSelectionForeground());
|
||||
setBackground(UIUtil.getTableSelectionBackground());
|
||||
}
|
||||
else {
|
||||
setForeground(UIUtil.getTableForeground());
|
||||
setBackground(UIUtil.getTableBackground());
|
||||
}
|
||||
PropertyTable.updateRenderer(this, selected);
|
||||
|
||||
if (value != null) {
|
||||
customize(value);
|
||||
|
||||
Reference in New Issue
Block a user