Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: editor/tools/plugins/com.xored.glance.ui/src/com/xored/glance/internal/ui/sources/TextSourceMaker.java

Issue 17431004: New UI for Find command: find-as-you-type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /**
2 *
3 */
4 package com.xored.glance.internal.ui.sources;
5
6 import org.eclipse.swt.widgets.Control;
7
8 import com.xored.glance.ui.sources.ITextSource;
9 import com.xored.glance.ui.sources.ITextSourceDescriptor;
10
11 /**
12 * @author Yuri Strot
13 */
14 public class TextSourceMaker {
15
16 public TextSourceMaker(ITextSourceDescriptor description, Control control) {
17 this.description = description;
18 this.control = control;
19 }
20
21 public boolean isValid() {
22 return description == null ? false : description.isValid(control);
23 }
24
25 public ITextSource create() {
26 return description == null ? null : description.createSource(control);
27 }
28
29 /**
30 * @return the control
31 */
32 public Control getControl() {
33 return control;
34 }
35
36 @Override
37 public int hashCode() {
38 final int prime = 31;
39 int result = 1;
40 result = prime * result + ((control == null) ? 0 : control.hashCode());
41 result = prime * result + ((description == null) ? 0 : description.hashCode( ));
42 return result;
43 }
44
45 @Override
46 public boolean equals(Object obj) {
47 if (this == obj)
48 return true;
49 if (obj == null)
50 return false;
51 if (getClass() != obj.getClass())
52 return false;
53 TextSourceMaker other = (TextSourceMaker) obj;
54 if (control == null) {
55 if (other.control != null)
56 return false;
57 } else if (!control.equals(other.control))
58 return false;
59 if (description == null) {
60 if (other.description != null)
61 return false;
62 } else if (!description.equals(other.description))
63 return false;
64 return true;
65 }
66
67 private ITextSourceDescriptor description;
68 private Control control;
69
70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698