Changeset 293 for trunk/hiptop/pester/net
- Timestamp:
- 07/27/06 03:40:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/net/sabi/pester/AlarmListWindow.java
r246 r293 2 2 3 3 import danger.app.Application; 4 import danger.app.Event; 5 import danger.app.Resource; 6 import danger.text.span.SpanUtils; 7 import danger.text.span.SpannableString; 8 import danger.ui.DialogWindow; 9 import danger.ui.LinkTextBox; 4 10 import danger.ui.ScreenWindow; 5 11 import danger.ui.Menu; 6 12 import danger.ui.MenuItem; 13 import danger.ui.Scrollbar; 14 import danger.util.TextBuffer; 7 15 8 16 public class AlarmListWindow extends ScreenWindow … … 36 44 actionMenu.getItemWithID(ID_DISCARD_ITEM).setEnabled(haveFocusedItem); 37 45 } 46 47 public boolean receiveEvent(Event e) { 48 switch (e.type) { 49 case EVENT_ABOUT: 50 DialogWindow window = sPester.getDialog(ID_ABOUT_DIALOG, this); 51 LinkTextBox textBox = 52 (LinkTextBox)window.getDescendantWithID(ID_ABOUT_TEXT_BOX); 53 Resource aboutText = sPester.getResource(257, ID_ABOUT_TEXT); 54 int aboutSize = aboutText.getSize(); 55 byte b[] = new byte[aboutSize]; 56 aboutText.getBytes(b, 0, aboutSize); 57 String supportEmail = sPester.getString(ID_SUPPORT_EMAIL); 58 TextBuffer textBuffer = 59 new TextBuffer(aboutSize + supportEmail.length()); 60 textBuffer.insert(new String(b)); 61 SpannableString urlString = new SpannableString(supportEmail); 62 SpanUtils.addURL(urlString, 0, urlString.length(), 63 "mailto:" + supportEmail); 64 textBuffer.insert(urlString); 65 textBuffer.insert("."); 66 textBox.setText(textBuffer); 67 Scrollbar scrollbar = 68 (Scrollbar)window.getDescendantWithID(ID_ABOUT_TEXT_SCROLLBAR); 69 textBox.attachScrollbar(scrollbar); 70 window.show(); 71 return true; 72 } 73 return super.receiveEvent(e); 74 } 38 75 }
Note:
See TracChangeset
for help on using the changeset viewer.