use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.
the class TriStateCheckboxCell method render.
@Override
public void render(Context context, Boolean value, SafeHtmlBuilder sb) {
ImageResource img;
if (value == null)
img = RES.checkboxIndeterminate();
else if (value)
img = RES.checkboxOn();
else
img = RES.checkboxOff();
sb.append(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(img).getHTML()));
}
use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.
the class GlobalToolbar method completeInitialization.
public void completeInitialization(SessionInfo sessionInfo) {
StandardIcons icons = StandardIcons.INSTANCE;
if (sessionInfo.isVcsEnabled()) {
addLeftSeparator();
ToolbarPopupMenu vcsMenu = new ToolbarPopupMenu();
vcsMenu.addItem(commands_.vcsFileDiff().createMenuItem(false));
vcsMenu.addItem(commands_.vcsFileLog().createMenuItem(false));
vcsMenu.addItem(commands_.vcsFileRevert().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsViewOnGitHub().createMenuItem(false));
vcsMenu.addItem(commands_.vcsBlameOnGitHub().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsCommit().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsPull().createMenuItem(false));
vcsMenu.addItem(commands_.vcsCleanup().createMenuItem(false));
vcsMenu.addItem(commands_.vcsPush().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsShowHistory().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.versionControlProjectSetup().createMenuItem(false));
ImageResource vcsIcon = null;
if (sessionInfo.getVcsName().equals(VCSConstants.GIT_ID))
vcsIcon = new ImageResource2x(icons.git2x());
else if (sessionInfo.getVcsName().equals(VCSConstants.SVN_ID))
vcsIcon = new ImageResource2x(icons.svn2x());
ToolbarButton vcsButton = new ToolbarButton(null, vcsIcon, vcsMenu);
vcsButton.setTitle("Version control");
addLeftWidget(vcsButton);
}
// zoom button
addLeftSeparator();
ToolbarPopupMenu paneLayoutMenu = new ToolbarPopupMenu();
paneLayoutMenu.addItem(commands_.layoutEndZoom().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.layoutConsoleOnLeft().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutConsoleOnRight().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.paneLayout().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.layoutZoomSource().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomConsole().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomHelp().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.layoutZoomHistory().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomFiles().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomPlots().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomPackages().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomEnvironment().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomViewer().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomVcs().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomBuild().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomConnections().createMenuItem(false));
ImageResource paneLayoutIcon = new ImageResource2x(ThemeResources.INSTANCE.paneLayoutIcon2x());
ToolbarButton paneLayoutButton = new ToolbarButton(null, paneLayoutIcon, paneLayoutMenu);
paneLayoutButton.setTitle("Workspace Panes");
addLeftWidget(paneLayoutButton);
// addins menu
ToolbarPopupMenu addinsMenu = new ToolbarPopupMenu();
addinsMenu.addItem(commands_.addinsMru0().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru1().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru2().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru3().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru4().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru5().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru6().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru7().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru8().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru9().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru10().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru11().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru12().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru13().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru14().createMenuItem(false));
addinsMenu.addSeparator();
addinsMenu.addItem(commands_.browseAddins().createMenuItem(false));
addLeftSeparator();
ToolbarButton addinsButton = new ToolbarButton("Addins", CoreResources.INSTANCE.iconEmpty(), addinsMenu);
addLeftWidget(addinsButton);
// project popup menu
ProjectPopupMenu projectMenu = new ProjectPopupMenu(sessionInfo, commands_);
addRightWidget(projectMenu.getToolbarButton());
}
use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.
the class Wizard method createMainWidget.
@Override
protected Widget createMainWidget() {
WizardResources res = WizardResources.INSTANCE;
WizardResources.Styles styles = res.styles();
VerticalPanel mainWidget = new VerticalPanel();
mainWidget.addStyleName(getMainWidgetStyle());
headerPanel_ = new LayoutPanel();
headerPanel_.addStyleName(styles.headerPanel());
// layout constants
final int kTopMargin = 5;
final int kLeftMargin = 8;
final int kCaptionWidth = 400;
final int kCaptionHeight = 30;
final int kPageUILeftMargin = 123;
// first page caption
subCaptionLabel_ = new Label(firstPage_.getPageCaption());
subCaptionLabel_.addStyleName(styles.headerLabel());
headerPanel_.add(subCaptionLabel_);
headerPanel_.setWidgetLeftWidth(subCaptionLabel_, kTopMargin, Unit.PX, kCaptionWidth, Unit.PX);
headerPanel_.setWidgetTopHeight(subCaptionLabel_, kLeftMargin, Unit.PX, kCaptionHeight, Unit.PX);
// second page back button
ImageResource bkImg = res.wizardBackButton();
backButton_ = new Label("Back");
backButton_.addStyleName(styles.wizardBackButton());
backButton_.addStyleName(ThemeResources.INSTANCE.themeStyles().handCursor());
headerPanel_.add(backButton_);
headerPanel_.setWidgetLeftWidth(backButton_, kTopMargin - 2, Unit.PX, bkImg.getWidth(), Unit.PX);
headerPanel_.setWidgetTopHeight(backButton_, kTopMargin - 2, Unit.PX, bkImg.getHeight(), Unit.PX);
backButton_.setVisible(false);
backButton_.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
goBack();
}
});
// second page caption label
pageCaptionLabel_ = new Label();
pageCaptionLabel_.addStyleName(styles.headerLabel());
headerPanel_.add(pageCaptionLabel_);
headerPanel_.setWidgetLeftWidth(pageCaptionLabel_, kPageUILeftMargin, Unit.PX, kCaptionWidth, Unit.PX);
headerPanel_.setWidgetTopHeight(pageCaptionLabel_, kLeftMargin, Unit.PX, kCaptionHeight, Unit.PX);
pageCaptionLabel_.setVisible(false);
mainWidget.add(headerPanel_);
// main body panel for transitions
bodyPanel_ = new LayoutPanel();
ArrayList<String> wizardBodyStyles = getWizardBodyStyles();
for (String styleName : wizardBodyStyles) bodyPanel_.addStyleName(styleName);
bodyPanel_.getElement().getStyle().setProperty("overflowX", "hidden");
mainWidget.add(bodyPanel_);
// add first page (and all sub-pages recursively)
addAndInitializePage(firstPage_, true);
setNextButtonState(firstPage_);
return mainWidget;
}
use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.
the class FileTypeRegistry method getIconForFilename.
public ImageResource getIconForFilename(String filename) {
ImageResource icon = iconsByFilename_.get(filename.toLowerCase());
if (icon != null)
return icon;
String ext = FileSystemItem.getExtensionFromPath(filename);
icon = iconsByFileExtension_.get(ext.toLowerCase());
if (icon != null)
return icon;
return new ImageResource2x(ICONS.iconText2x());
}
use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.
the class CodeSearchSuggestion method setFileDisplayString.
public void setFileDisplayString(String file, String displayString) {
// compute display string
ImageResource image = fileTypeRegistry_.getIconForFilename(file);
displayString_ = createDisplayString(image, RES.styles().fileImage(), displayString, null, null);
}
Aggregations