use different icons to distinguish between the ui filters
This commit is contained in:
parent
26af16d0c8
commit
9c77b9edc1
@ -4,7 +4,9 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
|
||||
import de.marhali.easyi18n.InstanceManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
@ -15,16 +17,15 @@ import java.util.ResourceBundle;
|
||||
* @author marhali
|
||||
*/
|
||||
public class FilterDuplicateAction extends AnAction {
|
||||
// TODO: Custom icon to differentiate between incomplete and duplicate filter
|
||||
public FilterDuplicateAction() {
|
||||
super(ResourceBundle.getBundle("messages").getString("action.filter.duplicate"),
|
||||
null, AllIcons.General.ShowWarning);
|
||||
null, AllIcons.Actions.PreserveCase);
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
Project project = Objects.requireNonNull(e.getProject());
|
||||
boolean enable = e.getPresentation().getIcon() == AllIcons.General.ShowWarning;
|
||||
e.getPresentation().setIcon(enable ? AllIcons.General.Warning : AllIcons.General.ShowWarning);
|
||||
boolean enable = e.getPresentation().getIcon() == AllIcons.Actions.PreserveCase;
|
||||
e.getPresentation().setIcon(enable ? AllIcons.Actions.PreserveCaseSelected : AllIcons.Actions.PreserveCase);
|
||||
InstanceManager.get(project).bus().propagate().onFilterDuplicate(enable);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
|
||||
import de.marhali.easyi18n.InstanceManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
@ -15,17 +17,16 @@ import java.util.ResourceBundle;
|
||||
* @author marhali
|
||||
*/
|
||||
public class FilterIncompleteAction extends AnAction {
|
||||
// TODO: Custom icon to differentiate between incomplete and duplicate filter
|
||||
public FilterIncompleteAction() {
|
||||
super(ResourceBundle.getBundle("messages").getString("action.filter.incomplete"),
|
||||
null, AllIcons.General.ShowWarning);
|
||||
null, AllIcons.Actions.Words);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
Project project = Objects.requireNonNull(e.getProject());
|
||||
boolean enable = e.getPresentation().getIcon() == AllIcons.General.ShowWarning;
|
||||
e.getPresentation().setIcon(enable ? AllIcons.General.Warning : AllIcons.General.ShowWarning);
|
||||
boolean enable = e.getPresentation().getIcon() == AllIcons.Actions.Words;
|
||||
e.getPresentation().setIcon(enable ? AllIcons.Actions.WordsSelected : AllIcons.Actions.Words);
|
||||
InstanceManager.get(project).bus().propagate().onFilterIncomplete(enable);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user