- Timestamp:
- 04/15/08 23:36:25 (5 years ago)
- Location:
- lang/java/sabotter/trunk/src/jp/xet/eclipse/sabotter/views
- Files:
-
- 1 added
- 2 modified
-
LabelProcessor.java (modified) (1 diff)
-
SabotterSelectionChangedListener.java (added)
-
SabotterView.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/java/sabotter/trunk/src/jp/xet/eclipse/sabotter/views/LabelProcessor.java
r9392 r9517 33 33 public class LabelProcessor { 34 34 35 DateFormat dfIn =35 private DateFormat dfIn = 36 36 new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.US); 37 37 38 DateFormat dfOut =38 private DateFormat dfOut = 39 39 new SimpleDateFormat("HH:mm:ss yyyy/MM/dd", Locale.getDefault()); 40 40 -
lang/java/sabotter/trunk/src/jp/xet/eclipse/sabotter/views/SabotterView.java
r9511 r9517 25 25 import org.eclipse.swt.events.KeyAdapter; 26 26 import org.eclipse.swt.events.KeyEvent; 27 import org.eclipse.swt.events.ModifyEvent; 28 import org.eclipse.swt.events.ModifyListener; 27 29 import org.eclipse.swt.events.SelectionEvent; 28 30 import org.eclipse.swt.events.SelectionListener; 31 import org.eclipse.swt.graphics.Color; 29 32 import org.eclipse.swt.layout.GridData; 30 33 import org.eclipse.swt.layout.GridLayout; … … 32 35 import org.eclipse.swt.widgets.Composite; 33 36 import org.eclipse.swt.widgets.Display; 37 import org.eclipse.swt.widgets.Label; 34 38 import org.eclipse.swt.widgets.Menu; 35 39 import org.eclipse.swt.widgets.Table; … … 72 76 new ColumnPixelData(130) 73 77 }; 78 79 private Label charCount; 74 80 75 81 public class SabotterListener extends TwitterAdapter { … … 129 135 public void createPartControl(Composite parent) { 130 136 Composite composite = new Composite(parent, SWT.NULL); 131 composite.setLayout(new GridLayout( 2, false));137 composite.setLayout(new GridLayout(3, false)); 132 138 composite.setLayoutData(new GridData(GridData.FILL_BOTH)); 133 139 … … 142 148 viewer.setSorter(new TimeLineSorter(viewer.getTable().getColumn(2))); 143 149 viewer.setInput(manager); 150 viewer.addSelectionChangedListener(new SabotterSelectionChangedListener()); 144 151 145 152 postInput = new Text(composite, SWT.BORDER); … … 155 162 156 163 }); 164 postInput.addModifyListener(new ModifyListener() { 165 public void modifyText(ModifyEvent e) { 166 if(charCount != null && charCount.isDisposed() == false) { 167 int remain = 140 - postInput.getText().length(); 168 charCount.setText(String.valueOf(remain)); 169 if(remain >= 20) { 170 postInput.setBackground(new Color(null, 255, 255, 255)); 171 postInput.setForeground(new Color(null, 0, 0, 0)); 172 } else if(remain >= 0) { 173 postInput.setBackground(new Color(null, 255, 255, 0)); 174 postInput.setForeground(new Color(null, 0, 0, 0)); 175 } else { 176 postInput.setBackground(new Color(null, 255, 0, 0)); 177 postInput.setForeground(new Color(null, 255, 255, 255)); 178 } 179 } 180 } 181 }); 182 charCount = new Label(composite, SWT.NULL); 183 charCount.setLayoutData(new GridData()); 184 charCount.setText(" 0"); 185 charCount.setAlignment(SWT.RIGHT); 186 157 187 Button postButton = new Button(composite, SWT.PUSH); 158 postButton.setLayoutData(new GridData( GridData.FILL));188 postButton.setLayoutData(new GridData()); 159 189 postButton.setText("Post"); 160 190 postButton.addSelectionListener(new SelectionListener() { … … 178 208 private void initTable() { 179 209 Table table = viewer.getTable(); 180 TableLayout layout = new TableLayout();181 table.setLayout(layout);210 TableLayout layout = new TableLayout(); 211 table.setLayout(layout); 182 212 table.setHeaderVisible(true); 183 213 table.setLinesVisible(true); 184 214 GridData gd = new GridData(GridData.FILL_BOTH); 185 gd.horizontalSpan = 2;215 gd.horizontalSpan = 3; 186 216 table.setLayoutData(gd); 187 217
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)