|
package KnowledgeBase;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.system.Bitmap;
class ArticleScreen extends MainScreen {
private LabelField titleLabel;
private LabelField authorLabel;
private LabelField dateLabel;
private LabelField tagsLabel;
private LabelField contentsLabel;
ArticleScreen() {
titleLabel = new LabelField();
authorLabel = new LabelField();
dateLabel = new LabelField();
tagsLabel = new LabelField();
contentsLabel = new LabelField();
this.add(titleLabel);
this.add(new SeparatorField());
this.add(authorLabel);
this.add(dateLabel);
this.add(tagsLabel);
this.add(new SeparatorField());
this.add(contentsLabel);
}
public void showArticle(Article article) {
titleLabel.setText(article.title);
authorLabel.setText("Author: " + article.author);
dateLabel.setText("Created: " + article.dateCreated);
String tags = "Tags: ";
for (int i = 0; i < article.tags.length - 1; i++) {
tags += article.tags[i] + ", ";
}
tags += article.tags[article.tags.length - 1];
tagsLabel.setText(tags);
contentsLabel.setText(article.contents);
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.