Fix scrolling position (#423)
* Fix remembering scroll position when textfiel contains text * Catch exception in custom swap that can cause the plugin to fail loading * Fix checkstyle ConfigPanel
This commit is contained in:
@@ -32,6 +32,7 @@ import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.ItemEvent;
|
||||
@@ -199,6 +200,15 @@ public class ConfigPanel extends PluginPanel
|
||||
|
||||
}
|
||||
|
||||
static class configTextArea extends JTextArea
|
||||
{
|
||||
@Override
|
||||
public void scrollRectToVisible(final Rectangle aRect)
|
||||
{
|
||||
// supress scrollToRect in textarea
|
||||
}
|
||||
}
|
||||
|
||||
private void initializePluginList()
|
||||
{
|
||||
final List<String> pinnedPlugins = getPinnedPluginNames();
|
||||
@@ -652,7 +662,7 @@ public class ConfigPanel extends PluginPanel
|
||||
}
|
||||
else
|
||||
{
|
||||
final JTextArea textArea = new JTextArea();
|
||||
final JTextArea textArea = new configTextArea();
|
||||
textArea.setLineWrap(true);
|
||||
textArea.setWrapStyleWord(true);
|
||||
textField = textArea;
|
||||
|
||||
@@ -1155,7 +1155,16 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
if (!Strings.isNullOrEmpty(config))
|
||||
{
|
||||
Map<String, String> split = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config);
|
||||
Map<String, String> split;
|
||||
|
||||
try
|
||||
{
|
||||
split = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config);
|
||||
}
|
||||
catch (IllegalArgumentException ex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : split.entrySet())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user