本文整理汇总了Java中org.eclipse.jface.resource.JFaceResources类的典型用法代码示例。如果您正苦于以下问题:Java JFaceResources类的具体用法?Java JFaceResources怎么用?Java JFaceResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JFaceResources类属于org.eclipse.jface.resource包,在下文中一共展示了JFaceResources类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContent
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
@Override
protected void createContent() {
FormToolkit toolkit = getToolkit();
_Text = toolkit.createText(this, "", SWT.BORDER | SWT.SINGLE);
_Text.setFont(JFaceResources.getTextFont());
FormData formData = new FormData();
formData.top = new FormAttachment(0, 0);
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
_Text.setLayoutData(formData);
_Text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setDirtyInternal(true);
}
});
}
示例2: ToolBarNavigator
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
public ToolBarNavigator ( final Composite parent, final int style, final ViewManager viewManager )
{
this.viewManager = viewManager;
this.toolbar = new ToolBar ( parent, style );
this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( parent.getDisplay () ) );
this.toolbar.addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
handleDispose ();
}
} );
viewManager.addViewManagerListener ( this );
}
示例3: refresh
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
private void refresh ()
{
if ( this.color != null )
{
// we may not dispose, the manager has to do that
this.color = null;
}
if ( this.activeColor != null )
{
this.manager.destroyColor ( this.activeColor );
this.activeColor = null;
}
this.activeColor = JFaceResources.getColorRegistry ().getColorDescriptor ( this.name, this.defaultColor );
if ( this.activeColor != null )
{
this.color = this.manager.createColor ( this.activeColor );
}
}
示例4: createDialogArea
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite comp = (Composite) super.createDialogArea(parent);
Text filed = new Text(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
| SWT.READ_ONLY | SWT.MULTI);
filed.setText(text);
filed.setBackground(getShell().getDisplay().getSystemColor(
SWT.COLOR_LIST_BACKGROUND));
filed.setFont(JFaceResources.getTextFont());
PixelConverter pc = new PixelConverter(filed);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = pc.convertWidthInCharsToPixels(80);
gd.heightHint = pc.convertHeightInCharsToPixels(30);
filed.setLayoutData(gd);
return comp;
}
示例5: createFigure
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
@Override
protected IFigure createFigure() {
final LineLayout layout = new LineLayout();
layout.setHorizontal(true);
layout.setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
layout.setMinorAlignment(FlowLayout.ALIGN_BOTTOMRIGHT);
layout.setMinorSpacing(SPACING);
layout.setMargin(MARGIN);
FreeformLayer res = new FreeformLayer();
final Label toolTip = new Label();
toolTip.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
toolTip.setBackgroundColor(ColorConstants.tooltipBackground);
toolTip.setForegroundColor(ColorConstants.tooltipForeground);
toolTip.setText(getModel().getTimelineWindow().getProvider().getTextAt(getModel().getBranch()));
res.setToolTip(toolTip);
res.setLayoutManager(layout);
return res;
}
示例6: initializeViewer
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
private void initializeViewer(IDocument document) {
fAnnotationPreferences = EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
setDocument(document);
installViewerConfiguration();
setEditable(true);
Font font = JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
getTextWidget().setFont(font);
getTextWidget().setData("document",document);
Control control = getControl();
GridData data = new GridData(GridData.FILL_BOTH);
control.setLayoutData(data);
prependVerifyKeyListener(new VerifyKeyListener() {
@Override
public void verifyKey(VerifyEvent event) {
handleVerifyKeyPressed(event);
}
});
addDocumentListener(document);
}
示例7: getStyleSheet
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
protected String getStyleSheet() {
if (fgStyleSheet == null)
fgStyleSheet = loadStyleSheet();
String css = fgStyleSheet;
if (css != null) {
FontData fontData = JFaceResources.getFontRegistry().getFontData(
fontSymbolicName)[0];
css = HTMLPrinter.convertTopLevelFont(css, fontData);
}
return css;
}
示例8: createButtonsForButtonBar
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
createButton(parent, DEFAULTS_BUTTON_ID, JFaceResources.getString("defaults"), false); //$NON-NLS-1$
Label l = new Label(parent, SWT.NONE);
l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
l = new Label(parent, SWT.NONE);
l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridLayout layout = (GridLayout) parent.getLayout();
layout.numColumns += 2;
layout.makeColumnsEqualWidth = false;
super.createButtonsForButtonBar(parent);
}
示例9: getDisplayImage
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
@Override
public Image getDisplayImage() {
int done = getPercentDone();
if (done > 0) {
return super.getDisplayImage();
}
if (isBlocked()) {
return JFaceResources.getImage(ProgressManager.BLOCKED_JOB_KEY);
}
int state = getJob().getState();
if (state == Job.SLEEPING) {
return JFaceResources.getImage(ProgressManager.SLEEPING_JOB_KEY);
}
if (state == Job.WAITING) {
return JFaceResources.getImage(ProgressManager.WAITING_JOB_KEY);
}
//By default return the first progress image
return super.getDisplayImage();
}
示例10: updateToolBarValues
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
/**
* Set the images in the toolbar based on whether the receiver is finished
* or not. Also update tooltips if required.
*
*/
private void updateToolBarValues() {
if (isCompleted()) {
actionButton.setImage(JFaceResources
.getImage(CLEAR_FINISHED_JOB_KEY));
actionButton.setDisabledImage(JFaceResources
.getImage(DISABLED_CLEAR_FINISHED_JOB_KEY));
actionButton
.setToolTipText(ProgressMessages.NewProgressView_ClearJobToolTip);
} else {
actionButton.setImage(JFaceResources.getImage(STOP_IMAGE_KEY));
actionButton.setDisabledImage(JFaceResources
.getImage(DISABLED_STOP_IMAGE_KEY));
}
JobInfo[] infos = getJobInfos();
for (int i = 0; i < infos.length; i++) {
// Only disable if there is an unresponsive operation
if (infos[i].isCanceled() && !isCompleted()) {
actionButton.setEnabled(false);
return;
}
}
actionButton.setEnabled(true);
}
示例11: setColor
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
/**
* Set the color base on the index
*
* @param i
*/
public void setColor(int i) {
currentIndex = i;
if (selected) {
setAllBackgrounds(getDisplay().getSystemColor(
SWT.COLOR_LIST_SELECTION));
setAllForegrounds(getDisplay().getSystemColor(
SWT.COLOR_LIST_SELECTION_TEXT));
return;
}
if (i % 2 == 0) {
setAllBackgrounds(JFaceResources.getColorRegistry().get(
DARK_COLOR_KEY));
} else {
setAllBackgrounds(getDisplay().getSystemColor(
SWT.COLOR_LIST_BACKGROUND));
}
setAllForegrounds(getDisplay()
.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
}
示例12: createTextLayout
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
/**
* <p>
* Creates and initializes the text layout used to compute the size hint.
* </p>
*
* @since 3.2
*/
private void createTextLayout() {
fTextLayout= new TextLayout(fBrowser.getDisplay());
// Initialize fonts
String symbolicFontName= fSymbolicFontName == null ? JFaceResources.DIALOG_FONT : fSymbolicFontName;
Font font = JFaceResources.getFont(symbolicFontName);
fTextLayout.setFont(font);
fTextLayout.setWidth(-1);
font = JFaceResources.getFontRegistry().getBold(symbolicFontName);
fBoldStyle = new TextStyle(font, null, null);
// Compute and set tab width
fTextLayout.setText(" ");
int tabWidth = fTextLayout.getBounds().width;
fTextLayout.setTabs(new int[] {tabWidth});
fTextLayout.setText("");
}
示例13: initializeStreams
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
private void initializeStreams() {
synchronized(document) {
if (!initialized) {
commandStream = newOutputStream();
errorStream = newOutputStream();
messageStream = newOutputStream();
// install colors
commandColor = createColor(SVNUIPlugin.getStandardDisplay(), ISVNUIConstants.PREF_CONSOLE_COMMAND_COLOR);
commandStream.setColor(commandColor);
messageColor = createColor(SVNUIPlugin.getStandardDisplay(), ISVNUIConstants.PREF_CONSOLE_MESSAGE_COLOR);
messageStream.setColor(messageColor);
errorColor = createColor(SVNUIPlugin.getStandardDisplay(), ISVNUIConstants.PREF_CONSOLE_ERROR_COLOR);
errorStream.setColor(errorColor);
// install font
setFont(JFaceResources.getFontRegistry().get(ISVNUIConstants.PREF_CONSOLE_FONT));
initialized = true;
}
}
}
示例14: getFont
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
public Font getFont(Object element) {
ILogEntry entry = adaptToLogEntry(element);
if (entry == null)
return null;
SVNRevision revision = entry.getRevision();
SVNRevision currentRevision = getCurrentRevision();
if (currentRevision != null && currentRevision.equals(revision)) {
if (currentRevisionFont == null) {
Font defaultFont = JFaceResources.getDefaultFont();
FontData[] data = defaultFont.getFontData();
for (int i = 0; i < data.length; i++) {
data[i].setStyle(SWT.BOLD);
}
currentRevisionFont = new Font(viewer.getTable().getDisplay(), data);
}
return currentRevisionFont;
}
return null;
}
示例15: configureShell
import org.eclipse.jface.resource.JFaceResources; //导入依赖的package包/类
/**
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
@Override
protected void configureShell(final Shell newShell) {
super.configureShell(newShell);
newShell.setText(PasswordSafeJFace.APP_NAME);
// in macOS, the icon gets installed into the .app and this lower resolution one
// just gets in the way.
if (!System.getProperty("os.name").toLowerCase().contains("mac")) {
final Image jpwIcon = IOUtils.getImage(PasswordSafeJFace.class,
"/org/pwsafe/passwordsafeswt/images/cpane.ico"); //$NON-NLS-1$
newShell.setImage(jpwIcon);
// provide it for the rest of jpwsafe:
JFaceResources.getImageRegistry().put(JPW_ICON, jpwIcon);
Window.setDefaultImage(jpwIcon);
}
WidgetPreferences.tuneShell(newShell, getClass());
startOpeningDialogThread(newShell);
}