(no message)

This commit is contained in:
Alexey Kudravtsev
2005-02-22 13:24:49 +03:00
parent f4b6615a08
commit a109987de3
5 changed files with 71 additions and 58 deletions
@@ -11,7 +11,7 @@
<children>
<component id="ee5a7" class="javax.swing.JLabel">
<constraints>
<xy x="10" y="36" width="117" height="14"/>
<xy x="10" y="32" width="117" height="14"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0"/>
</constraints>
<properties>
@@ -20,27 +20,16 @@
</component>
<component id="df84a" class="javax.swing.JCheckBox" binding="myCbShowImportPopup">
<constraints>
<xy x="10" y="75" width="117" height="22"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
<xy x="10" y="101" width="117" height="22"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
</constraints>
<properties>
<text value="Show import popup"/>
</properties>
</component>
<component id="71c39" class="javax.swing.JTextField" binding="myMarkMinHeight">
<constraints>
<xy x="194" y="111" width="150" height="20"/>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<columns value="20"/>
</properties>
</component>
<component id="8d69a" class="javax.swing.JTextField" binding="myAutoreparseDelayField">
<constraints>
<xy x="194" y="33" width="150" height="20"/>
<xy x="194" y="29" width="150" height="20"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1">
<preferred-size width="150" height="-1"/>
</grid>
@@ -49,21 +38,32 @@
<columns value="20"/>
</properties>
</component>
<hspacer id="aeb82">
<constraints>
<xy x="344" y="106" width="73" height="11"/>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1"/>
</constraints>
</hspacer>
<component id="d4e7e" class="javax.swing.JLabel">
<constraints>
<xy x="10" y="122" width="174" height="14"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0"/>
<xy x="10" y="68" width="174" height="14"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0"/>
</constraints>
<properties>
<text value="Error stripe mark min height (pixels):"/>
</properties>
</component>
<hspacer id="aeb82">
<component id="71c39" class="javax.swing.JTextField" binding="myMarkMinHeight">
<constraints>
<xy x="344" y="81" width="73" height="11"/>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1"/>
<xy x="194" y="65" width="150" height="20"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
</hspacer>
<properties>
<columns value="20"/>
</properties>
</component>
</children>
</grid>
</form>
@@ -239,12 +239,10 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
}
private void showTooltip(MouseEvent e, final TooltipRenderer tooltipObject) {
if (tooltipObject != null) {
final TooltipController tooltipController = HintManager.getInstance().getTooltipController();
tooltipController.showTooltipByMouseMove(myEditor, e, tooltipObject,
myEditor.getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_RIGHT,
ERROR_STRIPE_TOOLTIP_GROUP);
}
final TooltipController tooltipController = HintManager.getInstance().getTooltipController();
tooltipController.showTooltipByMouseMove(myEditor, e, tooltipObject,
myEditor.getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_RIGHT,
ERROR_STRIPE_TOOLTIP_GROUP);
}
private int visibleLineToYPosition(int lineNumber, int scrollBarHeight) {
@@ -438,27 +436,37 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
}
public boolean doClick(final MouseEvent e, final double width) {
if (inside(e, width)) {
RangeHighlighter marker = markers.get(0);
final int offset = marker.getStartOffset();
final Document doc = myEditor.getDocument();
if (doc.getLineCount() > 0) {
// Necessary to expand folded block even if naviagting just before one
// Very useful when navigating to first unused import statement.
int lineEnd = doc.getLineEndOffset(doc.getLineNumber(offset));
myEditor.getCaretModel().moveToOffset(lineEnd);
}
myEditor.getCaretModel().moveToOffset(offset);
myEditor.getSelectionModel().removeSelection();
ScrollingModel scrollingModel = myEditor.getScrollingModel();
scrollingModel.disableAnimation();
scrollingModel.scrollToCaret(ScrollType.CENTER);
scrollingModel.enableAnimation();
fireErrorMarkerClicked(marker, e);
return true;
if (!inside(e, width)) {
return false;
}
return false;
final int y = e.getY();
RangeHighlighter marker = markers.get(0);
int offset = marker.getStartOffset();
for (int i = 0; i< paintingEndOffsets.size(); i++) {
final int endY = paintingEndOffsets.get(i);
if (y < endY) {
marker = markers.get(i);
offset = marker.getStartOffset();
break;
}
}
final Document doc = myEditor.getDocument();
if (doc.getLineCount() > 0) {
// Necessary to expand folded block even if naviagting just before one
// Very useful when navigating to first unused import statement.
int lineEnd = doc.getLineEndOffset(doc.getLineNumber(offset));
myEditor.getCaretModel().moveToOffset(lineEnd);
}
myEditor.getCaretModel().moveToOffset(offset);
myEditor.getSelectionModel().removeSelection();
ScrollingModel scrollingModel = myEditor.getScrollingModel();
scrollingModel.disableAnimation();
scrollingModel.scrollToCaret(ScrollType.CENTER);
scrollingModel.enableAnimation();
fireErrorMarkerClicked(marker, e);
return true;
}
private boolean inside(MouseEvent e, double width) {
@@ -491,9 +499,10 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
}
}
if (infos.size() != 0) {
// show errors first
Collections.sort(infos, new Comparator<HighlightInfo>() {
public int compare(final HighlightInfo o1, final HighlightInfo o2) {
return o1.getSeverity().compareTo(o2.getSeverity());
return o2.getSeverity().compareTo(o1.getSeverity());
}
});
final HighlightInfoComposite composite = new HighlightInfoComposite(infos);
+2 -1
View File
@@ -14,13 +14,14 @@ import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.util.EventListener;
import java.util.EventObject;
import java.util.Map;
public class LightweightHint implements Hint, UserDataHolder {
private static final Logger LOG = Logger.getInstance("#com.intellij.ui.LightweightHint");
private final JComponent myComponent;
private JComponent myFocusBackComponent;
private final THashMap myUserMap = new THashMap(1);
private final Map<Key,Object> myUserMap = new THashMap<Key, Object>(1);
private final EventListenerList myListenerList = new EventListenerList();
private MyEscListener myEscListener;
@@ -8,21 +8,24 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.containers.HashMap;
import gnu.trove.THashMap;
import java.util.Map;
public class UserDataHolderBase implements UserDataHolder, Cloneable{
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.UserDataHolderBase");
private THashMap myUserMap = null;
private Map<Key,Object> myUserMap = null;
private static final Object USER_MAP_LOCK = new Object();
protected static final Key<HashMap> COPYABLE_USER_MAP_KEY = Key.create("COPYABLE_USER_MAP_KEY");
protected static final Key<HashMap<Key,Object>> COPYABLE_USER_MAP_KEY = Key.create("COPYABLE_USER_MAP_KEY");
protected Object clone(){
try{
UserDataHolderBase clone = (UserDataHolderBase)super.clone();
HashMap copyableMap = (HashMap)clone.getUserData(COPYABLE_USER_MAP_KEY);
HashMap<Key,Object> copyableMap = clone.getUserData(COPYABLE_USER_MAP_KEY);
clone.myUserMap = null;
if (copyableMap != null){
clone.putUserData(COPYABLE_USER_MAP_KEY, (HashMap)copyableMap.clone());
final HashMap<Key,Object> mapclone = (HashMap<Key, Object>)copyableMap.clone();
clone.putUserData(COPYABLE_USER_MAP_KEY, mapclone);
}
return clone;
}
@@ -60,7 +63,7 @@ public class UserDataHolderBase implements UserDataHolder, Cloneable{
synchronized(USER_MAP_LOCK){
if (myUserMap == null){
if (value == null) return;
myUserMap = new THashMap(4);
myUserMap = new THashMap<Key, Object>(4);
}
if (value != null){
myUserMap.put(key, value);
@@ -80,7 +83,7 @@ public class UserDataHolderBase implements UserDataHolder, Cloneable{
protected <T> T getCopyableUserDataImpl(Key<T> key) {
synchronized(USER_MAP_LOCK){
HashMap map = (HashMap)getUserData(COPYABLE_USER_MAP_KEY);
HashMap map = getUserData(COPYABLE_USER_MAP_KEY);
if (map == null) return null;
return (T)map.get(key);
}
@@ -92,10 +95,10 @@ public class UserDataHolderBase implements UserDataHolder, Cloneable{
protected <T> void putCopyableUserDataImpl(Key<T> key, T value) {
synchronized(USER_MAP_LOCK){
HashMap map = (HashMap)getUserData(COPYABLE_USER_MAP_KEY);
HashMap<Key,Object> map = getUserData(COPYABLE_USER_MAP_KEY);
if (map == null){
if (value == null) return;
map = new HashMap(4);
map = new HashMap<Key, Object>(4);
putUserData(COPYABLE_USER_MAP_KEY, map);
}
if (value != null){
+1 -1
View File
@@ -30,7 +30,7 @@ public class SmartList<E> extends AbstractList<E> {
}
public E get(int index) {
if (index < 2) {
if (mySize <= 2) {
return myArray2[index];
}
else {