XUL Overlay for Preferences - firefox

I'm trying to make a XUL overlay for Preferences for my extension. I have the following code as part of my overlay, but it is still not appearing under Firefox->Preferences:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<overlay id="tabularity-browser-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="BrowserPreferences">
<prefpane id="tabularityPane" label="tabularityPane;"
onpaneload="populateSchedulesList()"
image="chrome://tabulationtwo/content/images/tab.png">
<preferences>
<preference id="perSession"
name="extensions.tabulation.defaultHomepage"
type="bool"/>
</preferences>
<radiogroup>
<radio preference="perSession" id="session" label="Open tabs once per session" accesskey="S" selected="true"/>
<radio preference="perSession" id="instance" label="Open tabs every tab instance" accesskey="I"/>
</radiogroup>
</prefpane>
</prefwindow>
Can anyone help me diagnose the problem or point me in the right direction? Thanks in advance.

Just posting this solution to show the image:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<overlay id="tabularity-browser-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="BrowserPreferences">
<prefpane id="tabularityPane" label="tabularityPane;"
onpaneload="populateSchedulesList()"
image="chrome://tabulationtwo/content/images/tab.png">
<preferences>
<preference id="perSession"
name="extensions.tabulation.defaultHomepage"
type="bool"/>
</preferences>
<radiogroup>
<radio preference="perSession" id="session" label="Open tabs once per session" accesskey="S" selected="true"/>
<radio preference="perSession" id="instance" label="Open tabs every tab instance" accesskey="I"/>
</radiogroup>
</prefpane>
</prefwindow>
</overlay>
If you would like to know, how to handle please refer this link :
Menu bar overlay in Firefox
http://hublog.hubmed.org/archives/001606.html
Image:

Related

Change Button icon during runtime

I have activity with button inside GridLayout that is defined like this:
<Button
android:id="#+id/btnOpion4"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_width="0dp"
android:layout_height="0dp"
android:drawableStart="#drawable/btnSend"/>
To be able to show icon on that button i had to create drawable xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/ic_send"
android:state_pressed="true" />
<item android:drawable="#drawable/ic_send"
android:state_focused="true" />
<item android:drawable="#drawable/ic_send" />
</selector>
And all of this is working just fine...
Problem is, how can i change image from code behind?
For example if user click on some option, then change icon on this button?
EDIT:
Can I find that drawable by it's ID, and change icon?
Something like var btnsendDraw = FindViewById(Resource.Drawable.btnSend);
You can accomplish that by using the SetCompoundDrawablesWithIntrinsicBounds method found in the Button class.
In your case, I would create another drawable file with my other background:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/ic_sent"
android:state_pressed="true" />
<item android:drawable="#drawable/ic_sent"
android:state_focused="true" />
<item android:drawable="#drawable/ic_sent" />
</selector>
and let's call it: btnSent.
Now in your code, when you want to change the image just do:
var drawable = GetDrawable(Resource.Drawable.btnSent);
btn1.SetCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
This method gets the 4 different Drawables: left, top, end & bottom in this specific order. Since you only want to replace the start you will set the first parameter.
Note: left and start are "the same".
More about this method here
At the end you should have something like this:
Hope this helps.-

Izpack 5.0 & Maven - Build successful, but shortcut not appearing on Desktop

I've been working on an installer using Izpack 5.0 and Maven. The is created and working, and I can create a shortcut for an uninstaller within the program directory, but I cannot get a shortcut on the desktop.
Here is my shortcutSpec.xml (with actual application name replaced with Program Name for privacy):
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<izpack:shortcuts version="5.0"
xmlns:izpack="http://izpack.org/schema/shortcuts"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/shortcuts
http://izpack.org/schema/5.0/izpack-shortcuts-5.0.xsd">
<programGroup defaultName="Program Name" location="applications"/>
<shortcut
name="Uninstaller"
programGroup="yes"
desktop="yes"
applications="no"
startMenu="no"
startup="no"
target="$INSTALL_PATH\Uninstaller\uninstaller.jar"
commandLine=""
iconFile="%SystemRoot%\system32\SHELL32.dll"
iconIndex="31"
description="This uninstalls the test">
<createForPack name="Core"/>
</shortcut>
</izpack:shortcuts>
And here is my install.xml:
<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation
http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<info>
<appname>Program Name </appname>
<appversion>1.0</appversion>
<javaversion>1.8</javaversion>
</info>
<locale>
<langpack iso3="eng"/>
</locale>
<natives>
<native type="izpack" name="ShellLink.dll"/>
<native type="izpack" name="ShellLink_x64.dll"/>
</natives>
<res src="shortcutSpec.xml" id="shortcutSpec.xml"/>
<guiprefs height="400" resizable="no" width="640">
<modifier key="useButtonIcons" value="yes"/>
<modifier key="useLabelIcons" value="no"/>
<modifier key="labelGap" value="2"/>
<modifier key="layoutAnchor" value="NORTHWEST"/>
<modifier key="useHeadingPanel" value="no"/>
<modifier key="headingImageOnLeft" value="yes"/>
<modifier key="headingLineCount" value="1"/>
<modifier key="headingFontSize" value="1.5"/>
<modifier key="headingBackgroundColor" value="0x00ffffff"/>
<modifier key="headingPanelCounter" value="progressbar"/>
<modifier key="headingPanelCounterPos" value="inNavigationPanel"/>
</guiprefs>
<panels>
<panel classname="TargetPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="FinishPanel"/>
</panels>
<packs>
<pack name="Core" required="yes">
<description>Core installation files</description>
<file src="..\ProgramName.jar" targetdir="$INSTALL_PATH" unpack="false" />
</pack>
</packs>
</izpack:installation>
Any help is greatly appreciated!
Remove izpack:shortcuts element from shortcutSpec xml. Here is what I have in my shortcutSpec xml and it works great. I have tried wrapping shortcuts element inside izpack:shortcuts and it never worked.
Wrap shortcut inside shortcuts
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<shortcuts>
<shortcut
name="Falcon"
target="$INSTALL_PATH/falcon.exe"
description="Falcon"
programGroup="false"
desktop="true"
startMenu="true"
runAsAdministrator="true"
/>
</shortcuts>
You need to add the following native libraries to your install.xml:
<natives>
<native type="izpack" name="ShellLink.dll" />
<native type="izpack" name="ShellLink_x64.dll" />
</natives>
These are responsible for creating the shortcuts during installation.
This is also explained in detail in the IzPack Shortcut Panel Documentation .

firefox extension image display in sidebar

I want to display an array of images in my sidebar. The images should be clickable. This is what I got so far in my ff-sidebar.xul file but nothing is shown:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type"text/css" ?>
<!DOCTYPE page SYSTEM "chrome://pos/locale/overlay.dtd">
<page id="posSidebar" title="&posSidebar.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="ff-sidebar.js"/>
<script src="ff-sidebar.css"/>
<vbox flex="1">
<label value="&posSidebar.label;" />
<image id="image1"/>
</vbox>
</page>
and the code of the css file:
#image1
{
list-style-image: url("chrome://myextension/skin/images/1.png" width='135' height='130');
}
Why are you trying to load in your CSS file as a script? also the script declarations should be like this:
<script type="application/x-javascript" src="chrome://rehostimage/content/password_manager.js" />
As for the images showing up, have you tried
<image src="chrome://myextension/skin/images/1.png" />
?

How to insert image in status bar?

I want to create an image in my statusbar, but why it can't appear?
And, how to add menu in status bar when I click right the mouse?
This is my script:
<?xml version="1.0"?>
<!--
# Fungsi dari file ini adalah mengatur tampilan dan perilaku addon.
# Membuat menu "search hadits" pada saat user klik kanan pada halaman browser atau
# pada saat user klik kanan pada kata di halaman browser.
-->
<overlay id="inline_trans"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!--
# Membuat Menu Klik kanan pada halaman firefox.
# Memanggil fungsi pada haditsSearch.js untuk mulai melakukan pencarian hadits.
-->
<popup id="contentAreaContextMenu">
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
<!-- ======================================================== -->
<!--
<window id="main-window">
<popupset id="mainPopupSet"></popupset>
<vbox id="hadits_holder" />
</window>
-->
<!--
<spacer flex="1"/>
<progressmeter mode="determined" value="82"/>
-->
<statusbar id="status-bar">
<statusbarpanel id="status-bar-inlinetrans"
src="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="indonesia inline translator"
context="indonesia inline translator menu"
onclick="alert('okeh cuy')"
tooltiptext="inlinetrans versi 1.0"
/>
</statusbar>
</overlay>
You need an <image>. Something like:
<statusbar id="status-bar">
<statusbarpanel id="status-bar-inlinetrans">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
</statusbarpanel>
</statusbar>
The other attributes can probably go on either the image or the statusbarpanel.

Getting XUL:Scale to show what numeric value is selected

I'm working with XUL, and below is abasic slider/scale implementation:
<scale value="1" min="1" max="10" increment="1"/>
However I want a numbox next to it which displays the value selected in the slider, and maybe I didn't look hard enough in the XUL tutorial, but I couldn't find a feasible answer.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<scale value="1" min="1" max="10" increment="1" id="a"/>
<textbox readonly="true" observes="a"/>
</window>

Resources